2 * ARMv8 system registers
3 * mainly to cope with arm hard-wiring register numbers into instructions.
5 * these routines must be callable from KZERO.
7 * on a multiprocessor, process switching to another cpu is assumed
8 * to be inhibited by the caller as these registers are local to the cpu.
11 #include "../port/lib.h"
19 static ulong ib[256], *ep[MAXMACH+1];
24 for(ip = ib; ip < ie; ip += 2)
30 for(; ip < ie; ip += 2)
33 if(ip >= &ib[nelem(ib)])
34 panic("mkinstr: out of instrucuction buffer");
36 ip[1] = 0xd65f03c0; // RETURN
37 ep[MAXMACH] = ie = ip + 2;
38 cachedwbinvse(ip, 2*sizeof(*ip));
49 uvlong (*fp)(void) = mkinstr(0xd5380000UL | spr);
54 syswr(ulong spr, uvlong val)
56 void (*fp)(uvlong) = mkinstr(0xd5180000UL | spr);