Index: arch/alpha/config.in =================================================================== RCS file: /home/rth/CVSROOT/linux/arch/alpha/config.in,v retrieving revision 1.11 diff -u -p -r1.11 config.in --- arch/alpha/config.in 1998/10/02 07:21:49 1.11 +++ arch/alpha/config.in 1998/11/12 02:41:17 @@ -289,4 +289,11 @@ else fi bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ + +if [ "$CONFIG_SERIAL_CONSOLE" = "y" ]; then + bool 'Enable serial console early (ttyS0 only)' CONFIG_EARLY_SERIAL_CONSOLE +fi + +bool 'In-kernel strace' CONFIG_KERNEL_STRACE + endmenu Index: arch/alpha/kernel/entry.S =================================================================== RCS file: /home/rth/CVSROOT/linux/arch/alpha/kernel/entry.S,v retrieving revision 1.8 diff -u -p -r1.8 entry.S --- arch/alpha/kernel/entry.S 1998/10/31 07:54:45 1.8 +++ arch/alpha/kernel/entry.S 1998/11/12 04:15:54 @@ -4,6 +4,7 @@ * kernel entry-points */ +#include #include #define halt .long PAL_halt @@ -539,7 +540,11 @@ entSys: s8addq $0,$5,$5 and $3,PF_PTRACED,$3 stq $18,SP_OFF+40($30) +#ifdef CONFIG_KERNEL_STRACE + br strace +#else bne $3,strace +#endif beq $4,1f ldq $27,0($5) 1: jsr $26,($27),alpha_ni_syscall @@ -577,7 +582,9 @@ restore_all: .align 3 strace: /* set up signal stack, call syscall_trace */ + mov $30,$16 bsr $1,do_switch_stack + mov 0,$17 jsr $26,syscall_trace bsr $1,undo_switch_stack @@ -607,7 +614,9 @@ strace: strace_success: stq $0,0($30) /* save return value */ + mov $30,$16 bsr $1,do_switch_stack + mov 1,$17 jsr $26,syscall_trace bsr $1,undo_switch_stack br $31,ret_from_sys_call @@ -623,9 +632,11 @@ strace_error: stq $0,0($30) stq $1,72($30) /* a3 for return */ + mov $30,$16 bsr $1,do_switch_stack bis $19,$19,$9 /* save old syscall number */ bis $20,$20,$10 /* save old a3 */ + mov 1,$17 jsr $26,syscall_trace bis $9,$9,$19 bis $10,$10,$20 Index: arch/alpha/kernel/ptrace.c =================================================================== RCS file: /home/rth/CVSROOT/linux/arch/alpha/kernel/ptrace.c,v retrieving revision 1.7 diff -u -p -r1.7 ptrace.c --- arch/alpha/kernel/ptrace.c 1998/10/12 01:15:24 1.7 +++ arch/alpha/kernel/ptrace.c 1998/11/12 04:30:32 @@ -4,6 +4,7 @@ /* mangled further by Bob Manson (manson@santafe.edu) */ /* more mutilation by David Mosberger (davidm@azstarnet.com) */ +#include #include #include #include @@ -637,8 +638,20 @@ sys_ptrace(long request, long pid, long } asmlinkage void -syscall_trace(void) +syscall_trace(struct pt_regs *regs, int returning_p) { +#ifdef CONFIG_KERNEL_STRACE + if (!returning_p) + printk(KERN_INFO "TRACE: %s (%d): entering syscall " + "%ld (%#lx,%#lx,%#lx,%#lx,%#lx)\n", + current->comm, current->pid, regs->r0, regs->r16, + regs->r17, regs->r18, regs->r19, regs->r20); + else + printk(KERN_INFO "TRACE: %s (%d): leaving syscall -> %s %ld\n", + current->comm, current->pid, + (regs->r20 ? "error" : "ok"), regs->r0); +#endif + if ((current->flags & (PF_PTRACED|PF_TRACESYS)) != (PF_PTRACED|PF_TRACESYS)) return; Index: arch/alpha/kernel/setup.c =================================================================== RCS file: /home/rth/CVSROOT/linux/arch/alpha/kernel/setup.c,v retrieving revision 1.19 diff -u -p -r1.19 setup.c --- arch/alpha/kernel/setup.c 1998/10/16 05:37:37 1.19 +++ arch/alpha/kernel/setup.c 1998/11/22 21:38:22 @@ -258,6 +259,24 @@ setup_arch(char **cmdline_p, unsigned lo * Give us a default console. TGA users will see nothing until * chr_dev_init is called, rather late in the boot sequence. */ + +#ifdef CONFIG_EARLY_SERIAL_CONSOLE + { + extern int preferred_console; + + /* + * Uses only the defaults found in drivers/char/serial.c at the + * moment. We'd have to something fairly ugly with console_cmdline + * to get something else to happen before normal command-line + * processing is done. + * + * Since the default is a quite sensible ttyS0,9600,8,N,1 this + * doesn't seem worth persuing. + */ + *memory_start_p = serial_console_init(*memory_start_p, *memory_end_p); + preferred_console = -1; + } +#endif #ifdef CONFIG_VT #if defined(CONFIG_VGA_CONSOLE) Index: kernel/printk.c =================================================================== RCS file: /home/rth/CVSROOT/linux/kernel/printk.c,v retrieving revision 1.4 diff -u -p -r1.4 printk.c --- kernel/printk.c 1998/09/20 03:08:00 1.4 +++ kernel/printk.c 1998/11/12 04:03:57 @@ -53,7 +53,7 @@ static char log_buf[LOG_BUF_LEN]; static unsigned long log_start = 0; static unsigned long logged_chars = 0; struct console_cmdline console_cmdline[MAX_CMDLINECONSOLES]; -static int preferred_console = -1; +int preferred_console = -1; /* * Setup a list of consoles. Called from init/main.c @@ -331,6 +331,10 @@ void register_console(struct console * c char buf[16]; signed char msg_level = -1; char *q; + + /* Handle attempts to register a console multiple times. */ + if (console->flags & CON_ENABLED) + return; /* * See if we want to use this console driver. If we