20 #include "pedigree/kernel/machine/openfirmware/OpenFirmware.h" 21 #include "pedigree/kernel/LockGuard.h" 22 #include "pedigree/kernel/Spinlock.h" 23 #include "pedigree/kernel/machine/openfirmware/Device.h" 31 OpenFirmware::~OpenFirmware()
40 asm volatile(
"mfsprg0 %0" :
"=r"(
m_Sprg0));
41 asm volatile(
"mfsprg1 %0" :
"=r"(m_Sprg1));
42 asm volatile(
"mfsprg2 %0" :
"=r"(m_Sprg2));
43 asm volatile(
"mfsprg3 %0" :
"=r"(m_Sprg3));
48 return static_cast<OFHandle
>(
call(
49 "finddevice", 1, reinterpret_cast<OFParam>(const_cast<char *>(pName))));
54 return static_cast<OFHandle
>(
55 call(
"peer", 1, static_cast<OFHandle>(pDev->m_Handle)));
60 return static_cast<OFHandle
>(
61 call(
"child", 1, static_cast<OFHandle>(pDev->m_Handle)));
65 const char *pService,
int nArgs, OFParam p1, OFParam p2, OFParam p3,
66 OFParam p4, OFParam p5, OFParam p6, OFParam p7, OFParam p8)
75 asm volatile(
"mtsprg0 %0" : :
"r"(
m_Sprg0));
76 asm volatile(
"mtsprg1 %0" : :
"r"(m_Sprg1));
77 asm volatile(
"mtsprg2 %0" : :
"r"(m_Sprg2));
78 asm volatile(
"mtsprg3 %0" : :
"r"(m_Sprg3));
81 pa.service = pService;
97 return reinterpret_cast<OFParam>(-1);
99 return pa.args[pa.nargs];
OFHandle findDevice(const char *pName)
OFParam call(const char *pService, int nArgs, OFParam p1=0, OFParam p2=0, OFParam p3=0, OFParam p4=0, OFParam p5=0, OFParam p6=0, OFParam p7=0, OFParam p8=0)
processor_register_t m_Sprg0
OFHandle getSibling(class OFDevice *pDev)
void initialise(OFInterface interface)
OFHandle getFirstChild(class OFDevice *pDev)
static OpenFirmware m_Instance