Lines Matching full:rtas
4 * Procedures for interfacing to the RTAS on CHRP machines.
30 #include <asm/rtas.h>
54 srr_regs_clobbered(); /* rtas uses SRRs, invalidate */ in do_enter_rtas()
57 struct rtas_t rtas = { variable
60 EXPORT_SYMBOL(rtas);
77 /* RTAS use home made raw locking instead of spin_lock_irqsave
88 arch_spin_lock(&rtas.lock); in lock_rtas()
94 arch_spin_unlock(&rtas.lock); in unlock_rtas()
108 if (!rtas.base) in call_rtas_display_status()
112 rtas_call_unlocked(&rtas.args, 10, 1, 1, NULL, c); in call_rtas_display_status()
149 * hardcode rtas.base/entry etc.
158 if (!rtas.base) in udbg_rtascon_putc()
177 if (!rtas.base) in udbg_rtascon_getc_poll()
218 if (!rtas.base) in rtas_progress()
223 if ((root = of_find_node_by_path("/rtas"))) { in rtas_progress()
292 /* RTAS wants CR-LF, not just LF */ in rtas_progress()
328 if (rtas.dev == NULL) in rtas_token()
330 tokp = of_get_property(rtas.dev, service, NULL); in rtas_token()
344 * for all rtas calls that require an error buffer argument.
345 * This includes 'check-exception' and 'rtas-last-error'.
353 rtas_error_log_max = rtas_token ("rtas-error-log-max"); in rtas_get_error_log_max()
356 printk (KERN_WARNING "RTAS: bad log buffer size %d\n", in rtas_get_error_log_max()
369 * most recent failed call to rtas. Because the error text
370 * might go stale if there are any other intervening rtas calls,
372 * the error (i.e. with rtas.lock still held from the previous call).
392 save_args = rtas.args; in __fetch_rtas_last_error()
393 rtas.args = err_args; in __fetch_rtas_last_error()
395 do_enter_rtas(__pa(&rtas.args)); in __fetch_rtas_last_error()
397 err_args = rtas.args; in __fetch_rtas_last_error()
398 rtas.args = save_args; in __fetch_rtas_last_error()
462 if (!rtas.entry || token == RTAS_UNKNOWN_SERVICE) in rtas_call()
467 /* We use the global rtas args buffer */ in rtas_call()
468 rtas_args = &rtas.args; in rtas_call()
516 /* For an RTAS busy status code, perform the hinted delay. */
551 printk(KERN_ERR "%s: unexpected RTAS error %d\n", in rtas_error_rc()
637 indicators = of_get_property(rtas.dev, "rtas-indicators", &proplen); in rtas_indicator_present()
674 * Ignoring RTAS extended delay
698 * @fw_status: RTAS call status will be placed here if not NULL.
756 printk("RTAS system-reboot returned %d\n", in rtas_restart()
766 printk("RTAS power-off returned %d\n", in rtas_power_off()
776 printk("RTAS power-off returned %d\n", in rtas_halt()
841 * rtas_call_reentrant() - Used for reentrant rtas calls
842 * @token: Token for desired reentrant RTAS call
846 * @...: Inputs for desired RTAS call
850 * Reentrant calls need their own rtas_args buffer, so not using rtas.args, but
854 * First output value of RTAS call if (nret > 0),
864 if (!rtas.entry || token == RTAS_UNKNOWN_SERVICE) in rtas_call_reentrant()
870 /* We use the per-cpu (PACA) rtas args buffer */ in rtas_call_reentrant()
893 * Find a specific pseries error log in an RTAS extended event log.
894 * @log: RTAS error/event log
933 * arbitrary physical addresses to RTAS calls. A number of RTAS calls
940 * subset of RTAS calls.
942 * Accordingly, we filter RTAS requests to check that the call is
1056 pr_err_ratelimited("sys_rtas: RTAS call blocked - exploit attempt?\n"); in block_rtas_call()
1085 SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) in SYSCALL_DEFINE1() argument
1095 if (!rtas.entry) in SYSCALL_DEFINE1()
1148 rtas.args = args; in SYSCALL_DEFINE1()
1149 do_enter_rtas(__pa(&rtas.args)); in SYSCALL_DEFINE1()
1150 args = rtas.args; in SYSCALL_DEFINE1()
1176 * Call early during boot, before mem init, to retrieve the RTAS
1186 /* Get RTAS dev node and fill up our "rtas" structure with infos in rtas_initialize()
1189 rtas.dev = of_find_node_by_name(NULL, "rtas"); in rtas_initialize()
1190 if (!rtas.dev) in rtas_initialize()
1193 no_base = of_property_read_u32(rtas.dev, "linux,rtas-base", &base); in rtas_initialize()
1194 no_size = of_property_read_u32(rtas.dev, "rtas-size", &size); in rtas_initialize()
1196 of_node_put(rtas.dev); in rtas_initialize()
1197 rtas.dev = NULL; in rtas_initialize()
1201 rtas.base = base; in rtas_initialize()
1202 rtas.size = size; in rtas_initialize()
1203 no_entry = of_property_read_u32(rtas.dev, "linux,rtas-entry", &entry); in rtas_initialize()
1204 rtas.entry = no_entry ? rtas.base : entry; in rtas_initialize()
1206 /* If RTAS was found, allocate the RMO buffer for it and look for in rtas_initialize()
1216 panic("ERROR: RTAS: Failed to allocate %lx bytes below %pa\n", in rtas_initialize()
1220 rtas_last_error_token = rtas_token("rtas-last-error"); in rtas_initialize()
1231 if (depth != 1 || strcmp(uname, "rtas") != 0) in early_init_dt_scan_rtas()
1234 basep = of_get_flat_dt_prop(node, "linux,rtas-base", NULL); in early_init_dt_scan_rtas()
1235 entryp = of_get_flat_dt_prop(node, "linux,rtas-entry", NULL); in early_init_dt_scan_rtas()
1236 sizep = of_get_flat_dt_prop(node, "rtas-size", NULL); in early_init_dt_scan_rtas()
1239 rtas.base = *basep; in early_init_dt_scan_rtas()
1240 rtas.entry = *entryp; in early_init_dt_scan_rtas()
1241 rtas.size = *sizep; in early_init_dt_scan_rtas()