diff --git a/ChangeLog b/ChangeLog index c0bae9e060f43649b135bed62a32e1a24b077d1d..1b9b774b776a40958748beb194335327a0ae427a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1573,3 +1573,5 @@ * drivers/net/slip.c -- SLIP is now basically functional on the LPC17xx with some caveats as described in the TODO list under LPC17xx. + * arch/x86/include/i486/irq.h -- Fix irqrestore() macro... it was not + correctly re-enabling interrupts. \ No newline at end of file diff --git a/TODO b/TODO index 815a3e301d996d7f0dfc6707bc5dc11e46c7ed35..ee9638a0b12cc1491b63ad4df80b155065fa85b2 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -NuttX TODO List (Last updated March 15, 2011) +NuttX TODO List (Last updated March 16 2011) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (5) Task/Scheduler (sched/) @@ -8,7 +8,7 @@ NuttX TODO List (Last updated March 15, 2011) (1) pthreads (sched/) (1) C++ Support (5) Binary loaders (binfmt/) - (17) Network (net/, drivers/net) + (16 Network (net/, drivers/net) (5) Network Utilities (netutils/) (2) USB (drivers/usbdev, drivers/usbhost) (5) Libraries (lib/) @@ -30,7 +30,7 @@ NuttX TODO List (Last updated March 15, 2011) (3) ARM/STR71x (arch/arm/src/str71x/) (4) ARM/LM3S6918 (arch/arm/src/lm3s/) (4) ARM/STM32 (arch/arm/src/stm32/) - (1) Intel x86 (arch/x86) + (0) Intel x86 (arch/x86) (4) 8051 / MCS51 (arch/8051/) (2) Hitachi/Renesas SH-1 (arch/sh/src/sh1) (4) Renesas M16C/26 (arch/sh/src/m16c) @@ -308,21 +308,6 @@ o Network (net/, drivers/net) the mechanism for leaving and joining groups is hidden behind a wrapper function so that little of this incompatibilities need be exposed. - Description: The SLIP driver (drivers/net/slip.c) has had only the most superficial - testing. Issues/Notes: - (1) A minor issue is that SLIP requires hardware handshake and - that has not been implemented in the UART drivers on most platforms. - You can use the slattach' option -L which enables "3-wire - operation." NOTE: This may also result in data overrun errors. - (2) Current State: The driver connects and responds to PINGs (ICMP - ECHO) commands. However, when used with the TCP stack and THTTPD, - there is some condition that causes a hang. So the SLIP driver - is still not ready for prime-time. - (3) Finally, the Linux slip driver is hard-coded to use an MTU of 296 - so setting CONFIG_NET_BUFSIZE to a 296 is also advised. - Status: Open - Priority: Medium - o Network Utilities (netutils/) Description: One critical part of netutils/ apps is untested: The uIP @@ -949,10 +934,6 @@ o ARM/STM32 (arch/arm/src/stm32/) o Intel x86 (arch/x86) ^^^^^^^^^^^^^^^^^^^^ - Description: No timer interrupts in the QEMU configuration. - Status: Open - Priorty: Medium-High - o 8051 / MCS51 (arch/8051/) ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/arch/x86/include/i486/arch.h b/arch/x86/include/i486/arch.h index c5e4adad555e55f723699220dbeb29e2044bd186..077c76626129a18ac5ad2bfa4b905089645106d0 100755 --- a/arch/x86/include/i486/arch.h +++ b/arch/x86/include/i486/arch.h @@ -121,7 +121,7 @@ #define PIC2_OCW2 0xa0 # define PIC_OCW2_ACT_SHIFT (0) -# define PIC_OCW2_ACT_SHIFT (7 << PIC_OCW2_ACT_SHIFT) +# define PIC_OCW2_ACT_MASK (7 << PIC_OCW2_ACT_SHIFT) # define PIC1_OCW2_ACT_IRQ0 (0 << PIC_OCW2_ACT_SHIFT) /* Act on IRQ 0 */ # define PIC1_OCW2_ACT_IRQ1 (1 << PIC_OCW2_ACT_SHIFT) /* Act on IRQ 1 */ # define PIC1_OCW2_ACT_IRQ2 (2 << PIC_OCW2_ACT_SHIFT) /* Act on IRQ 2 */ @@ -141,7 +141,7 @@ # define PIC2_OCW2_ACT_IRQ15 (7 << PIC_OCW2_ACT_SHIFT) /* Act on IRQ 15 */ # define PIC_OCW2_EOI_SHIFT (5) -# define PIC_OCW2_EOI_SHIFT (7 << PIC_OCW2_EOI_SHIFT) +# define PIC_OCW2_EOI_MASK (7 << PIC_OCW2_EOI_SHIFT) # define PIC_OCW2_EOI_AUTO (0 << PIC_OCW2_EOI_SHIFT) /* Rotate in Auto EOI Mode (Clear) */ # define PIC_OCW2_EOI_NONSPEC (1 << PIC_OCW2_EOI_SHIFT) /* Non Specific EOI */ # define PIC_OCW2_EOI_SPEC (3 << PIC_OCW2_EOI_SHIFT) /* Specific EOI */ @@ -171,7 +171,7 @@ # define PIC_OCW3_POLLCMD (1 << 2) /* Poll command */ # define PIC_OCW3_ONE (1 << 3) /* Must be set to 1 */ # define PIC_OCW3_SM_SHIFT (5) -# define PIC_OCW3_SM_SHIFT (3 << PIC_OCW3_SM_SHIFT) +# define PIC_OCW3_SM_MASK (3 << PIC_OCW3_SM_SHIFT) # define PIC_OCW3_RSM (2 << PIC_OCW3_SM_SHIFT) /* Reset Special Mask */ # define PIC_OCW3_SSM (3 << PIC_OCW3_SM_SHIFT) /* Set Special Mask */ diff --git a/arch/x86/include/i486/irq.h b/arch/x86/include/i486/irq.h index cb78e4d8143384ebbce24edb3ba24b1556e56556..0abf384eae062ad96179018c276cd4b9de5341cc 100755 --- a/arch/x86/include/i486/irq.h +++ b/arch/x86/include/i486/irq.h @@ -135,9 +135,17 @@ static inline irqstate_t irqflags() return flags; } -/* Get a sample of the FLAGS register, determine if interrupts are disabled */ +/* Get a sample of the FLAGS register, determine if interrupts are disabled. + * If the X86_FLAGS_IF is cleared by cli, then interrupts are disabled. If + * if the X86_FLAGS_IF is set by sti, then interrupts are enable. + */ static inline bool irqdisabled(irqstate_t flags) +{ + return ((flags & X86_FLAGS_IF) == 0); +} + +static inline bool irqenabled(irqstate_t flags) { return ((flags & X86_FLAGS_IF) != 0); } @@ -169,9 +177,9 @@ static inline irqstate_t irqsave(void) static inline void irqrestore(irqstate_t flags) { - if (irqdisabled(flags)) + if (irqenabled(flags)) { - irqdisable(); + irqenable(); } } diff --git a/arch/x86/src/qemu/qemu_handlers.c b/arch/x86/src/qemu/qemu_handlers.c index 05b5dee3f16775689da6b864d5dedf7ba1c60346..fbcb327aa06f23ad75fec1354433a8b7a5b55830 100644 --- a/arch/x86/src/qemu/qemu_handlers.c +++ b/arch/x86/src/qemu/qemu_handlers.c @@ -178,16 +178,16 @@ uint32_t *irq_handler(uint32_t *regs) * involved the slave. */ - if (irq >= 40) + if (irq >= IRQ8) { /* Send reset signal to slave */ - idt_outb(0x20, 0xa0); + idt_outb(PIC_OCW2_EOI_NONSPEC, PIC2_OCW2); } /* Send reset signal to master */ - idt_outb(0x20, 0x20); + idt_outb(PIC_OCW2_EOI_NONSPEC, PIC1_OCW2); /* Dispatch the interrupt */ diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 94baab575592b8a905ef79bc7ea39923793ee50e..725d7f84692b824fb3e4d1f1825b8f6ea6a7631b 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c @@ -68,7 +68,8 @@ /* NOTE: Slip requires UART hardware handshake. If hardware handshake is * not available with your UART, then you might try the 'slattach' option - * -L which is supposed to enable "3-wire operation." + * -L which enable "3-wire operation." That allows operation without the + * hardware handshake (but with the possibility of data overrun). */ /* Configuration ************************************************************/ @@ -93,8 +94,15 @@ # define CONFIG_SLIP_DEFPRIO 128 #endif -/* The Linux slip module hard-codes its MTU size to 296. So you might as - * well set CONFIG_NET_BUFSIZE to 296 as well. +/* The Linux slip module hard-codes its MTU size to 296 (40 bytes for the + * IP+TPC headers plus 256 bytes of data). So you might as well set + * CONFIG_NET_BUFSIZE to 296 as well. + * + * There may be an issue with this setting, however. I see that Linux uses + * a MTU of 296 and window of 256, but actually only sends 168 bytes of data: + * 40 + 128. I believe that is to allow for the 2x worst cast packet + * expansion. Ideally we would like to advertise the 256 MSS, but restrict + * uIP to 128 bytes (possibly by modifying the uip_mss() macro). */ #if CONFIG_NET_BUFSIZE < 296 @@ -995,6 +1003,13 @@ int slip_initialize(int intf, const char *devname) /* Register the device with the OS so that socket IOCTLs can be performed */ (void)netdev_register(&priv->dev); + + /* When the RX and TX tasks were created, the TTY file descriptor was + * dup'ed for each task. This task no longer needs the file descriptor + * and we can safely close it. + */ + + close(priv->fd); return OK; }