Пример #1
0
void /* TODO: __attribute__((fastcall)) */ set_cpsr(u32 cpsr, u32 mask) {
	if (!(arm.cpsr_low28 & 0x0F)) {
		/* User mode. Don't change privileged or execution state bits */
		mask &= ~0x010000FF;
	}
	cpsr = (cpsr & mask) | (get_cpsr() & ~mask);
	if (cpsr & 0x20)
		error("Cannot set T bit with MSR instruction");
	set_cpsr_full(cpsr);
}
Пример #2
0
/* From GDB to emu */
static void set_registers(const unsigned long regbuf[NUMREGS]) {
	memcpy(arm.reg, regbuf, sizeof(unsigned long) * 16);
	set_cpsr_full(regbuf[NUMREGS-1]);
}