From 7a8e9bed17d7924a9c5c4699b1f6a3a0359524ed Mon Sep 17 00:00:00 2001 From: wdenk Date: Sat, 31 May 2003 18:35:21 +0000 Subject: * Patch by Marc Singer, 29 May 2003: Fixed rarp boot method for IA32 and other little-endian CPUs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Patch by Marc Singer, 28 May 2003: Added port I/O commands. * Patch by Matthew McClintock, 28 May 2003 - cpu/mpc824x/start.S: fix relocation code when booting from RAM - minor patches for utx8245 * Patch by Daniel Engström, 28 May 2003: x86 update * Patch by Dave Ellis, 9 May 2003 + 27 May 2003: add nand flash support to SXNI855T configuration fix/extend nand flash support: - fix 'nand erase' command so does not erase bad blocks - fix 'nand write' command so does not write to bad blocks - fix nand_probe() so handles no flash detected properly - add doc/README.nand - add .jffs2 and .oob options to nand read/write - add 'nand bad' command to list bad blocks - add 'clean' option to 'nand erase' to write JFFS2 clean markers - make NAND read/write faster * Patch by Rune Torgersen, 23 May 2003: Update for MPC8266ADS board --- cpu/i386/interrupts.c | 67 +++++++++++++++------------------------------------ 1 file changed, 19 insertions(+), 48 deletions(-) (limited to 'cpu/i386/interrupts.c') diff --git a/cpu/i386/interrupts.c b/cpu/i386/interrupts.c index 81d688185..614d40846 100644 --- a/cpu/i386/interrupts.c +++ b/cpu/i386/interrupts.c @@ -29,22 +29,6 @@ #include -#if 0 -/* done */ -int interrupt_init (void); -void irq_install_handler(int, interrupt_handler_t *, void *); -void irq_free_handler (int); -void enable_interrupts (void); -int disable_interrupts (void); - -/* todo */ -void timer_interrupt (struct pt_regs *); -void external_interrupt (struct pt_regs *); -void reset_timer (void); -ulong get_timer (ulong base); -void set_timer (ulong t); - -#endif struct idt_entry { u16 base_low; @@ -76,43 +60,30 @@ typedef struct { static irq_desc_t irq_table[MAX_IRQ]; -/* syscall stuff, very untested - * the current approach which includes copying - * part of the stack will work badly for - * varargs functions. - * if we were to store the top three words on the - * stack (eip, ss, eflags) somwhere and add 14 to - * %esp .... - */ + asm(".globl syscall_entry\n" \ "syscall_entry:\n" \ - "movl 12(%esp), %eax\n" \ - "movl %esp, %ebx\n" \ - "addl $16, %ebx\n" \ - "pushl %ebx\n" \ - "pushl %eax\n" \ - "call do_syscall\n" \ - "addl $8, %esp\n" \ - "iret\n"); + "popl %ebx\n" /* throw away the return address, flags */ \ + "popl %ebx\n" /* and segment that the INT instruction pushed */ \ + "popl %ebx\n" /* on to the stack */ \ + "movl %eax, %ecx\n" /* load the syscall nr argument*/ \ + "movl syscall_tbl, %eax\n" /* load start of syscall table */ \ + "cmpl $(11-1), %ecx\n" /* FixMe: find a way to use NR_SYSCALLS macro here */ \ + "ja bad_syscall\n" \ + "movl (%eax, %ecx, 4), %eax\n" /* load the handler of the syscall*/ \ + "test %eax, %eax\n" /* test for null */ \ + "je bad_syscall\n" \ + "popl %ecx\n" \ + "popl %ebx\n" \ + "sti \n" \ + "jmp *%eax\n" \ +"bad_syscall: movl $0xffffffff, %eax\n" \ + "popl %ecx\n" \ + "popl %ebx\n" \ + "ret"); void __attribute__ ((regparm(0))) syscall_entry(void); -int __attribute__ ((regparm(0))) do_syscall(u32 nr, u32 *stack) -{ - if (nr