add: reading special purpose registers

This commit is contained in:
Michal Simek
2007-05-08 15:57:43 +02:00
parent 1a50f164be
commit e69f66c6eb
3 changed files with 41 additions and 23 deletions

View File

@@ -30,9 +30,9 @@ void _hw_exception_handler (void)
int address = 0;
int state = 0;
/* loading address of exception EAR */
MFSEAR(address);
MFS (address, rear);
/* loading excetpion state register ESR */
MFSESR(state);
MFS (state, resr);
printf ("Hardware exception at 0x%x address\n", address);
switch (state & 0x1f) { /* mask on exception cause */
case 0x1: