Commit 7059e71b authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/home/davem/BK/sparc-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents a930f84b a12283c8
...@@ -19,7 +19,7 @@ CONFIG_SYSCTL=y ...@@ -19,7 +19,7 @@ CONFIG_SYSCTL=y
# Loadable module support # Loadable module support
# #
CONFIG_MODULES=y CONFIG_MODULES=y
CONFIG_MODVERSIONS=y # CONFIG_MODVERSIONS is not set
CONFIG_KMOD=y CONFIG_KMOD=y
# #
...@@ -96,12 +96,10 @@ CONFIG_PROM_CONSOLE=y ...@@ -96,12 +96,10 @@ CONFIG_PROM_CONSOLE=y
# #
CONFIG_FB=y CONFIG_FB=y
CONFIG_DUMMY_CONSOLE=y CONFIG_DUMMY_CONSOLE=y
# CONFIG_FB_RIVA is not set
# CONFIG_FB_CLGEN is not set # CONFIG_FB_CLGEN is not set
CONFIG_FB_PM2=y # CONFIG_FB_PM2 is not set
# CONFIG_FB_PM2_FIFO_DISCONNECT is not set
CONFIG_FB_PM2_PCI=y
# CONFIG_FB_CYBER2000 is not set # CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_RIVA is not set
# CONFIG_FB_MATROX is not set # CONFIG_FB_MATROX is not set
CONFIG_FB_ATY=y CONFIG_FB_ATY=y
# CONFIG_FB_ATY_GX is not set # CONFIG_FB_ATY_GX is not set
...@@ -112,6 +110,8 @@ CONFIG_FB_ATY_CT=y ...@@ -112,6 +110,8 @@ CONFIG_FB_ATY_CT=y
# CONFIG_FB_NEOMAGIC is not set # CONFIG_FB_NEOMAGIC is not set
# CONFIG_FB_3DFX is not set # CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set # CONFIG_FB_VOODOO1 is not set
# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_PM3 is not set
CONFIG_FB_SBUS=y CONFIG_FB_SBUS=y
CONFIG_FB_CREATOR=y CONFIG_FB_CREATOR=y
CONFIG_FB_CGSIX=y CONFIG_FB_CGSIX=y
...@@ -215,7 +215,8 @@ CONFIG_DECNET_SIOCGIFCONF=y ...@@ -215,7 +215,8 @@ CONFIG_DECNET_SIOCGIFCONF=y
# CONFIG_BRIDGE is not set # CONFIG_BRIDGE is not set
# CONFIG_X25 is not set # CONFIG_X25 is not set
# CONFIG_LAPB is not set # CONFIG_LAPB is not set
# CONFIG_LLC is not set CONFIG_LLC=m
CONFIG_LLC_UI=y
# CONFIG_NET_DIVERT is not set # CONFIG_NET_DIVERT is not set
# CONFIG_ECONET is not set # CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set # CONFIG_WAN_ROUTER is not set
...@@ -292,7 +293,7 @@ CONFIG_BLK_DEV_IDEDMA=y ...@@ -292,7 +293,7 @@ CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_BLK_DEV_IDE_TCQ_DEFAULT is not set # CONFIG_BLK_DEV_IDE_TCQ_DEFAULT is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_AEC62XX_TUNING is not set # CONFIG_AEC6280_BURST is not set
CONFIG_BLK_DEV_ALI15X3=y CONFIG_BLK_DEV_ALI15X3=y
# CONFIG_WDC_ALI15X3 is not set # CONFIG_WDC_ALI15X3 is not set
# CONFIG_BLK_DEV_AMD74XX is not set # CONFIG_BLK_DEV_AMD74XX is not set
...@@ -315,6 +316,7 @@ CONFIG_BLK_DEV_NS87415=y ...@@ -315,6 +316,7 @@ CONFIG_BLK_DEV_NS87415=y
# CONFIG_BLK_DEV_SL82C105 is not set # CONFIG_BLK_DEV_SL82C105 is not set
# CONFIG_IDE_CHIPSETS is not set # CONFIG_IDE_CHIPSETS is not set
# CONFIG_IDEDMA_IVB is not set # CONFIG_IDEDMA_IVB is not set
CONFIG_ATAPI=y
CONFIG_IDEDMA_AUTO=y CONFIG_IDEDMA_AUTO=y
# CONFIG_BLK_DEV_ATARAID is not set # CONFIG_BLK_DEV_ATARAID is not set
# CONFIG_BLK_DEV_ATARAID_PDC is not set # CONFIG_BLK_DEV_ATARAID_PDC is not set
...@@ -539,7 +541,7 @@ CONFIG_SHAPER=m ...@@ -539,7 +541,7 @@ CONFIG_SHAPER=m
# CONFIG_WAN is not set # CONFIG_WAN is not set
# #
# "Tulip" family network device support # Tulip family network device support
# #
CONFIG_NET_TULIP=y CONFIG_NET_TULIP=y
CONFIG_DE2104X=m CONFIG_DE2104X=m
...@@ -617,7 +619,6 @@ CONFIG_SOUND_GAMEPORT=y ...@@ -617,7 +619,6 @@ CONFIG_SOUND_GAMEPORT=y
# CONFIG_QUOTA is not set # CONFIG_QUOTA is not set
# CONFIG_QFMT_V1 is not set # CONFIG_QFMT_V1 is not set
# CONFIG_QFMT_V2 is not set # CONFIG_QFMT_V2 is not set
# CONFIG_QIFACE_COMPAT is not set
CONFIG_AUTOFS_FS=m CONFIG_AUTOFS_FS=m
CONFIG_AUTOFS4_FS=m CONFIG_AUTOFS4_FS=m
# CONFIG_REISERFS_FS is not set # CONFIG_REISERFS_FS is not set
...@@ -781,14 +782,13 @@ CONFIG_USB_EHCI_HCD=m ...@@ -781,14 +782,13 @@ CONFIG_USB_EHCI_HCD=m
CONFIG_USB_OHCI_HCD=y CONFIG_USB_OHCI_HCD=y
CONFIG_USB_UHCI_HCD=m CONFIG_USB_UHCI_HCD=m
# CONFIG_USB_UHCI_HCD_ALT is not set # CONFIG_USB_UHCI_HCD_ALT is not set
CONFIG_USB_UHCI=y
# CONFIG_USB_UHCI_ALT is not set
# #
# USB Device Class drivers # USB Device Class drivers
# #
# CONFIG_USB_AUDIO is not set # CONFIG_USB_AUDIO is not set
CONFIG_USB_BLUETOOTH_TTY=m CONFIG_USB_BLUETOOTH_TTY=m
# CONFIG_USB_MIDI is not set
CONFIG_USB_ACM=m CONFIG_USB_ACM=m
CONFIG_USB_PRINTER=m CONFIG_USB_PRINTER=m
CONFIG_USB_STORAGE=m CONFIG_USB_STORAGE=m
...@@ -808,6 +808,7 @@ CONFIG_USB_STORAGE_SDDR55=y ...@@ -808,6 +808,7 @@ CONFIG_USB_STORAGE_SDDR55=y
CONFIG_USB_HID=y CONFIG_USB_HID=y
CONFIG_USB_HIDINPUT=y CONFIG_USB_HIDINPUT=y
CONFIG_USB_HIDDEV=y CONFIG_USB_HIDDEV=y
# CONFIG_USB_AIPTEK is not set
CONFIG_USB_WACOM=m CONFIG_USB_WACOM=m
# #
...@@ -821,15 +822,15 @@ CONFIG_USB_HPUSBSCSI=m ...@@ -821,15 +822,15 @@ CONFIG_USB_HPUSBSCSI=m
# #
# USB Multimedia devices # USB Multimedia devices
# #
CONFIG_USB_DABUSB=m # CONFIG_USB_DABUSB is not set
CONFIG_USB_VICAM=m # CONFIG_USB_VICAM is not set
CONFIG_USB_DSBR=m # CONFIG_USB_DSBR is not set
CONFIG_USB_IBMCAM=m # CONFIG_USB_IBMCAM is not set
CONFIG_USB_KONICAWC=m # CONFIG_USB_KONICAWC is not set
CONFIG_USB_OV511=m # CONFIG_USB_OV511 is not set
CONFIG_USB_PWC=m # CONFIG_USB_PWC is not set
CONFIG_USB_SE401=m # CONFIG_USB_SE401 is not set
CONFIG_USB_STV680=m # CONFIG_USB_STV680 is not set
# #
# USB Network adaptors # USB Network adaptors
......
...@@ -1436,10 +1436,11 @@ ret_from_syscall: ...@@ -1436,10 +1436,11 @@ ret_from_syscall:
* %o7 for us. Check performance counter stuff too. * %o7 for us. Check performance counter stuff too.
*/ */
andn %o7, _TIF_NEWCHILD, %l0 andn %o7, _TIF_NEWCHILD, %l0
stx %l0, [%g6 + TI_FLAGS]
#if CONFIG_SMP || CONFIG_PREEMPT #if CONFIG_SMP || CONFIG_PREEMPT
call schedule_tail call schedule_tail
mov %g5, %o0
#endif #endif
stx %l0, [%g6 + TI_FLAGS]
andcc %l0, _TIF_PERFCTR, %g0 andcc %l0, _TIF_PERFCTR, %g0
be,pt %icc, 1f be,pt %icc, 1f
nop nop
......
...@@ -34,20 +34,28 @@ static void power_handler(int irq, void *dev_id, struct pt_regs *regs) ...@@ -34,20 +34,28 @@ static void power_handler(int irq, void *dev_id, struct pt_regs *regs)
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
extern void machine_halt(void); extern void machine_halt(void);
extern void machine_alt_power_off(void);
static void (*poweroff_method)(void) = machine_alt_power_off;
extern int serial_console; extern int serial_console;
void machine_power_off(void) void machine_power_off(void)
{ {
if (!serial_console) {
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
if (power_reg != 0UL && !serial_console) { if (power_reg != 0UL) {
/* Both register bits seem to have the /* Both register bits seem to have the
* same effect, so until I figure out * same effect, so until I figure out
* what the difference is... * what the difference is...
*/ */
writel(POWER_COURTESY_OFF | POWER_SYSTEM_OFF, power_reg); writel(POWER_COURTESY_OFF | POWER_SYSTEM_OFF, power_reg);
} } else
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
if (poweroff_method != NULL) {
poweroff_method();
/* not reached */
}
}
machine_halt(); machine_halt();
} }
...@@ -98,6 +106,7 @@ void __init power_init(void) ...@@ -98,6 +106,7 @@ void __init power_init(void)
found: found:
power_reg = (unsigned long)ioremap(edev->resource[0].start, 0x4); power_reg = (unsigned long)ioremap(edev->resource[0].start, 0x4);
printk("power: Control reg at %016lx ... ", power_reg); printk("power: Control reg at %016lx ... ", power_reg);
poweroff_method = machine_halt; /* able to use the standard halt */
if (edev->irqs[0] != PCI_IRQ_NONE) { if (edev->irqs[0] != PCI_IRQ_NONE) {
if (kernel_thread(powerd, 0, CLONE_FS) < 0) { if (kernel_thread(powerd, 0, CLONE_FS) < 0) {
printk("Failed to start power daemon.\n"); printk("Failed to start power daemon.\n");
......
...@@ -142,6 +142,21 @@ void machine_halt(void) ...@@ -142,6 +142,21 @@ void machine_halt(void)
panic("Halt failed!"); panic("Halt failed!");
} }
void machine_alt_power_off(void)
{
sti();
mdelay(8);
cli();
#ifdef CONFIG_SUN_CONSOLE
if (!serial_console && prom_palette)
prom_palette(1);
#endif
if (prom_keyboard)
prom_keyboard();
prom_halt_power_off();
panic("Power-off failed!");
}
void machine_restart(char * cmd) void machine_restart(char * cmd)
{ {
char *p; char *p;
......
...@@ -97,6 +97,19 @@ prom_halt(void) ...@@ -97,6 +97,19 @@ prom_halt(void)
goto again; /* PROM is out to get me -DaveM */ goto again; /* PROM is out to get me -DaveM */
} }
void
prom_halt_power_off(void)
{
#ifdef CONFIG_SMP
smp_promstop_others();
udelay(8000);
#endif
p1275_cmd ("SUNW,power-off", P1275_INOUT(0,0));
/* if nothing else helps, we just halt */
prom_halt ();
}
/* Set prom sync handler to call function 'funcp'. */ /* Set prom sync handler to call function 'funcp'. */
void void
prom_setcallback(callback_func_t funcp) prom_setcallback(callback_func_t funcp)
......
...@@ -113,6 +113,9 @@ extern void prom_cmdline(void); ...@@ -113,6 +113,9 @@ extern void prom_cmdline(void);
*/ */
extern void prom_halt(void) __attribute__ ((noreturn)); extern void prom_halt(void) __attribute__ ((noreturn));
/* Halt and power-off the machine. */
extern void prom_halt_power_off(void) __attribute__ ((noreturn));
/* Set the PROM 'sync' callback function to the passed function pointer. /* Set the PROM 'sync' callback function to the passed function pointer.
* When the user gives the 'sync' command at the prom prompt while the * When the user gives the 'sync' command at the prom prompt while the
* kernel is still active, the prom will call this routine. * kernel is still active, the prom will call this routine.
......
...@@ -143,7 +143,14 @@ extern void __flushw_user(void); ...@@ -143,7 +143,14 @@ extern void __flushw_user(void);
#define flush_user_windows flushw_user #define flush_user_windows flushw_user
#define flush_register_windows flushw_all #define flush_register_windows flushw_all
#define prepare_to_switch flushw_all
#define prepare_arch_schedule(prev) task_lock(prev)
#define finish_arch_schedule(prev) task_unlock(prev)
#define prepare_arch_switch(rq) \
do { spin_unlock(&(rq)->lock); \
flushw_all(); \
} while (0)
#define finish_arch_switch(rq) __sti()
#ifndef CONFIG_DEBUG_SPINLOCK #ifndef CONFIG_DEBUG_SPINLOCK
#define CHECK_LOCKS(PREV) do { } while(0) #define CHECK_LOCKS(PREV) do { } while(0)
...@@ -172,61 +179,61 @@ if ((PREV)->thread.smp_lock_count) { \ ...@@ -172,61 +179,61 @@ if ((PREV)->thread.smp_lock_count) { \
* not preserve it's value. Hairy, but it lets us remove 2 loads * not preserve it's value. Hairy, but it lets us remove 2 loads
* and 2 stores in this critical code path. -DaveM * and 2 stores in this critical code path. -DaveM
*/ */
#define switch_to(prev, next) \ #define switch_to(prev, next, last) \
do { CHECK_LOCKS(prev); \ do { CHECK_LOCKS(prev); \
if (test_thread_flag(TIF_PERFCTR)) { \ if (test_thread_flag(TIF_PERFCTR)) { \
unsigned long __tmp; \ unsigned long __tmp; \
read_pcr(__tmp); \ read_pcr(__tmp); \
current_thread_info()->pcr_reg = __tmp; \ current_thread_info()->pcr_reg = __tmp; \
read_pic(__tmp); \ read_pic(__tmp); \
current_thread_info()->kernel_cntd0 += (unsigned int)(__tmp); \ current_thread_info()->kernel_cntd0 += (unsigned int)(__tmp);\
current_thread_info()->kernel_cntd1 += ((__tmp) >> 32); \ current_thread_info()->kernel_cntd1 += ((__tmp) >> 32); \
} \ } \
save_and_clear_fpu(); \ save_and_clear_fpu(); \
/* If you are tempted to conditionalize the following */ \ /* If you are tempted to conditionalize the following */ \
/* so that ASI is only written if it changes, think again. */ \ /* so that ASI is only written if it changes, think again. */ \
__asm__ __volatile__("wr %%g0, %0, %%asi" \ __asm__ __volatile__("wr %%g0, %0, %%asi" \
: : "r" (__thread_flag_byte_ptr(next->thread_info)[TI_FLAG_BYTE_CURRENT_DS])); \ : : "r" (__thread_flag_byte_ptr(next->thread_info)[TI_FLAG_BYTE_CURRENT_DS]));\
__asm__ __volatile__( \ __asm__ __volatile__( \
"mov %%g6, %%g5\n\t" \ "mov %%g4, %%g5\n\t" \
"wrpr %%g0, 0x95, %%pstate\n\t" \ "wrpr %%g0, 0x95, %%pstate\n\t" \
"stx %%i6, [%%sp + 2047 + 0x70]\n\t" \ "stx %%i6, [%%sp + 2047 + 0x70]\n\t" \
"stx %%i7, [%%sp + 2047 + 0x78]\n\t" \ "stx %%i7, [%%sp + 2047 + 0x78]\n\t" \
"rdpr %%wstate, %%o5\n\t" \ "rdpr %%wstate, %%o5\n\t" \
"stx %%o6, [%%g6 + %2]\n\t" \ "stx %%o6, [%%g6 + %3]\n\t" \
"stb %%o5, [%%g6 + %1]\n\t" \ "stb %%o5, [%%g6 + %2]\n\t" \
"rdpr %%cwp, %%o5\n\t" \ "rdpr %%cwp, %%o5\n\t" \
"stb %%o5, [%%g6 + %4]\n\t" \ "stb %%o5, [%%g6 + %5]\n\t" \
"mov %0, %%g6\n\t" \ "mov %1, %%g6\n\t" \
"ldub [%0 + %4], %%g1\n\t" \ "ldub [%1 + %5], %%g1\n\t" \
"wrpr %%g1, %%cwp\n\t" \ "wrpr %%g1, %%cwp\n\t" \
"ldx [%%g6 + %2], %%o6\n\t" \ "ldx [%%g6 + %3], %%o6\n\t" \
"ldub [%%g6 + %1], %%o5\n\t" \ "ldub [%%g6 + %2], %%o5\n\t" \
"ldx [%%g6 + %3], %%o7\n\t" \ "ldx [%%g6 + %4], %%o7\n\t" \
"mov %%g6, %%l2\n\t" \ "mov %%g6, %%l2\n\t" \
"wrpr %%o5, 0x0, %%wstate\n\t" \ "wrpr %%o5, 0x0, %%wstate\n\t" \
"ldx [%%sp + 2047 + 0x70], %%i6\n\t" \ "ldx [%%sp + 2047 + 0x70], %%i6\n\t" \
"ldx [%%sp + 2047 + 0x78], %%i7\n\t" \ "ldx [%%sp + 2047 + 0x78], %%i7\n\t" \
"wrpr %%g0, 0x94, %%pstate\n\t" \ "wrpr %%g0, 0x94, %%pstate\n\t" \
"mov %%l2, %%g6\n\t" \ "mov %%l2, %%g6\n\t" \
"ldx [%%g6 + %6], %%g4\n\t" \ "ldx [%%g6 + %7], %%g4\n\t" \
"wrpr %%g0, 0x96, %%pstate\n\t" \ "wrpr %%g0, 0x96, %%pstate\n\t" \
"andcc %%o7, %5, %%g0\n\t" \ "andcc %%o7, %6, %%g0\n\t" \
"bne,pn %%icc, ret_from_syscall\n\t" \ "bne,pn %%icc, ret_from_syscall\n\t" \
" nop\n\t" \ " mov %%g5, %0\n\t" \
: /* no outputs */ \ : "=&r" (last) \
: "r" (next->thread_info), \ : "0" (next->thread_info), \
"i" (TI_WSTATE), "i" (TI_KSP), "i" (TI_FLAGS), "i" (TI_CWP), \ "i" (TI_WSTATE), "i" (TI_KSP), "i" (TI_FLAGS), "i" (TI_CWP), \
"i" (_TIF_NEWCHILD), "i" (TI_TASK) \ "i" (_TIF_NEWCHILD), "i" (TI_TASK) \
: "cc", "g1", "g2", "g3", "g5", "g7", \ : "cc", "g1", "g2", "g3", "g5", "g7", \
"l2", "l3", "l4", "l5", "l6", "l7", \ "l2", "l3", "l4", "l5", "l6", "l7", \
"i0", "i1", "i2", "i3", "i4", "i5", \ "i0", "i1", "i2", "i3", "i4", "i5", \
"o0", "o1", "o2", "o3", "o4", "o5", "o7"); \ "o0", "o1", "o2", "o3", "o4", "o5", "o7"); \
/* If you fuck with this, update ret_from_syscall code too. */ \ /* If you fuck with this, update ret_from_syscall code too. */ \
if (test_thread_flag(TIF_PERFCTR)) { \ if (test_thread_flag(TIF_PERFCTR)) { \
write_pcr(current_thread_info()->pcr_reg); \ write_pcr(current_thread_info()->pcr_reg); \
reset_pic(); \ reset_pic(); \
} \ } \
} while(0) } while(0)
extern __inline__ unsigned long xchg32(__volatile__ unsigned int *m, unsigned int val) extern __inline__ unsigned long xchg32(__volatile__ unsigned int *m, unsigned int val)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment