/*
* arm co-processors
* CP15 (system control) is the one that gets used the most in practice.
*/
#include "u.h"
#include "../port/lib.h"
#include "mem.h"
#include "dat.h"
#include "fns.h"
#include "io.h"
enum {
/* alternates: 0xe12fff1e BX (R14); last e is R14 */
/* 0xe28ef000 B 0(R14); second e is R14 (ken) */
Retinst = 0xe1a0f00e, /* MOV R14, R15 */
};
void
cpwr(int cp, int op1, int crn, int crm, int op2, ulong val)
{
volatile ulong instr[2];
void *pcaddr;
void (*fp)(ulong);
fpreg &= 017;
/*
* VMRS. return value will be in R0, which is convenient.
* Rt will be R0.
*/
instr[0] = 0xeef00a10 | fpreg << 16 | 0 << 12;
instr[1] = Retinst;
coherence();