Permalink
Browse files

[mahatma] Fix comments, remove obsolete code

Signed-off-by: Christopher Hall <hsw@openmoko.com>
  • Loading branch information...
1 parent cab125a commit b3cded878e5c9733363a0d08e16732a5ed8f2f2d @hxw hxw committed Apr 7, 2010
Showing with 5 additions and 26 deletions.
  1. +2 −2 samo-lib/mahatma/mahatma.c
  2. +3 −24 samo-lib/mahatma/traps.c
@@ -61,7 +61,7 @@ int main(void)
);
// critical first initialisation
- Suspend_initialise(); // sets up clocks so must be first
+ Suspend_initialise(); // set up clocks so must be first
traps_init(); // set up vectors so must be second
// other high priority initialisation
@@ -71,7 +71,7 @@ int main(void)
msg_init();
// start of normal initialisation
- // eanything below here can use debug outputs
+ // anything below here can use debug outputs
msg(MSG_INFO, "Starting\n");
// initialise remainder of I/O
View
@@ -279,32 +279,11 @@ irq_callback trap_table[N_TRAPS] = {
undef_irq_handler, // 107 *reserved*
};
+
+// relocate the trap table
void traps_init(void)
{
(void)Interrupt_disable();
-
- /* relocate the trap table */
- asm("ld.w %%ttbr, %0" :: "r"(0x84000));
+ asm volatile ("ld.w %%ttbr, %0" :: "r"(0x84000));
Interrupt_enable(true);
- void traps_check(void);
- print("traps_init\n");
- traps_check();
-}
-
-void traps_check(void)
-{
- register uint32_t *tt, nh;
- asm volatile (
- "xld.w %0, trap_table\n"
- "xld.w %1, nmi_handler\n"
- : "=r"(tt), "=r"(nh)
- :
- );
- if (tt[7] != nh) {
- print("trap_table is corrupt\n");
- print_u32(tt[7]);
- print(" should be ");
- print_u32(nh);
- print("\n");
- }
}

0 comments on commit b3cded8

Please sign in to comment.