Lines Matching full:rtas
4 * Procedures for interfacing to the RTAS on CHRP machines.
29 #include <asm/rtas.h>
49 struct rtas_t rtas = { variable
52 EXPORT_SYMBOL(rtas);
69 /* RTAS use home made raw locking instead of spin_lock_irqsave
80 arch_spin_lock(&rtas.lock); in lock_rtas()
86 arch_spin_unlock(&rtas.lock); in unlock_rtas()
100 if (!rtas.base) in call_rtas_display_status()
104 rtas_call_unlocked(&rtas.args, 10, 1, 1, NULL, c); in call_rtas_display_status()
141 * hardcode rtas.base/entry etc.
150 if (!rtas.base) in udbg_rtascon_putc()
169 if (!rtas.base) in udbg_rtascon_getc_poll()
210 if (!rtas.base) in rtas_progress()
215 if ((root = of_find_node_by_path("/rtas"))) { in rtas_progress()
284 /* RTAS wants CR-LF, not just LF */ in rtas_progress()
320 if (rtas.dev == NULL) in rtas_token()
322 tokp = of_get_property(rtas.dev, service, NULL); in rtas_token()
336 * for all rtas calls that require an error buffer argument.
337 * This includes 'check-exception' and 'rtas-last-error'.
345 rtas_error_log_max = rtas_token ("rtas-error-log-max"); in rtas_get_error_log_max()
348 printk (KERN_WARNING "RTAS: bad log buffer size %d\n", in rtas_get_error_log_max()
361 * most recent failed call to rtas. Because the error text
362 * might go stale if there are any other intervening rtas calls,
364 * the error (i.e. with rtas.lock still held from the previous call).
384 save_args = rtas.args; in __fetch_rtas_last_error()
385 rtas.args = err_args; in __fetch_rtas_last_error()
387 enter_rtas(__pa(&rtas.args)); in __fetch_rtas_last_error()
389 err_args = rtas.args; in __fetch_rtas_last_error()
390 rtas.args = save_args; in __fetch_rtas_last_error()
454 if (!rtas.entry || token == RTAS_UNKNOWN_SERVICE) in rtas_call()
459 /* We use the global rtas args buffer */ in rtas_call()
460 rtas_args = &rtas.args; in rtas_call()
508 /* For an RTAS busy status code, perform the hinted delay. */
543 printk(KERN_ERR "%s: unexpected RTAS error %d\n", in rtas_error_rc()
629 indicators = of_get_property(rtas.dev, "rtas-indicators", &proplen); in rtas_indicator_present()
666 * Ignoring RTAS extended delay
691 printk("RTAS system-reboot returned %d\n", in rtas_restart()
701 printk("RTAS power-off returned %d\n", in rtas_power_off()
711 printk("RTAS power-off returned %d\n", in rtas_halt()
884 * rtas call in rtas_ibm_suspend_me()
902 * rtas_call_reentrant() - Used for reentrant rtas calls
903 * @token: Token for desired reentrant RTAS call
907 * @...: Inputs for desired RTAS call
911 * Reentrant calls need their own rtas_args buffer, so not using rtas.args, but
915 * First output value of RTAS call if (nret > 0),
925 if (!rtas.entry || token == RTAS_UNKNOWN_SERVICE) in rtas_call_reentrant()
931 /* We use the per-cpu (PACA) rtas args buffer */ in rtas_call_reentrant()
959 * Find a specific pseries error log in an RTAS extended event log.
960 * @log: RTAS error/event log
999 * arbitrary physical addresses to RTAS calls. A number of RTAS calls
1006 * subset of RTAS calls.
1008 * Accordingly, we filter RTAS requests to check that the call is
1120 pr_err_ratelimited("sys_rtas: RTAS call blocked - exploit attempt?\n"); in block_rtas_call()
1137 SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) in SYSCALL_DEFINE1() argument
1147 if (!rtas.entry) in SYSCALL_DEFINE1()
1200 rtas.args = args; in SYSCALL_DEFINE1()
1201 enter_rtas(__pa(&rtas.args)); in SYSCALL_DEFINE1()
1202 args = rtas.args; in SYSCALL_DEFINE1()
1228 * Call early during boot, before mem init, to retrieve the RTAS
1241 /* Get RTAS dev node and fill up our "rtas" structure with infos in rtas_initialize()
1244 rtas.dev = of_find_node_by_name(NULL, "rtas"); in rtas_initialize()
1245 if (!rtas.dev) in rtas_initialize()
1248 no_base = of_property_read_u32(rtas.dev, "linux,rtas-base", &base); in rtas_initialize()
1249 no_size = of_property_read_u32(rtas.dev, "rtas-size", &size); in rtas_initialize()
1251 of_node_put(rtas.dev); in rtas_initialize()
1252 rtas.dev = NULL; in rtas_initialize()
1256 rtas.base = base; in rtas_initialize()
1257 rtas.size = size; in rtas_initialize()
1258 no_entry = of_property_read_u32(rtas.dev, "linux,rtas-entry", &entry); in rtas_initialize()
1259 rtas.entry = no_entry ? rtas.base : entry; in rtas_initialize()
1261 /* If RTAS was found, allocate the RMO buffer for it and look for in rtas_initialize()
1273 panic("ERROR: RTAS: Failed to allocate %lx bytes below %pa\n", in rtas_initialize()
1277 rtas_last_error_token = rtas_token("rtas-last-error"); in rtas_initialize()
1292 if (depth != 1 || strcmp(uname, "rtas") != 0) in early_init_dt_scan_rtas()
1295 basep = of_get_flat_dt_prop(node, "linux,rtas-base", NULL); in early_init_dt_scan_rtas()
1296 entryp = of_get_flat_dt_prop(node, "linux,rtas-entry", NULL); in early_init_dt_scan_rtas()
1297 sizep = of_get_flat_dt_prop(node, "rtas-size", NULL); in early_init_dt_scan_rtas()
1300 rtas.base = *basep; in early_init_dt_scan_rtas()
1301 rtas.entry = *entryp; in early_init_dt_scan_rtas()
1302 rtas.size = *sizep; in early_init_dt_scan_rtas()