Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv5736/arch/vax/kernel Modified Files: cpu_generic.c cpu_ka55.c cpu_ka650.c entry.S interrupt.c process.c regdump.c signal.c syscall.c Log Message: DA: update for new toolchain build... add percentage signs to all assembly routines Index: cpu_generic.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/cpu_generic.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- cpu_generic.c 1 Feb 2003 05:19:12 -0000 1.3 +++ cpu_generic.c 12 Feb 2003 02:37:32 -0000 1.4 @@ -75,7 +75,7 @@ void ka46_48_49_prom_putchar(int c) { - asm ("movzbl %0, r2 # zero-extended byte convert. \n" + asm ("movzbl %0, %%r2 # zero-extended byte convert. \n" "jsb 0x20040068\n" : /* nothing */ : "g" (c) @@ -92,7 +92,7 @@ void ka4x_prom_putchar(int c) { - asm (" movzbl %0, r2 # zero-extended byte convert.\n" + asm (" movzbl %0, %%r2 # zero-extended byte convert.\n" "jsb 0x20040058 \n" : /* nothing */ : "g" (c) Index: cpu_ka55.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/cpu_ka55.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- cpu_ka55.c 1 Feb 2003 05:19:12 -0000 1.9 +++ cpu_ka55.c 12 Feb 2003 02:37:32 -0000 1.10 @@ -65,12 +65,12 @@ void ka55_prom_putchar(int c) { - asm (" movl $0x2014044b, r11 # console page addr\n" + asm (" movl $0x2014044b, %%r11 # console page addr\n" "1:\n" - "jsb *0x20(r11) # ready to TX? \n" - "blbc r0, 1b\n" - "movl %0, r1\n" - "jsb *0x24(r11) # TX char in R11 \n" + "jsb *0x20(%%r11) # ready to TX? \n" + "blbc %%r0, 1b\n" + "movl %0, %%r1\n" + "jsb *0x24(%%r11) # TX char in R11 \n" : /* no outputs */ : "g"(c) : "r0", "r1", "r11" ); Index: cpu_ka650.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/cpu_ka650.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- cpu_ka650.c 26 Oct 2002 10:50:05 -0000 1.5 +++ cpu_ka650.c 12 Feb 2003 02:37:33 -0000 1.6 @@ -47,7 +47,8 @@ ka650_cpu_type_str, generic_clock_init, - NULL + NULL, + MV_CPU_KA650 }, 0 /* System ID Extension from ROM */ }; Index: entry.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/entry.S,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- entry.S 14 Sep 2001 11:41:41 -0000 1.8 +++ entry.S 12 Feb 2003 02:37:33 -0000 1.9 @@ -48,26 +48,26 @@ of longwords of this exception info is available in the irqvector structure (at our "return address") */ - pushl r0 /* Need to use R0 as a working register */ + pushl %r0 /* Need to use R0 as a working register */ /* Get number of exception info longwords into R0. Remember that this value is stored immediately after the JSB instruction in the irqvector, so the "return address" points to it */ - movl *4(sp), r0 + movl *4(%sp), %r0 - addl2 $3, r0 /* R0 now contains number of longwords between + addl2 $3, %r0 /* R0 now contains number of longwords between top of stack and saved PSL */ - pushl (sp)[r0] /* Push saved PSL again */ - pushl (sp)[r0] /* Push saved PC again */ - extzv $22, $2, 4(sp), -(sp) /* Extract PREVMODE field from saved + pushl (%sp)[%r0] /* Push saved PSL again */ + pushl (%sp)[%r0] /* Push saved PC again */ + extzv $22, $2, 4(%sp), -(%sp) /* Extract PREVMODE field from saved PSL and save on stack (because we don't have any spare registers yet) */ - cmpzv $24, $2, 8(sp), (sp) /* Is PREVMODE == CURMODE? */ + cmpzv $24, $2, 8(%sp), (%sp) /* Is PREVMODE == CURMODE? */ beql same_mode - mfpr (sp),(sp) /* HACK ALERT! The processor modes are 0..3 + mfpr (%sp),(%sp) /* HACK ALERT! The processor modes are 0..3 for kernel..user mode. The stack pointer internal processor registers are also 0..3 for kernel..user mode. So, using the @@ -78,12 +78,12 @@ processor mode before the exception occurred */ brb sp_saved same_mode: - moval 16(sp)[r0],(sp) /* Exception is not changing modes. Therefore + moval 16(%sp)[%r0],(%sp) /* Exception is not changing modes. Therefore we calculate how far up the stack the SP was pointing when the exception occurred. */ sp_saved: pushr $0x3ffe /* Push FP to R1 */ - pushl 64(sp) /* Duplicate saved R0 */ + pushl 64(%sp) /* Duplicate saved R0 */ /* The stack now looks like: @@ -105,9 +105,9 @@ when you modify this code, we're counting stack locations to get the right offsets here... */ - pushal 76(sp) /* address of exception info */ - pushl 76(sp) /* handler_PC */ - pushal 8(sp) /* start of pt_regs */ + pushal 76(%sp) /* address of exception info */ + pushl 76(%sp) /* handler_PC */ + pushal 8(%sp) /* start of pt_regs */ calls $3, do_irq_excep @@ -125,7 +125,7 @@ 68 as you'd expect from the stack layout shown above. This is because the SP is incremented by 4 while evaluating the first operand */ - movl (sp)+, 64(sp) + movl (%sp)+, 64(%sp) /* Restore registers R1 up to FP */ popr $0x3ffe @@ -147,19 +147,19 @@ handlers to change the PC of the code that triggered the exception. This is tricky because of the exception info that may be present on the stack. First get the size of the exception info into R0 */ - movl *16(sp), r0 + movl *16(%sp), %r0 /* Now move the saved PC down over the original (the 20-byte offset takes care of skipping over the top 5 items on the stack, and then the R0 index skips over the exception info */ - movl 4(sp), 20(sp)[r0] + movl 4(%sp), 20(%sp)[%r0] /* * D.A. May 2001 - we need to copy the PSL down, to * get to usermode originally as we make up a new PSL * in start_thread and we need the CPU to believe it */ - movl 8(sp), 24(sp)[r0] + movl 8(%sp), 24(%sp)[%r0] /* The stack now looks like: SP: saved SP for previous mode @@ -175,11 +175,11 @@ /* Now move the saved R0 (r0+1) longwords down the stack, leaving it just before the saved PC, overwriting either the saved handler_PC or the end of the exception info ... */ - movl 12(sp), 16(sp)[r0] + movl 12(%sp), 16(%sp)[%r0] /* ... and clear stack down to this point */ - moval 16(sp)[r0], sp + moval 16(%sp)[%r0], %sp /* Stack now looks like @@ -189,7 +189,7 @@ /* Restore R0 and dismiss exception */ - movl (sp)+, r0 + movl (%sp)+, %r0 rei /* irqvec_stray is the generic handler for all exceptions and interrupts @@ -208,7 +208,7 @@ saved PSL */ pushr $0x3fff /* Save FP to R0 */ - pushl 56(sp) /* copy return address (handler_PC) */ + pushl 56(%sp) /* copy return address (handler_PC) */ calls $1, unhandled_exception /* If unhandled_exception() returns, then we must be @@ -218,7 +218,7 @@ continue */ popr $0x3fff /* restore R0 to FP */ - moval 4(sp), sp /* Remove handler_PC */ + moval 4(%sp), %sp /* Remove handler_PC */ rei /* mcheck_handler is the handler for machine check exceptions. @@ -242,10 +242,10 @@ * PSL */ pushr $0x3f /* push all registers in case we can restart */ - pushab 24(sp) /* address of stack slot which holds byte count */ + pushab 24(%sp) /* address of stack slot which holds byte count */ calls $1, machine_check /* in reboot.c */ popr $0x3f /* spring them off */ - addl2 (sp)+,sp /* get rid of the machine check frame */ + addl2 (%sp)+,%sp /* get rid of the machine check frame */ rei /* dismiss */ Index: interrupt.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/interrupt.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- interrupt.c 9 Apr 2002 13:50:55 -0000 1.24 +++ interrupt.c 12 Feb 2003 02:37:33 -0000 1.25 @@ -250,15 +250,20 @@ printk("\nReserved instruction at PC=%08lx\n", regs->pc); } - printk("\nStack dump\n"); - hex_dump((void *)(regs->sp), 256); show_regs(regs); show_cpu_regs(); + printk("\nStack dump\n"); + + + if (user_mode(regs)) { + unsigned int usp = __mfpr(PR_USP); + hex_dump((void *)usp, 256); force_sig(SIGILL,current); return; } + hex_dump((void *)(regs->sp), 512); machine_halt(); } @@ -332,15 +337,19 @@ printk("\nReserved addressing mode fault at PC=%08lx\n", regs->pc); } - printk("\nStack dump\n"); - hex_dump((void *)(regs->sp), 256); show_regs(regs); show_cpu_regs(); + printk("\nStack dump\n"); + + if (user_mode(regs)) { + unsigned int usp = __mfpr(PR_USP); + hex_dump((void *)usp, 256); force_sig(SIGILL,current); return; } + hex_dump((void *)(regs->sp), 256); machine_halt(); } Index: process.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/process.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- process.c 1 Feb 2003 05:19:12 -0000 1.17 +++ process.c 12 Feb 2003 02:37:33 -0000 1.18 @@ -61,8 +61,8 @@ /* svpctx should deal with writing the stuff into *prev */ - asm(" movl %1, r11 \n" - " movpsl -(sp) \n" + asm(" movl %1, %%r11 \n" + " movpsl -(%%sp) \n" " pushab 1f \n" " mtpr %4,%5 \n" " svpctx \n" @@ -70,7 +70,7 @@ " ldpctx \n" " rei \n" "1: \n" - " movl r11, %0" + " movl %%r11, %0" : "=g"(retval) : "g"(prev), "r"(pcbb), "g"(PR_PCBB), @@ -171,12 +171,12 @@ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) { - asm(" clrl -(sp) \n" - " movl %0, -(sp) \n" + asm(" clrl -(%%sp) \n" + " movl %0, -(%%sp) \n" " pushl $0x2 \n" - " movl sp, ap \n" + " movl %%sp, %%ap \n" " chmk %1 \n" - " tstl r0 \n" + " tstl %%r0 \n" " beql child \n" " ret \n" "child:" @@ -261,7 +261,8 @@ printk("starting thread %8lX %8lX %8lX\n", new_pc, new_sp, regs->sp); #endif set_fs(USER_DS); - regs->pc = new_pc; + /* attempt to jump over the crap at the start of the pc */ + regs->pc = new_pc+2; regs->sp = new_sp; regs->ap = new_sp; regs->psl.prevmode = PSL_MODE_USER; Index: regdump.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/regdump.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- regdump.c 9 Apr 2002 13:50:55 -0000 1.6 +++ regdump.c 12 Feb 2003 02:37:33 -0000 1.7 @@ -151,8 +151,8 @@ /* Why doesn't asm("fp") on the declaration work as advertised? */ - asm("movl fp, %0" : "=g"(fp) : ); - asm("movl ap, %0" : "=g"(ap) : ); + asm("movl %%fp, %0" : "=g"(fp) : ); + asm("movl %%ap, %0" : "=g"(ap) : ); /* First frame we look at is our own */ target_fp = fp; @@ -198,17 +198,17 @@ unsigned int raw_psl; /* Grab the current registers */ - asm ("movq r0, %0" : "=g"(regs.r0) : ); - asm ("movq r2, %0" : "=g"(regs.r2) : ); - asm ("movq r4, %0" : "=g"(regs.r4) : ); - asm ("movq r6, %0" : "=g"(regs.r6) : ); - asm ("movq r8, %0" : "=g"(regs.r8) : ); - asm ("movq r10, %0" : "=g"(regs.r10) : ); - asm ("movq ap, %0" : "=g"(regs.ap) : ); - asm ("movq sp, %0" : "=g"(regs.sp) : ); + asm ("movq %%r0, %0" : "=g"(regs.r0) : ); + asm ("movq %%r2, %0" : "=g"(regs.r2) : ); + asm ("movq %%r4, %0" : "=g"(regs.r4) : ); + asm ("movq %%r6, %0" : "=g"(regs.r6) : ); + asm ("movq %%r8, %0" : "=g"(regs.r8) : ); + asm ("movq %%r10, %0" : "=g"(regs.r10) : ); + asm ("movq %%ap, %0" : "=g"(regs.ap) : ); + asm ("movq %%sp, %0" : "=g"(regs.sp) : ); asm ("movpsl %0" : "=g"(regs.psl) : ); - asm("movl fp, %0" : "=g"(fp) : ); + asm("movl %%fp, %0" : "=g"(fp) : ); /* We always pull saved registers from our own stack frame */ Index: signal.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/signal.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- signal.c 23 Nov 2001 21:26:39 -0000 1.9 +++ signal.c 12 Feb 2003 02:37:33 -0000 1.10 @@ -152,7 +152,7 @@ __get_user(mask, &act->sa_mask); siginitset(&new_ka.sa.sa_mask, mask); } - + ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); if (!ret && oact) { Index: syscall.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/syscall.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- syscall.c 1 Feb 2003 05:19:12 -0000 1.10 +++ syscall.c 12 Feb 2003 02:37:33 -0000 1.11 @@ -100,12 +100,12 @@ /* atp aug 2001, FIXME: ptrace/strace syscall stuff */ __asm__(" pushl %1 \n" - " subl2 %2,sp \n" - " 1: movc3 %2,4(%4),(sp) \n" + " subl2 %2,%%sp \n" + " 1: movc3 %2,4(%4),(%%sp) \n" " calls %3, %5 \n" " brb 3f \n" - " 2: movl %6, r0 \n" - " 3: movl r0, %0 \n" + " 2: movl %6, %%r0 \n" + " 3: movl %%r0, %0 \n" " .section ex_table,\"a\" \n" " .align 2 \n" " .long 1b, 2b \n" |