Lines Matching +full:used +full:- +full:by +full:- +full:rtas
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
46 #include <machine/rtas.h>
50 static MALLOC_DEFINE(M_RTAS, "rtas", "Run Time Abstraction Service");
58 static phandle_t rtas; variable
66 * After the VM is up, allocate RTAS memory and instantiate it
81 rtas = OF_finddevice("/rtas"); in rtas_setup()
82 if (rtas == -1) { in rtas_setup()
83 rtas = 0; in rtas_setup()
86 OF_package_to_path(rtas, path, sizeof(path)); in rtas_setup()
88 mtx_init(&rtas_mtx, "RTAS", NULL, MTX_SPIN); in rtas_setup()
90 /* RTAS must be called with everything turned off in MSR */ in rtas_setup()
99 * that can fit into a 32-bit address space and accessed from real mode. in rtas_setup()
100 * This is used both to bounce arguments and for RTAS private data. in rtas_setup()
102 * It must be 4KB-aligned and not cross a 256 MB boundary. in rtas_setup()
105 OF_getencprop(rtas, "rtas-size", &rtas_size, sizeof(rtas_size)); in rtas_setup()
117 * Instantiate RTAS. We always use the 32-bit version. in rtas_setup()
120 if (OF_hasprop(rtas, "linux,rtas-entry") && in rtas_setup()
121 OF_hasprop(rtas, "linux,rtas-base")) { in rtas_setup()
122 OF_getencprop(rtas, "linux,rtas-base", &rtas_ptr, in rtas_setup()
125 OF_getencprop(rtas, "linux,rtas-entry", &rtas_ptr, in rtas_setup()
130 rtas = 0; in rtas_setup()
131 printf("Error initializing RTAS: could not open " in rtas_setup()
136 result = OF_call_method("instantiate-rtas", rtasi, 1, 1, in rtas_setup()
141 rtas = 0; in rtas_setup()
143 printf("Error initializing RTAS (%d)\n", result); in rtas_setup()
162 rtas_bounce_offset += sizeof(register_t) - in rtas_real_map()
166 panic("Oversize RTAS call!"); in rtas_real_map()
189 memcpy(buf, rtas_bounce_virt + (physaddr - rtas_bounce_phys), len); in rtas_real_unmap()
192 /* Check if we have RTAS */
196 return (rtas != 0); in rtas_exists()
199 /* Call an RTAS method by token */
215 return (-1); in rtas_call_method()
233 oldfaultbuf = curthread->td_pcb->pcb_onfault; in rtas_call_method()
234 curthread->td_pcb->pcb_onfault = &env; in rtas_call_method()
242 curthread->td_pcb->pcb_onfault = oldfaultbuf; in rtas_call_method()
256 /* Look up an RTAS token */
263 return (-1); in rtas_token_lookup()
265 if (OF_getencprop(rtas, method, &token, sizeof(token)) == -1) in rtas_token_lookup()
266 return (-1); in rtas_token_lookup()