]> git.hungrycats.org Git - linux/commitdiff
PPC32: miscellanous small fixes.
authorPaul Mackerras <paulus@samba.org>
Tue, 6 Aug 2002 06:38:41 +0000 (16:38 +1000)
committerPaul Mackerras <paulus@samba.org>
Tue, 6 Aug 2002 06:38:41 +0000 (16:38 +1000)
Rename print_backtrace to show_stack and improve it, remove the
#if 0 around set_fpexc mode and add get_fpexc_mode, add the
__NR_security define and reserve syscall 225 for Tux.

arch/ppc/kernel/misc.S
arch/ppc/kernel/open_pic.c
arch/ppc/kernel/process.c
include/asm-ppc/processor.h
include/asm-ppc/unistd.h

index 3b8a6da5d4d6d1b661f29e5507d4ef8294c3d113..ef0a88d42e02e4806b54a9637a1cb652b7b362ce 100644 (file)
@@ -1297,6 +1297,8 @@ _GLOBAL(sys_call_table)
        .long sys_sched_setaffinity
        .long sys_sched_getaffinity
        .long sys_security
+       .long sys_ni_syscall    /* 225 - reserved for Tux */
+
        .rept NR_syscalls-(.-sys_call_table)/4
                .long sys_ni_syscall
        .endr
index 5e5ee5cddd63d3e89c3628d1f884327c4a634e24..b45bac280c8258769bb892781b3afff7e4150764 100644 (file)
@@ -149,16 +149,15 @@ struct hw_interrupt_type open_pic_ipi = {
  * data has probably been corrupted and we're going to panic or deadlock later
  * anyway --Troy
  */
-extern unsigned long* _get_SP(void);
 #define check_arg_irq(irq) \
     if (irq < open_pic_irq_offset || irq >= NumSources+open_pic_irq_offset \
        || ISR[irq - open_pic_irq_offset] == 0) { \
       printk("open_pic.c:%d: illegal irq %d\n", __LINE__, irq); \
-      print_backtrace(_get_SP()); }
+      show_stack(NULL); }
 #define check_arg_cpu(cpu) \
     if (cpu < 0 || cpu >= NumProcessors){ \
        printk("open_pic.c:%d: illegal cpu %d\n", __LINE__, cpu); \
-       print_backtrace(_get_SP()); }
+       show_stack(NULL); }
 #else
 #define check_arg_ipi(ipi)     do {} while (0)
 #define check_arg_timer(timer) do {} while (0)
index 08d1dd4fb9d3e04e2c7d62f7071490ec9c7551ec..3887adde6edf5a9842d1ea942d6482fe6780fe1c 100644 (file)
@@ -44,6 +44,7 @@
 #include <asm/processor.h>
 #include <asm/mmu.h>
 #include <asm/prom.h>
+#include <asm/hardirq.h>
 #ifdef CONFIG_PPC_ISERIES
 #include <asm/iSeries/Paca.h>
 #endif
@@ -293,7 +294,7 @@ void show_regs(struct pt_regs * regs)
                        break;
        }
        printk("\n");
-       print_backtrace((unsigned long *)regs->gpr[1]);
+       show_stack((unsigned long *)regs->gpr[1]);
 }
 
 void exit_thread(void)
@@ -418,7 +419,6 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp)
 #endif /* CONFIG_ALTIVEC */
 }
 
-#if 0
 int set_fpexc_mode(struct task_struct *tsk, unsigned int val)
 {
        struct pt_regs *regs = tsk->thread.regs;
@@ -431,7 +431,14 @@ int set_fpexc_mode(struct task_struct *tsk, unsigned int val)
                        | tsk->thread.fpexc_mode;
        return 0;
 }
-#endif
+
+int get_fpexc_mode(struct task_struct *tsk, unsigned long adr)
+{
+       unsigned int val;
+
+       val = __unpack_fe01(tsk->thread.fpexc_mode);
+       return put_user(val, (unsigned int *) adr);
+}
 
 int sys_clone(int p1, int p2, int p3, int p4, int p5, int p6,
              struct pt_regs *regs)
@@ -486,20 +493,25 @@ out:
 }
 
 void
-print_backtrace(unsigned long *sp)
+show_stack(unsigned long *sp)
 {
        int cnt = 0;
        unsigned long i;
 
+       if (sp == NULL)
+               sp = (unsigned long *)_get_SP();
        printk("Call backtrace: ");
-       while (sp) {
-               if (__get_user( i, &sp[1] ))
+       for (;;) {
+               if (__get_user(sp, (unsigned long **)sp))
+                       break;
+               if (sp == NULL)
+                       break;
+               if (__get_user(i, &sp[1]))
                        break;
                if (cnt++ % 7 == 0)
                        printk("\n");
                printk("%08lX ", i);
-               if (cnt > 32) break;
-               if (__get_user(sp, (unsigned long **)sp))
+               if (cnt > 32)
                        break;
        }
        printk("\n");
index 48ec22fbf439268e05572ecaa49801825d847310..a81936a3047350c499509e004353f5173c52fd88 100644 (file)
 #define        SPRN_DSISR      0x012   /* Data Storage Interrupt Status Register */
 #define        SPRN_EAR        0x11A   /* External Address Register */
 #define        SPRN_ESR        0x3D4   /* Exception Syndrome Register */
-#define          ESR_IMCP      0x80000000      /* Instr. Machine Check - Protection */
-#define          ESR_IMCN      0x40000000      /* Instr. Machine Check - Non-config */
-#define          ESR_IMCB      0x20000000      /* Instr. Machine Check - Bus error */
-#define          ESR_IMCT      0x10000000      /* Instr. Machine Check - Timeout */
+#define          ESR_MCI       0x80000000      /* 405 Machine Check - Instruction */
+#define          ESR_IMCP      0x80000000      /* 403 Inst. Mach. Check - Protection */
+#define          ESR_IMCN      0x40000000      /* 403 Inst. Mach. Check - Non-config */
+#define          ESR_IMCB      0x20000000      /* 403 Inst. Mach. Check - Bus error */
+#define          ESR_IMCT      0x10000000      /* 403 Inst. Mach. Check - Timeout */
 #define          ESR_PIL       0x08000000      /* Program Exception - Illegal */
 #define          ESR_PPR       0x04000000      /* Program Exception - Priveleged */
 #define          ESR_PTR       0x02000000      /* Program Exception - Trap */
@@ -747,9 +748,10 @@ unsigned long get_wchan(struct task_struct *p);
 #define KSTK_ESP(tsk)  ((tsk)->thread.regs? (tsk)->thread.regs->gpr[1]: 0)
 
 /* Get/set floating-point exception mode */
-#define GET_FP_EXC_MODE(tsk)           __unpack_fe01((tsk)->thread.fpexc_mode)
-#define SET_FP_EXC_MODE(tsk, val)      set_fpexc_mode((tsk), (val))
+#define GET_FPEXC_CTL(tsk, adr)        get_fpexc_mode((tsk), (adr))
+#define SET_FPEXC_CTL(tsk, val)        set_fpexc_mode((tsk), (val))
 
+extern int get_fpexc_mode(struct task_struct *tsk, unsigned long adr);
 extern int set_fpexc_mode(struct task_struct *tsk, unsigned int val);
 
 static inline unsigned int __unpack_fe01(unsigned int msr_bits)
index 11c043a9f06923dec2936067c7df144926818e94..952e71ff452cd152c9211d0f8003b79130d3c50d 100644 (file)
 #define __NR_futex             221
 #define __NR_sched_setaffinity 222
 #define __NR_sched_getaffinity 223
+#define __NR_security          224
+#define __NR_tuxcall           225
 
 #define __NR(n)        #n