4 IMPLEMENTATION [ppc32]:
9 //disable power savings mode
10 static Mword wake(Mword);
11 static unsigned cpu_id();
14 /// Unblock external inetrrupts
15 IMPLEMENT static inline
18 Msr::set_msr_bit(Msr::Msr_ee);
21 /// Block external interrupts
22 IMPLEMENT static inline
25 Msr::clear_msr_bit(Msr::Msr_ee);
28 /// Are external interrupts enabled ?
29 IMPLEMENT static inline
30 Proc::Status Proc::interrupts()
32 return (Status)Msr::read_msr() & Msr::Msr_ee;
35 /// Block external interrupts and save the old state
36 IMPLEMENT static inline
37 Proc::Status Proc::cli_save()
39 Status ret = Msr::read_msr();
44 /// Conditionally unblock external interrupts
45 IMPLEMENT static inline
46 void Proc::sti_restore(Status status)
48 asm volatile ( " mtmsr %[status] \n"
50 : [status] "r" (status)
54 IMPLEMENT static inline
59 IMPLEMENT static inline
62 //enable interrupt and power saving mode in msr and wait for timer
64 Msr::set_msr_bit(Msr::Msr_ee | Msr::Msr_pow);
65 while(Msr::read_msr() & Msr::Msr_pow)
69 IMPLEMENT static inline
70 Mword Proc::wake(Mword srr1)
72 return srr1 & ~(Msr::Msr_ee | Msr::Msr_pow);
75 IMPLEMENT static inline
76 void Proc::irq_chance()
78 asm volatile ("nop; nop;" : : : "memory");
81 IMPLEMENT static inline
82 void Proc::stack_pointer(Mword sp)
84 asm volatile ( " mr %%r1, %0 \n"
89 IMPLEMENT static inline
90 Mword Proc::stack_pointer()
93 asm volatile ( " mr %0, %%r1 \n"
99 IMPLEMENT static inline
100 Mword Proc::program_counter()
103 asm volatile ( " mflr %%r5 \n"
108 : "=r" (pc) : : "r5");
112 IMPLEMENTATION [ppc32 && !mpcore]:
114 IMPLEMENT static inline
115 unsigned Proc::cpu_id()