Altera_Forum
Honored Contributor
20 years agocontrol registers
Ok, so since I need multi-threading to work, and since adding a compare-and-exchange instruction is out of the question since interfacing with SDRAM is too difficult from a custom instruction, the obvious way to do mutexing and other multi-threaded operations is by disabling interrupts every time any of the mutexing (etc) operations take place. Simple enough in the kernel (that's how all of the atomic operations are already implemented).
But is it possible to disable interrupts in userspace? Specifically, does microtronix uClinux put the CPU into "user mode" (i.e. the mode where code can't access the control registers) for userspace code, or can userspace code get at the control registers (in order to set ctrl0[0] (PIE) to 0 and then to 1 again)? Thanks.