Lines Matching full:rtas
4 * Procedures for interfacing to the RTAS on CHRP machines.
32 #include <asm/rtas.h>
68 srr_regs_clobbered(); /* rtas uses SRRs, invalidate */ in do_enter_rtas()
71 struct rtas_t rtas = { variable
74 EXPORT_SYMBOL(rtas);
91 /* RTAS use home made raw locking instead of spin_lock_irqsave
102 arch_spin_lock(&rtas.lock); in lock_rtas()
108 arch_spin_unlock(&rtas.lock); in unlock_rtas()
122 if (!rtas.base) in call_rtas_display_status()
126 rtas_call_unlocked(&rtas.args, 10, 1, 1, NULL, c); in call_rtas_display_status()
163 * hardcode rtas.base/entry etc.
172 if (!rtas.base) in udbg_rtascon_putc()
191 if (!rtas.base) in udbg_rtascon_getc_poll()
232 if (!rtas.base) in rtas_progress()
237 if ((root = of_find_node_by_path("/rtas"))) { in rtas_progress()
306 /* RTAS wants CR-LF, not just LF */ in rtas_progress()
342 if (rtas.dev == NULL) in rtas_token()
344 tokp = of_get_property(rtas.dev, service, NULL); in rtas_token()
358 * for all rtas calls that require an error buffer argument.
359 * This includes 'check-exception' and 'rtas-last-error'.
367 rtas_error_log_max = rtas_token ("rtas-error-log-max"); in rtas_get_error_log_max()
370 printk (KERN_WARNING "RTAS: bad log buffer size %d\n", in rtas_get_error_log_max()
383 * most recent failed call to rtas. Because the error text
384 * might go stale if there are any other intervening rtas calls,
386 * the error (i.e. with rtas.lock still held from the previous call).
406 save_args = rtas.args; in __fetch_rtas_last_error()
407 rtas.args = err_args; in __fetch_rtas_last_error()
409 do_enter_rtas(__pa(&rtas.args)); in __fetch_rtas_last_error()
411 err_args = rtas.args; in __fetch_rtas_last_error()
412 rtas.args = save_args; in __fetch_rtas_last_error()
479 if (!rtas.entry || token == RTAS_UNKNOWN_SERVICE) in rtas_call()
486 * RTAS status, not an errno. in rtas_call()
499 /* We use the global rtas args buffer */ in rtas_call()
500 rtas_args = &rtas.args; in rtas_call()
528 * rtas_busy_delay_time() - From an RTAS status value, calculate the
532 * the status of a RTAS function call.
566 * rtas_busy_delay() - helper for RTAS busy and extended delay statuses
569 * the status of a RTAS function call.
577 * Generally the caller should reattempt the RTAS call which
660 printk(KERN_ERR "%s: unexpected RTAS error %d\n", in rtas_error_rc()
746 indicators = of_get_property(rtas.dev, "rtas-indicators", &proplen); in rtas_indicator_present()
783 * Ignoring RTAS extended delay
807 * @fw_status: RTAS call status will be placed here if not NULL.
865 printk("RTAS system-reboot returned %d\n", in rtas_restart()
875 printk("RTAS power-off returned %d\n", in rtas_power_off()
885 printk("RTAS power-off returned %d\n", in rtas_halt()
949 * get_pseries_errorlog() - Find a specific pseries error log in an RTAS
951 * @log: RTAS error/event log
990 * arbitrary physical addresses to RTAS calls. A number of RTAS calls
997 * subset of RTAS calls.
999 * Accordingly, we filter RTAS requests to check that the call is
1122 pr_err_ratelimited("sys_rtas: RTAS call blocked - exploit attempt?\n"); in block_rtas_call()
1151 SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) in SYSCALL_DEFINE1() argument
1161 if (!rtas.entry) in SYSCALL_DEFINE1()
1222 rtas.args = args; in SYSCALL_DEFINE1()
1223 do_enter_rtas(__pa(&rtas.args)); in SYSCALL_DEFINE1()
1224 args = rtas.args; in SYSCALL_DEFINE1()
1250 * Call early during boot, before mem init, to retrieve the RTAS
1260 /* Get RTAS dev node and fill up our "rtas" structure with infos in rtas_initialize()
1263 rtas.dev = of_find_node_by_name(NULL, "rtas"); in rtas_initialize()
1264 if (!rtas.dev) in rtas_initialize()
1267 no_base = of_property_read_u32(rtas.dev, "linux,rtas-base", &base); in rtas_initialize()
1268 no_size = of_property_read_u32(rtas.dev, "rtas-size", &size); in rtas_initialize()
1270 of_node_put(rtas.dev); in rtas_initialize()
1271 rtas.dev = NULL; in rtas_initialize()
1275 rtas.base = base; in rtas_initialize()
1276 rtas.size = size; in rtas_initialize()
1277 no_entry = of_property_read_u32(rtas.dev, "linux,rtas-entry", &entry); in rtas_initialize()
1278 rtas.entry = no_entry ? rtas.base : entry; in rtas_initialize()
1280 /* If RTAS was found, allocate the RMO buffer for it and look for in rtas_initialize()
1290 panic("ERROR: RTAS: Failed to allocate %lx bytes below %pa\n", in rtas_initialize()
1294 rtas_last_error_token = rtas_token("rtas-last-error"); in rtas_initialize()
1306 if (depth != 1 || strcmp(uname, "rtas") != 0) in early_init_dt_scan_rtas()
1309 basep = of_get_flat_dt_prop(node, "linux,rtas-base", NULL); in early_init_dt_scan_rtas()
1310 entryp = of_get_flat_dt_prop(node, "linux,rtas-entry", NULL); in early_init_dt_scan_rtas()
1311 sizep = of_get_flat_dt_prop(node, "rtas-size", NULL); in early_init_dt_scan_rtas()
1320 rtas.base = *basep; in early_init_dt_scan_rtas()
1321 rtas.entry = *entryp; in early_init_dt_scan_rtas()
1322 rtas.size = *sizep; in early_init_dt_scan_rtas()