5 IMPLEMENTATION [sparc]:
10 //disable power savings mode
11 static Mword wake(Mword);
12 static unsigned cpu_id();
15 /// Unblock external interrupts
16 IMPLEMENT static inline
19 unsigned p = Psr::read();
20 p &= ~(0xF << Psr::Interrupt_lvl);
24 /// Block external interrupts
25 IMPLEMENT static inline
28 unsigned p = Psr::read();
29 p |= (0xF << Psr::Interrupt_lvl);
33 /// Are external interrupts enabled ?
34 IMPLEMENT static inline
35 Proc::Status Proc::interrupts()
37 return Psr::read() & (0xF << Psr::Interrupt_lvl);
40 /// Block external interrupts and save the old state
41 IMPLEMENT static inline
42 Proc::Status Proc::cli_save()
44 Status ret = Psr::read();
49 /// Conditionally unblock external interrupts
50 IMPLEMENT static inline
51 void Proc::sti_restore(Status status)
57 IMPLEMENT static inline
63 IMPLEMENT static inline
67 asm volatile ("ta 0\n");
70 IMPLEMENT static inline
71 Mword Proc::wake(Mword srr1)
77 IMPLEMENT static inline
78 void Proc::irq_chance()
81 asm volatile ("nop; nop;" : : : "memory");
84 IMPLEMENT static inline
85 void Proc::stack_pointer(Mword sp)
88 asm volatile ("mov %0, %%sp\n" : : "r"(sp));
91 IMPLEMENT static inline
92 Mword Proc::stack_pointer()
95 asm volatile ("mov %%sp, %0\n" : "=r" (sp));
99 IMPLEMENT static inline
100 Mword Proc::program_counter()
103 asm volatile ("call 1\n\t"
104 "nop\n\t" // delay instruction
105 "1: mov %%o7, %0\n\t"
106 : "=r" (pc) : : "o7");
112 Mword Proc::read_alternative(Mword reg)
115 asm volatile("lda [%1] %2, %0"
125 void Proc::write_alternative(Mword reg, Mword value)
127 asm volatile ("sta %0, [%1] %2\n\t"
135 IMPLEMENTATION [sparc && !mpcore]:
137 IMPLEMENT static inline
138 unsigned Proc::cpu_id()