PERFORCE change 158436 for review
Ulf Lilleengen
lulf at FreeBSD.org
Sat Feb 28 00:05:25 PST 2009
http://perforce.freebsd.org/chv.cgi?CH=158436
Change 158436 by lulf at lulf_carrot on 2009/02/28 08:04:57
- Add a ap7000 specific header with implementation-defined settings.
- First try at implementing cpu_idle, setting the cpu to IDLE mode for
ap7000.
Affected files ...
.. //depot/projects/avr32/src/sys/avr32/avr32/cpu.c#8 edit
.. //depot/projects/avr32/src/sys/avr32/include/at32ap7000.h#1 add
Differences ...
==== //depot/projects/avr32/src/sys/avr32/avr32/cpu.c#8 (text+ko) ====
@@ -63,6 +63,7 @@
#include <machine/reg_intc.h>
#include <machine/reg_usart.h>
#include <machine/at32ap700x.h>
+#include <machine/at32ap7000.h>
extern vm_offset_t _evba;
@@ -89,7 +90,17 @@
void
cpu_idle(int busy)
{
+ uint32_t gm;
+
+ gm = bit_offset(SYS, SR, GM);
+ /* Make sure interrupts are enabled before we do this. */
+ if (gm == 1 || (sysreg_read(SR) & INTR_MASK) == gm)
+ panic("sleeping with interrupts disabled");
+#if defined(CPU_AT32AP7000)
+ __asm__ __volatile ("sleep %0" : : "i"(AT32AP7000_SLEEP_IDLE));
+#else
avr32_impl();
+#endif
}
void
More information about the p4-projects
mailing list