1 /******************************************************************************
2 * Copyright (c) 2004, 2008 IBM Corporation
4 * This program and the accompanying materials
5 * are made available under the terms of the BSD License
6 * which accompanies this distribution, and is available at
7 * http://www.opensource.org/licenses/bsd-license.php
10 * IBM Corporation - initial implementation
11 *****************************************************************************/
15 // : ipmi-kcs-cmd ( in-buf in-len out-buf out-maxlen -- out-len errorcode )
16 PRIM(IPMI_X2d_KCS_X2d_CMD)
17 cell maxlen = TOS; POP;
18 cell outbuf = TOS; POP;
22 retval = ipmi_kcs_cmd(inbuf.a, outbuf.a, maxlen.n, (uint32_t *) &len);
28 PRIM(IPMI_X2d_SYSTEM_X2d_REBOOT)
33 PRIM(IPMI_X2d_POWER_X2d_OFF)
38 // : ipmi-oem-stop-bootwatchdog ( -- errorcode )
39 PRIM(IPMI_X2d_OEM_X2d_STOP_X2d_BOOTWATCHDOG)
41 TOS.n = ipmi_oem_stop_bootwatchdog();
45 // : ipmi-oem-set-bootwatchdog ( seconds -- errorcode )
46 PRIM(IPMI_X2d_OEM_X2d_SET_X2d_BOOTWATCHDOG)
48 TOS.n = ipmi_oem_set_bootwatchdog(sec);
52 // : ipmi-oem-reset-bootwatchdog ( -- errorcode )
53 PRIM(IPMI_X2d_OEM_X2d_RESET_X2d_BOOTWATCHDOG)
55 TOS.n = ipmi_oem_reset_bootwatchdog();
59 // : ipmi-oem-led-set ( type instance state -- errorcode )
60 PRIM(IPMI_X2d_OEM_X2d_LED_X2d_SET)
61 int state = TOS.n; POP;
62 int instance = TOS.n; POP;
64 TOS.n = ipmi_oem_led_set(type, instance, state);
68 // : ipmi-oem-read-vpd ( offset length dst -- status )
69 PRIM(IPMI_X2d_OEM_X2d_READ_X2d_VPD)
73 TOS.n = ipmi_oem_read_vpd(dest.a, len, offset);
76 // : ipmi-oem-write-vpd ( offset length src -- status )
77 PRIM(IPMI_X2d_OEM_X2d_WRITE_X2d_VPD)
81 TOS.n = ipmi_oem_write_vpd(src.a, len, offset);
85 // : ipmi-oem-get-blade-descr ( buf maxlen -- len status )
86 PRIM(IPMI_X2d_OEM_X2d_GET_X2d_BLADE_X2d_DESCR)
87 int maxlen = TOS.n; POP;
91 retval = ipmi_oem_get_blade_descr(buf.a, maxlen, (uint32_t *) &len);
97 // : ipmi-oem-bios2sp ( str-ptr str-len swid type -- errorcode )
98 PRIM(IPMI_X2d_OEM_X2d_BIOS2SP)
99 int type = TOS.n; POP;
100 int swid = TOS.n; POP;
101 int len = TOS.n; POP;
103 TOS.n = ipmi_oem_bios2sp(swid, type, addr, len);
106 // : ipmi-set-sensor ( param-1 ... param-n n command sensor - errorcode )
107 PRIM(IPMI_X2d_SET_X2d_SENSOR)
108 int sensor = TOS.n; POP;
109 int cmd = TOS.n; POP;
117 TOS.n = ipmi_set_sensor((cmd<<8)+sensor,n,
118 param[0],param[1],param[2],param[3],param[4],
119 param[5],param[6],param[7],param[8],param[9]);