Macroify CP0 registers

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-03-11 13:59:56 +01:00
parent 21eecb8e83
commit edf717f5cb
3 changed files with 20 additions and 9 deletions

View file

@ -130,8 +130,8 @@ __start:
. = start + GRUB_MACHINE_FLASH_TLB_REFILL - GRUB_MACHINE_FLASH_START
tlb_refill:
mfc0 $s1, $14
mfc0 $s2, $8
mfc0 $s1, GRUB_CPU_LOONGSON_COP0_EPC
mfc0 $s2, GRUB_CPU_LOONGSON_COP0_BADVADDR
move $s3, $ra
lui $a0, %hi(epc)
bal message
@ -170,9 +170,9 @@ cache_error:
. = start + GRUB_MACHINE_FLASH_OTHER_EXCEPTION - GRUB_MACHINE_FLASH_START
other_exception:
mfc0 $s0, $13
mfc0 $s1, $14
mfc0 $s2, $8
mfc0 $s0, GRUB_CPU_LOONGSON_COP0_CAUSE
mfc0 $s1, GRUB_CPU_LOONGSON_COP0_EPC
mfc0 $s2, GRUB_CPU_LOONGSON_COP0_BADVADDR
lui $a0, %hi(cause)
bal message
addiu $a0, $a0, %lo(cause)

View file

@ -26,6 +26,7 @@
#include <grub/time.h>
#include <grub/machine/kernel.h>
#include <grub/machine/memory.h>
#include <grub/mips/loongson.h>
#include <grub/cpu/kernel.h>
#include <grub/cs5536.h>
@ -44,7 +45,7 @@ grub_get_rtc (void)
static grub_uint32_t last = 0;
grub_uint32_t low;
asm volatile ("mfc0 %0, $9": "=r" (low));
asm volatile ("mfc0 %0, " GRUB_CPU_LOONGSON_COP0_TIMER_COUNT : "=r" (low));
if (low < last)
high++;
last = low;