rtas.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. /*
  2. *
  3. * Procedures for interfacing to the RTAS on CHRP machines.
  4. *
  5. * Peter Bergner, IBM March 2001.
  6. * Copyright (C) 2001 IBM.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version
  11. * 2 of the License, or (at your option) any later version.
  12. */
  13. #include <stdarg.h>
  14. #include <linux/kernel.h>
  15. #include <linux/types.h>
  16. #include <linux/spinlock.h>
  17. #include <linux/module.h>
  18. #include <linux/init.h>
  19. #include <asm/prom.h>
  20. #include <asm/rtas.h>
  21. #include <asm/semaphore.h>
  22. #include <asm/machdep.h>
  23. #include <asm/page.h>
  24. #include <asm/param.h>
  25. #include <asm/system.h>
  26. #include <asm/abs_addr.h>
  27. #include <asm/udbg.h>
  28. #include <asm/delay.h>
  29. #include <asm/uaccess.h>
  30. #include <asm/systemcfg.h>
  31. struct flash_block_list_header rtas_firmware_flash_list = {0, NULL};
  32. struct rtas_t rtas = {
  33. .lock = SPIN_LOCK_UNLOCKED
  34. };
  35. EXPORT_SYMBOL(rtas);
  36. char rtas_err_buf[RTAS_ERROR_LOG_MAX];
  37. DEFINE_SPINLOCK(rtas_data_buf_lock);
  38. char rtas_data_buf[RTAS_DATA_BUF_SIZE]__page_aligned;
  39. unsigned long rtas_rmo_buf;
  40. void
  41. call_rtas_display_status(unsigned char c)
  42. {
  43. struct rtas_args *args = &rtas.args;
  44. unsigned long s;
  45. if (!rtas.base)
  46. return;
  47. spin_lock_irqsave(&rtas.lock, s);
  48. args->token = 10;
  49. args->nargs = 1;
  50. args->nret = 1;
  51. args->rets = (rtas_arg_t *)&(args->args[1]);
  52. args->args[0] = (int)c;
  53. enter_rtas(__pa(args));
  54. spin_unlock_irqrestore(&rtas.lock, s);
  55. }
  56. void
  57. call_rtas_display_status_delay(unsigned char c)
  58. {
  59. static int pending_newline = 0; /* did last write end with unprinted newline? */
  60. static int width = 16;
  61. if (c == '\n') {
  62. while (width-- > 0)
  63. call_rtas_display_status(' ');
  64. width = 16;
  65. udelay(500000);
  66. pending_newline = 1;
  67. } else {
  68. if (pending_newline) {
  69. call_rtas_display_status('\r');
  70. call_rtas_display_status('\n');
  71. }
  72. pending_newline = 0;
  73. if (width--) {
  74. call_rtas_display_status(c);
  75. udelay(10000);
  76. }
  77. }
  78. }
  79. int
  80. rtas_token(const char *service)
  81. {
  82. int *tokp;
  83. if (rtas.dev == NULL) {
  84. PPCDBG(PPCDBG_RTAS,"\tNo rtas device in device-tree...\n");
  85. return RTAS_UNKNOWN_SERVICE;
  86. }
  87. tokp = (int *) get_property(rtas.dev, service, NULL);
  88. return tokp ? *tokp : RTAS_UNKNOWN_SERVICE;
  89. }
  90. /*
  91. * Return the firmware-specified size of the error log buffer
  92. * for all rtas calls that require an error buffer argument.
  93. * This includes 'check-exception' and 'rtas-last-error'.
  94. */
  95. int rtas_get_error_log_max(void)
  96. {
  97. static int rtas_error_log_max;
  98. if (rtas_error_log_max)
  99. return rtas_error_log_max;
  100. rtas_error_log_max = rtas_token ("rtas-error-log-max");
  101. if ((rtas_error_log_max == RTAS_UNKNOWN_SERVICE) ||
  102. (rtas_error_log_max > RTAS_ERROR_LOG_MAX)) {
  103. printk (KERN_WARNING "RTAS: bad log buffer size %d\n", rtas_error_log_max);
  104. rtas_error_log_max = RTAS_ERROR_LOG_MAX;
  105. }
  106. return rtas_error_log_max;
  107. }
  108. /** Return a copy of the detailed error text associated with the
  109. * most recent failed call to rtas. Because the error text
  110. * might go stale if there are any other intervening rtas calls,
  111. * this routine must be called atomically with whatever produced
  112. * the error (i.e. with rtas.lock still held from the previous call).
  113. */
  114. static int
  115. __fetch_rtas_last_error(void)
  116. {
  117. struct rtas_args err_args, save_args;
  118. u32 bufsz;
  119. bufsz = rtas_get_error_log_max();
  120. err_args.token = rtas_token("rtas-last-error");
  121. err_args.nargs = 2;
  122. err_args.nret = 1;
  123. err_args.args[0] = (rtas_arg_t)__pa(rtas_err_buf);
  124. err_args.args[1] = bufsz;
  125. err_args.args[2] = 0;
  126. save_args = rtas.args;
  127. rtas.args = err_args;
  128. enter_rtas(__pa(&rtas.args));
  129. err_args = rtas.args;
  130. rtas.args = save_args;
  131. return err_args.args[2];
  132. }
  133. int rtas_call(int token, int nargs, int nret, int *outputs, ...)
  134. {
  135. va_list list;
  136. int i, logit = 0;
  137. unsigned long s;
  138. struct rtas_args *rtas_args;
  139. char * buff_copy = NULL;
  140. int ret;
  141. PPCDBG(PPCDBG_RTAS, "Entering rtas_call\n");
  142. PPCDBG(PPCDBG_RTAS, "\ttoken = 0x%x\n", token);
  143. PPCDBG(PPCDBG_RTAS, "\tnargs = %d\n", nargs);
  144. PPCDBG(PPCDBG_RTAS, "\tnret = %d\n", nret);
  145. PPCDBG(PPCDBG_RTAS, "\t&outputs = 0x%lx\n", outputs);
  146. if (token == RTAS_UNKNOWN_SERVICE)
  147. return -1;
  148. /* Gotta do something different here, use global lock for now... */
  149. spin_lock_irqsave(&rtas.lock, s);
  150. rtas_args = &rtas.args;
  151. rtas_args->token = token;
  152. rtas_args->nargs = nargs;
  153. rtas_args->nret = nret;
  154. rtas_args->rets = (rtas_arg_t *)&(rtas_args->args[nargs]);
  155. va_start(list, outputs);
  156. for (i = 0; i < nargs; ++i) {
  157. rtas_args->args[i] = va_arg(list, rtas_arg_t);
  158. PPCDBG(PPCDBG_RTAS, "\tnarg[%d] = 0x%x\n", i, rtas_args->args[i]);
  159. }
  160. va_end(list);
  161. for (i = 0; i < nret; ++i)
  162. rtas_args->rets[i] = 0;
  163. PPCDBG(PPCDBG_RTAS, "\tentering rtas with 0x%lx\n",
  164. __pa(rtas_args));
  165. enter_rtas(__pa(rtas_args));
  166. PPCDBG(PPCDBG_RTAS, "\treturned from rtas ...\n");
  167. /* A -1 return code indicates that the last command couldn't
  168. be completed due to a hardware error. */
  169. if (rtas_args->rets[0] == -1)
  170. logit = (__fetch_rtas_last_error() == 0);
  171. ifppcdebug(PPCDBG_RTAS) {
  172. for(i=0; i < nret ;i++)
  173. udbg_printf("\tnret[%d] = 0x%lx\n", i, (ulong)rtas_args->rets[i]);
  174. }
  175. if (nret > 1 && outputs != NULL)
  176. for (i = 0; i < nret-1; ++i)
  177. outputs[i] = rtas_args->rets[i+1];
  178. ret = (nret > 0)? rtas_args->rets[0]: 0;
  179. /* Log the error in the unlikely case that there was one. */
  180. if (unlikely(logit)) {
  181. buff_copy = rtas_err_buf;
  182. if (mem_init_done) {
  183. buff_copy = kmalloc(RTAS_ERROR_LOG_MAX, GFP_ATOMIC);
  184. if (buff_copy)
  185. memcpy(buff_copy, rtas_err_buf,
  186. RTAS_ERROR_LOG_MAX);
  187. }
  188. }
  189. /* Gotta do something different here, use global lock for now... */
  190. spin_unlock_irqrestore(&rtas.lock, s);
  191. if (buff_copy) {
  192. log_error(buff_copy, ERR_TYPE_RTAS_LOG, 0);
  193. if (mem_init_done)
  194. kfree(buff_copy);
  195. }
  196. return ret;
  197. }
  198. /* Given an RTAS status code of 990n compute the hinted delay of 10^n
  199. * (last digit) milliseconds. For now we bound at n=5 (100 sec).
  200. */
  201. unsigned int
  202. rtas_extended_busy_delay_time(int status)
  203. {
  204. int order = status - 9900;
  205. unsigned long ms;
  206. if (order < 0)
  207. order = 0; /* RTC depends on this for -2 clock busy */
  208. else if (order > 5)
  209. order = 5; /* bound */
  210. /* Use microseconds for reasonable accuracy */
  211. for (ms=1; order > 0; order--)
  212. ms *= 10;
  213. return ms;
  214. }
  215. int rtas_error_rc(int rtas_rc)
  216. {
  217. int rc;
  218. switch (rtas_rc) {
  219. case -1: /* Hardware Error */
  220. rc = -EIO;
  221. break;
  222. case -3: /* Bad indicator/domain/etc */
  223. rc = -EINVAL;
  224. break;
  225. case -9000: /* Isolation error */
  226. rc = -EFAULT;
  227. break;
  228. case -9001: /* Outstanding TCE/PTE */
  229. rc = -EEXIST;
  230. break;
  231. case -9002: /* No usable slot */
  232. rc = -ENODEV;
  233. break;
  234. default:
  235. printk(KERN_ERR "%s: unexpected RTAS error %d\n",
  236. __FUNCTION__, rtas_rc);
  237. rc = -ERANGE;
  238. break;
  239. }
  240. return rc;
  241. }
  242. int rtas_get_power_level(int powerdomain, int *level)
  243. {
  244. int token = rtas_token("get-power-level");
  245. int rc;
  246. if (token == RTAS_UNKNOWN_SERVICE)
  247. return -ENOENT;
  248. while ((rc = rtas_call(token, 1, 2, level, powerdomain)) == RTAS_BUSY)
  249. udelay(1);
  250. if (rc < 0)
  251. return rtas_error_rc(rc);
  252. return rc;
  253. }
  254. int rtas_set_power_level(int powerdomain, int level, int *setlevel)
  255. {
  256. int token = rtas_token("set-power-level");
  257. unsigned int wait_time;
  258. int rc;
  259. if (token == RTAS_UNKNOWN_SERVICE)
  260. return -ENOENT;
  261. while (1) {
  262. rc = rtas_call(token, 2, 2, setlevel, powerdomain, level);
  263. if (rc == RTAS_BUSY)
  264. udelay(1);
  265. else if (rtas_is_extended_busy(rc)) {
  266. wait_time = rtas_extended_busy_delay_time(rc);
  267. udelay(wait_time * 1000);
  268. } else
  269. break;
  270. }
  271. if (rc < 0)
  272. return rtas_error_rc(rc);
  273. return rc;
  274. }
  275. int rtas_get_sensor(int sensor, int index, int *state)
  276. {
  277. int token = rtas_token("get-sensor-state");
  278. unsigned int wait_time;
  279. int rc;
  280. if (token == RTAS_UNKNOWN_SERVICE)
  281. return -ENOENT;
  282. while (1) {
  283. rc = rtas_call(token, 2, 2, state, sensor, index);
  284. if (rc == RTAS_BUSY)
  285. udelay(1);
  286. else if (rtas_is_extended_busy(rc)) {
  287. wait_time = rtas_extended_busy_delay_time(rc);
  288. udelay(wait_time * 1000);
  289. } else
  290. break;
  291. }
  292. if (rc < 0)
  293. return rtas_error_rc(rc);
  294. return rc;
  295. }
  296. int rtas_set_indicator(int indicator, int index, int new_value)
  297. {
  298. int token = rtas_token("set-indicator");
  299. unsigned int wait_time;
  300. int rc;
  301. if (token == RTAS_UNKNOWN_SERVICE)
  302. return -ENOENT;
  303. while (1) {
  304. rc = rtas_call(token, 3, 1, NULL, indicator, index, new_value);
  305. if (rc == RTAS_BUSY)
  306. udelay(1);
  307. else if (rtas_is_extended_busy(rc)) {
  308. wait_time = rtas_extended_busy_delay_time(rc);
  309. udelay(wait_time * 1000);
  310. }
  311. else
  312. break;
  313. }
  314. if (rc < 0)
  315. return rtas_error_rc(rc);
  316. return rc;
  317. }
  318. #define FLASH_BLOCK_LIST_VERSION (1UL)
  319. static void
  320. rtas_flash_firmware(void)
  321. {
  322. unsigned long image_size;
  323. struct flash_block_list *f, *next, *flist;
  324. unsigned long rtas_block_list;
  325. int i, status, update_token;
  326. update_token = rtas_token("ibm,update-flash-64-and-reboot");
  327. if (update_token == RTAS_UNKNOWN_SERVICE) {
  328. printk(KERN_ALERT "FLASH: ibm,update-flash-64-and-reboot is not available -- not a service partition?\n");
  329. printk(KERN_ALERT "FLASH: firmware will not be flashed\n");
  330. return;
  331. }
  332. /* NOTE: the "first" block list is a global var with no data
  333. * blocks in the kernel data segment. We do this because
  334. * we want to ensure this block_list addr is under 4GB.
  335. */
  336. rtas_firmware_flash_list.num_blocks = 0;
  337. flist = (struct flash_block_list *)&rtas_firmware_flash_list;
  338. rtas_block_list = virt_to_abs(flist);
  339. if (rtas_block_list >= 4UL*1024*1024*1024) {
  340. printk(KERN_ALERT "FLASH: kernel bug...flash list header addr above 4GB\n");
  341. return;
  342. }
  343. printk(KERN_ALERT "FLASH: preparing saved firmware image for flash\n");
  344. /* Update the block_list in place. */
  345. image_size = 0;
  346. for (f = flist; f; f = next) {
  347. /* Translate data addrs to absolute */
  348. for (i = 0; i < f->num_blocks; i++) {
  349. f->blocks[i].data = (char *)virt_to_abs(f->blocks[i].data);
  350. image_size += f->blocks[i].length;
  351. }
  352. next = f->next;
  353. /* Don't translate NULL pointer for last entry */
  354. if (f->next)
  355. f->next = (struct flash_block_list *)virt_to_abs(f->next);
  356. else
  357. f->next = NULL;
  358. /* make num_blocks into the version/length field */
  359. f->num_blocks = (FLASH_BLOCK_LIST_VERSION << 56) | ((f->num_blocks+1)*16);
  360. }
  361. printk(KERN_ALERT "FLASH: flash image is %ld bytes\n", image_size);
  362. printk(KERN_ALERT "FLASH: performing flash and reboot\n");
  363. ppc_md.progress("Flashing \n", 0x0);
  364. ppc_md.progress("Please Wait... ", 0x0);
  365. printk(KERN_ALERT "FLASH: this will take several minutes. Do not power off!\n");
  366. status = rtas_call(update_token, 1, 1, NULL, rtas_block_list);
  367. switch (status) { /* should only get "bad" status */
  368. case 0:
  369. printk(KERN_ALERT "FLASH: success\n");
  370. break;
  371. case -1:
  372. printk(KERN_ALERT "FLASH: hardware error. Firmware may not be not flashed\n");
  373. break;
  374. case -3:
  375. printk(KERN_ALERT "FLASH: image is corrupt or not correct for this platform. Firmware not flashed\n");
  376. break;
  377. case -4:
  378. printk(KERN_ALERT "FLASH: flash failed when partially complete. System may not reboot\n");
  379. break;
  380. default:
  381. printk(KERN_ALERT "FLASH: unknown flash return code %d\n", status);
  382. break;
  383. }
  384. }
  385. void rtas_flash_bypass_warning(void)
  386. {
  387. printk(KERN_ALERT "FLASH: firmware flash requires a reboot\n");
  388. printk(KERN_ALERT "FLASH: the firmware image will NOT be flashed\n");
  389. }
  390. void
  391. rtas_restart(char *cmd)
  392. {
  393. if (rtas_firmware_flash_list.next)
  394. rtas_flash_firmware();
  395. printk("RTAS system-reboot returned %d\n",
  396. rtas_call(rtas_token("system-reboot"), 0, 1, NULL));
  397. for (;;);
  398. }
  399. void
  400. rtas_power_off(void)
  401. {
  402. if (rtas_firmware_flash_list.next)
  403. rtas_flash_bypass_warning();
  404. /* allow power on only with power button press */
  405. printk("RTAS power-off returned %d\n",
  406. rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1));
  407. for (;;);
  408. }
  409. void
  410. rtas_halt(void)
  411. {
  412. if (rtas_firmware_flash_list.next)
  413. rtas_flash_bypass_warning();
  414. rtas_power_off();
  415. }
  416. /* Must be in the RMO region, so we place it here */
  417. static char rtas_os_term_buf[2048];
  418. void rtas_os_term(char *str)
  419. {
  420. int status;
  421. if (RTAS_UNKNOWN_SERVICE == rtas_token("ibm,os-term"))
  422. return;
  423. snprintf(rtas_os_term_buf, 2048, "OS panic: %s", str);
  424. do {
  425. status = rtas_call(rtas_token("ibm,os-term"), 1, 1, NULL,
  426. __pa(rtas_os_term_buf));
  427. if (status == RTAS_BUSY)
  428. udelay(1);
  429. else if (status != 0)
  430. printk(KERN_EMERG "ibm,os-term call failed %d\n",
  431. status);
  432. } while (status == RTAS_BUSY);
  433. }
  434. asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
  435. {
  436. struct rtas_args args;
  437. unsigned long flags;
  438. char * buff_copy;
  439. int nargs;
  440. int err_rc = 0;
  441. if (!capable(CAP_SYS_ADMIN))
  442. return -EPERM;
  443. if (copy_from_user(&args, uargs, 3 * sizeof(u32)) != 0)
  444. return -EFAULT;
  445. nargs = args.nargs;
  446. if (nargs > ARRAY_SIZE(args.args)
  447. || args.nret > ARRAY_SIZE(args.args)
  448. || nargs + args.nret > ARRAY_SIZE(args.args))
  449. return -EINVAL;
  450. /* Copy in args. */
  451. if (copy_from_user(args.args, uargs->args,
  452. nargs * sizeof(rtas_arg_t)) != 0)
  453. return -EFAULT;
  454. buff_copy = kmalloc(RTAS_ERROR_LOG_MAX, GFP_KERNEL);
  455. spin_lock_irqsave(&rtas.lock, flags);
  456. rtas.args = args;
  457. enter_rtas(__pa(&rtas.args));
  458. args = rtas.args;
  459. args.rets = &args.args[nargs];
  460. /* A -1 return code indicates that the last command couldn't
  461. be completed due to a hardware error. */
  462. if (args.rets[0] == -1) {
  463. err_rc = __fetch_rtas_last_error();
  464. if ((err_rc == 0) && buff_copy) {
  465. memcpy(buff_copy, rtas_err_buf, RTAS_ERROR_LOG_MAX);
  466. }
  467. }
  468. spin_unlock_irqrestore(&rtas.lock, flags);
  469. if (buff_copy) {
  470. if ((args.rets[0] == -1) && (err_rc == 0)) {
  471. log_error(buff_copy, ERR_TYPE_RTAS_LOG, 0);
  472. }
  473. kfree(buff_copy);
  474. }
  475. /* Copy out args. */
  476. if (copy_to_user(uargs->args + nargs,
  477. args.args + nargs,
  478. args.nret * sizeof(rtas_arg_t)) != 0)
  479. return -EFAULT;
  480. return 0;
  481. }
  482. /* This version can't take the spinlock, because it never returns */
  483. struct rtas_args rtas_stop_self_args = {
  484. /* The token is initialized for real in setup_system() */
  485. .token = RTAS_UNKNOWN_SERVICE,
  486. .nargs = 0,
  487. .nret = 1,
  488. .rets = &rtas_stop_self_args.args[0],
  489. };
  490. void rtas_stop_self(void)
  491. {
  492. struct rtas_args *rtas_args = &rtas_stop_self_args;
  493. local_irq_disable();
  494. BUG_ON(rtas_args->token == RTAS_UNKNOWN_SERVICE);
  495. printk("cpu %u (hwid %u) Ready to die...\n",
  496. smp_processor_id(), hard_smp_processor_id());
  497. enter_rtas(__pa(rtas_args));
  498. panic("Alas, I survived.\n");
  499. }
  500. /*
  501. * Call early during boot, before mem init or bootmem, to retreive the RTAS
  502. * informations from the device-tree and allocate the RMO buffer for userland
  503. * accesses.
  504. */
  505. void __init rtas_initialize(void)
  506. {
  507. /* Get RTAS dev node and fill up our "rtas" structure with infos
  508. * about it.
  509. */
  510. rtas.dev = of_find_node_by_name(NULL, "rtas");
  511. if (rtas.dev) {
  512. u32 *basep, *entryp;
  513. u32 *sizep;
  514. basep = (u32 *)get_property(rtas.dev, "linux,rtas-base", NULL);
  515. sizep = (u32 *)get_property(rtas.dev, "rtas-size", NULL);
  516. if (basep != NULL && sizep != NULL) {
  517. rtas.base = *basep;
  518. rtas.size = *sizep;
  519. entryp = (u32 *)get_property(rtas.dev, "linux,rtas-entry", NULL);
  520. if (entryp == NULL) /* Ugh */
  521. rtas.entry = rtas.base;
  522. else
  523. rtas.entry = *entryp;
  524. } else
  525. rtas.dev = NULL;
  526. }
  527. /* If RTAS was found, allocate the RMO buffer for it and look for
  528. * the stop-self token if any
  529. */
  530. if (rtas.dev) {
  531. unsigned long rtas_region = RTAS_INSTANTIATE_MAX;
  532. if (systemcfg->platform == PLATFORM_PSERIES_LPAR)
  533. rtas_region = min(lmb.rmo_size, RTAS_INSTANTIATE_MAX);
  534. rtas_rmo_buf = lmb_alloc_base(RTAS_RMOBUF_MAX, PAGE_SIZE,
  535. rtas_region);
  536. #ifdef CONFIG_HOTPLUG_CPU
  537. rtas_stop_self_args.token = rtas_token("stop-self");
  538. #endif /* CONFIG_HOTPLUG_CPU */
  539. }
  540. }
  541. EXPORT_SYMBOL(rtas_firmware_flash_list);
  542. EXPORT_SYMBOL(rtas_token);
  543. EXPORT_SYMBOL(rtas_call);
  544. EXPORT_SYMBOL(rtas_data_buf);
  545. EXPORT_SYMBOL(rtas_data_buf_lock);
  546. EXPORT_SYMBOL(rtas_extended_busy_delay_time);
  547. EXPORT_SYMBOL(rtas_get_sensor);
  548. EXPORT_SYMBOL(rtas_get_power_level);
  549. EXPORT_SYMBOL(rtas_set_power_level);
  550. EXPORT_SYMBOL(rtas_set_indicator);
  551. EXPORT_SYMBOL(rtas_get_error_log_max);