Commit 4fc7833c authored by Linus Torvalds's avatar Linus Torvalds

Import 0.99.14k

parent c6145b38
VERSION = 0.99
PATCHLEVEL = 14
ALPHA = j
ALPHA = k
all: Version zImage
......@@ -189,8 +189,7 @@ zdisk: zImage
zlilo: $(CONFIGURE) zImage
if [ -f /vmlinuz ]; then mv /vmlinuz /vmlinuz.old; fi
cat zImage > /vmlinuz
/etc/lilo/install
if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
tools/zSystem: boot/head.o init/main.o tools/version.o linuxsubdirs
$(LD) $(LDFLAGS) -T 100000 boot/head.o init/main.o tools/version.o \
......@@ -221,6 +220,7 @@ net: dummy
$(MAKE) linuxsubdirs SUBDIRS=net
clean:
rm -f kernel/ksyms.lst
rm -f core `find . -name '*.[oas]' -print`
rm -f core `find . -name 'core' -print`
rm -f zImage zSystem.map tools/zSystem tools/system
......
......@@ -82,7 +82,7 @@ bool 'AT1700 support' CONFIG_AT1700 n
#bool 'Ansel Communications EISA 3200 support' CONFIG_AC3200 n
#bool 'Cabletron E21xx support (not recommended)' CONFIG_E21 n
bool 'D-Link DE600 pocket adaptor support' CONFIG_DE600 n
#bool 'AT-LAN-TEC/RealTek pocket adaptor support' CONFIG_ATP n
bool 'AT-LAN-TEC/RealTek pocket adaptor support' CONFIG_ATP n
fi
*
bool 'Sony CDU31A CDROM driver support' CONFIG_CDU31A n
......
......@@ -85,12 +85,6 @@ static struct hd_struct hd[MAX_HD<<6]={{0,0},};
static int hd_sizes[MAX_HD<<6] = {0, };
static int hd_blocksizes[MAX_HD<<6] = {0, };
#define port_read(port,buf,nr) \
__asm__("cld;rep;insw": :"d" (port),"D" (buf),"c" (nr):"cx","di")
#define port_write(port,buf,nr) \
__asm__("cld;rep;outsw": :"d" (port),"S" (buf),"c" (nr):"cx","si")
#if (HD_DELAY > 0)
unsigned long read_timer(void)
{
......@@ -339,7 +333,7 @@ static void read_intr(void)
do_hd_request();
return;
ok_to_read:
port_read(HD_DATA,CURRENT->buffer,256);
insw(HD_DATA,CURRENT->buffer,256);
CURRENT->errors = 0;
CURRENT->buffer += 512;
CURRENT->sector++;
......@@ -398,7 +392,7 @@ static void write_intr(void)
end_request(1);
if (i > 0) {
SET_INTR(&write_intr);
port_write(HD_DATA,CURRENT->buffer,256);
outsw(HD_DATA,CURRENT->buffer,256);
sti();
} else {
#if (HD_DELAY > 0)
......@@ -508,7 +502,7 @@ static void do_hd_request(void)
bad_rw_intr();
goto repeat;
}
port_write(HD_DATA,CURRENT->buffer,256);
outsw(HD_DATA,CURRENT->buffer,256);
sti();
return;
}
......
......@@ -233,8 +233,8 @@ static unsigned char * translations[] = {
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
" !\"#$%&'()*+,-./0123456789:;<=>?"
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ "
"\004\261\007\007\007\007\370\361\040\007\331\277\332\300\305\007"
"\007\304\007\007\303\264\301\302\263\007\007\007\007\007\234\0"
"\004\261\007\007\007\007\370\361\007\007\331\277\332\300\305\304"
"\304\304\137\137\303\264\301\302\263\363\362\343\330\234\007\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\040\255\233\234\376\235\174\025\376\376\246\256\252\055\376\376"
......
......@@ -25,6 +25,7 @@
#include <linux/serial.h>
#include <linux/interrupt.h>
#include <linux/config.h>
#include <linux/major.h>
#include <linux/string.h>
#include <linux/fcntl.h>
#include <linux/ptrace.h>
......@@ -1580,7 +1581,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
* If this is a callout device, then just make sure the normal
* device isn't being used.
*/
if (MAJOR(filp->f_rdev) == 5) {
if (MAJOR(filp->f_rdev) == TTYAUX_MAJOR) {
if (info->flags & ASYNC_NORMAL_ACTIVE)
return -EBUSY;
if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&
......@@ -1694,7 +1695,7 @@ int rs_open(struct tty_struct *tty, struct file * filp)
tty->start = rs_start;
tty->hangup = rs_hangup;
if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) {
if (MAJOR(filp->f_rdev) == 4)
if (MAJOR(filp->f_rdev) == TTY_MAJOR)
*tty->termios = info->normal_termios;
else
*tty->termios = info->callout_termios;
......
......@@ -55,6 +55,8 @@
#include "vt_kern.h"
#define CONSOLE_DEV MKDEV(TTY_MAJOR,0)
#define MAX_TTYS 256
struct tty_struct *tty_table[MAX_TTYS];
......@@ -239,13 +241,13 @@ void do_tty_hangup(struct tty_struct * tty, struct file_operations *fops)
if (!tty)
return;
dev = 0x0400 + tty->line;
dev = MKDEV(TTY_MAJOR,tty->line);
for (filp = first_file, i=0; i<nr_files; i++, filp = filp->f_next) {
if (!filp->f_count)
if (!filp->f_count)
continue;
if (filp->f_rdev != dev)
continue;
if (filp->f_inode && filp->f_inode->i_rdev == 0x0400)
if (filp->f_inode && filp->f_inode->i_rdev == CONSOLE_DEV)
continue;
if (filp->f_op != &tty_fops)
continue;
......@@ -1031,7 +1033,7 @@ static int tty_read(struct inode * inode, struct file * file, char * buf, int co
tty = TTY_TABLE(dev);
if (!tty || (tty->flags & (1 << TTY_IO_ERROR)))
return -EIO;
if ((inode->i_rdev != 0x0400) && /* don't stop on /dev/console */
if ((inode->i_rdev != CONSOLE_DEV) && /* don't stop on /dev/console */
(tty->pgrp > 0) &&
(current->tty == dev) &&
(tty->pgrp != current->pgrp))
......@@ -1056,7 +1058,7 @@ static int tty_write(struct inode * inode, struct file * file, char * buf, int c
struct tty_struct * tty;
dev = file->f_rdev;
is_console = (inode->i_rdev == 0x0400);
is_console = (inode->i_rdev == CONSOLE_DEV);
if (MAJOR(dev) != TTY_MAJOR) {
printk("tty_write: pseudo-major != TTY_MAJOR\n");
return -EINVAL;
......@@ -1396,7 +1398,7 @@ static int tty_open(struct inode * inode, struct file * filp)
tty->session = current->session;
tty->pgrp = current->pgrp;
}
filp->f_rdev = 0x0400 | minor; /* Set it to something normal */
filp->f_rdev = MKDEV(TTY_MAJOR,minor); /* Set it to something normal */
return 0;
}
......
......@@ -38,7 +38,6 @@ static char *version =
#include <errno.h>
#include "dev.h"
#include "iow.h"
#include "eth.h"
#include "skbuff.h"
#include "arp.h"
......@@ -321,7 +320,7 @@ el_start_xmit(struct sk_buff *skb, struct device *dev)
inb(TX_STATUS);
outb(0x00, RX_BUF_CLR); /* Set rx packet area to 0. */
outw(gp_start, GP_LOW);
port_write_b(DATAPORT,buf,skb->len);
outsb(DATAPORT,buf,skb->len);
outw(gp_start, GP_LOW);
outb(AX_XMIT, AX_CMD); /* Trigger xmit. */
dev->trans_start = jiffies;
......@@ -464,7 +463,7 @@ el_receive(struct device *dev)
skb->len = pkt_len;
skb->dev = dev;
port_read_b(DATAPORT, (void *)(skb+1), pkt_len);
insb(DATAPORT, (void *)(skb+1), pkt_len);
#ifdef HAVE_NETIF_RX
netif_rx(skb);
......
......@@ -50,7 +50,6 @@ static char *version =
#include <memory.h>
#include "dev.h"
#include "iow.h"
#include "eth.h"
#include "skbuff.h"
#include "arp.h"
......
......@@ -33,16 +33,6 @@ static char *version = "3c509.c:pl13t 11/24/93 becker@super.org\n";
#include "skbuff.h"
#include "arp.h"
#ifndef port_read
#include "iow.h"
#endif
/* These should be in <asm/io.h>. */
#define port_read_l(port,buf,nr) \
__asm__("cld;rep;insl": :"d" (port),"D" (buf),"c" (nr):"cx","di")
#define port_write_l(port,buf,nr) \
__asm__("cld;rep;outsl": :"d" (port),"S" (buf),"c" (nr):"cx","si")
#ifndef HAVE_ALLOC_SKB
#define alloc_skb(size, priority) (struct sk_buff *) kmalloc(size,priority)
#endif
......@@ -415,7 +405,7 @@ el3_start_xmit(struct sk_buff *skb, struct device *dev)
outw(skb->len, ioaddr + TX_FIFO);
outw(0x00, ioaddr + TX_FIFO);
/* ... and the packet rounded to a doubleword. */
port_write_l(ioaddr + TX_FIFO, (void *)(skb+1), (skb->len + 3) >> 2);
outsl(ioaddr + TX_FIFO, (void *)(skb+1), (skb->len + 3) >> 2);
dev->trans_start = jiffies;
if (inw(ioaddr + TX_FREE) > 1536) {
......@@ -588,7 +578,7 @@ el3_rx(struct device *dev)
skb->dev = dev;
/* 'skb+1' points to the start of sk_buff data area. */
port_read_l(ioaddr+RX_FIFO, (void *)(skb+1),
insl(ioaddr+RX_FIFO, (void *)(skb+1),
(pkt_len + 3) >> 2);
#ifdef HAVE_NETIF_RX
......
......@@ -38,7 +38,6 @@ static char *version =
#include <memory.h>
#include "dev.h"
#include "iow.h"
#include "eth.h"
#include "skbuff.h"
#include "arp.h"
......@@ -426,7 +425,7 @@ net_send_packet(struct sk_buff *skb, struct device *dev)
outb(0x00, ioaddr + TX_INTR);
outw(length, ioaddr + DATAPORT);
port_write(ioaddr + DATAPORT, buf, (length + 1) >> 1);
outsw(ioaddr + DATAPORT, buf, (length + 1) >> 1);
lp->tx_queue++;
lp->tx_queue_len += length + 2;
......@@ -553,7 +552,7 @@ net_rx(struct device *dev)
skb->dev = dev;
/* 'skb+1' points to the start of sk_buff data area. */
port_read(ioaddr + DATAPORT, (void *)(skb+1), (pkt_len + 1) >> 1);
insw(ioaddr + DATAPORT, (void *)(skb+1), (pkt_len + 1) >> 1);
if (net_debug > 5) {
int i;
......
This diff is collapsed.
#include <linux/if_ether.h>
#include <linux/types.h>
#include <asm/io.h>
struct net_local {
#ifdef __KERNEL__
struct enet_statistics stats;
#endif
ushort saved_tx_size;
unsigned char
re_tx, /* Number of packet retransmissions. */
tx_unit_busy,
addr_mode, /* Current Rx filter e.g. promiscuous, etc. */
pac_cnt_in_tx_buf;
};
struct rx_header {
ushort pad; /* The first read is always corrupted. */
ushort rx_count;
ushort rx_status; /* Unknown bit assignments :-<. */
ushort cur_addr; /* Apparently the current buffer address(?) */
};
#define PAR_DATA 0
#define PAR_STATUS 1
#define PAR_CONTROL 2
#define Ctrl_LNibRead 0x08 /* LP_PSELECP */
#define Ctrl_HNibRead 0
#define Ctrl_LNibWrite 0x08 /* LP_PSELECP */
#define Ctrl_HNibWrite 0
#define Ctrl_SelData 0x04 /* LP_PINITP */
#define Ctrl_IRQEN 0x10 /* LP_PINTEN */
#define EOW 0xE0
#define EOC 0xE0
#define WrAddr 0x40 /* Set address of EPLC read, write register. */
#define RdAddr 0xC0
#define HNib 0x10
enum page0_regs
{
/* The first six registers hold the ethernet physical station address. */
PAR0 = 0, PAR1 = 1, PAR2 = 2, PAR3 = 3, PAR4 = 4, PAR5 = 5,
TxCNT0 = 6, TxCNT1 = 7, /* The transmit byte count. */
TxSTAT = 8, RxSTAT = 9, /* Tx and Rx status. */
ISR = 10, IMR = 11, /* Interrupt status and mask. */
CMR1 = 12, /* Command register 1. */
CMR2 = 13, /* Command register 2. */
MAR = 14, /* Memory address register. */
CMR2_h = 0x1d, };
enum eepage_regs
{ PROM_CMD = 6, PROM_DATA = 7 }; /* Note that PROM_CMD is in the "high" bits. */
#define ISR_TxOK 0x01
#define ISR_RxOK 0x04
#define ISR_TxErr 0x02
#define ISRh_RxErr 0x11 /* ISR, high nibble */
#define CMR1h_RESET 0x04 /* Reset. */
#define CMR1h_RxENABLE 0x02 /* Rx unit enable. */
#define CMR1h_TxENABLE 0x01 /* Tx unit enable. */
#define CMR1h_TxRxOFF 0x00
#define CMR1_ReXmit 0x08 /* Trigger a retransmit. */
#define CMR1_Xmit 0x04 /* Trigger a transmit. */
#define CMR1_IRQ 0x02 /* Interrupt active. */
#define CMR1_BufEnb 0x01 /* Enable the buffer(?). */
#define CMR1_NextPkt 0x01 /* Enable the buffer(?). */
#define CMR2_NULL 8
#define CMR2_IRQOUT 9
#define CMR2_RAMTEST 10
#define CMR2_EEPROM 12 /* Set to page 1, for reading the EEPROM. */
#define CMR2h_OFF 0 /* No accept mode. */
#define CMR2h_Physical 1 /* Accept a physical address match only. */
#define CMR2h_Normal 2 /* Accept physical and broadcast address. */
#define CMR2h_PROMISC 3 /* Promiscuous mode. */
/* An inline function used below: it differs from inb() by explicitly return an unsigned
char, saving a truncation. */
extern inline unsigned char inbyte(unsigned short port)
{
unsigned char _v;
__asm__ __volatile__ ("inb %w1,%b0" :"=a" (_v):"d" (port));
return _v;
}
/* Read register OFFSET.
This command should aways be terminated with read_end(). */
extern inline unsigned char read_nibble(short port, unsigned char offset)
{
unsigned char retval;
outb(EOC+offset, port + PAR_DATA);
outb(RdAddr+offset, port + PAR_DATA);
inbyte(port + PAR_STATUS); /* Settling time delay */
retval = inbyte(port + PAR_STATUS);
outb(EOC+offset, port + PAR_DATA);
return retval;
}
/* Functions for bulk data read. The interrupt line is always disabled. */
/* Get a byte using read mode 0, reading data from the control lines. */
extern inline unsigned char read_byte_mode0(short ioaddr)
{
unsigned char low_nib;
outb(Ctrl_LNibRead, ioaddr + PAR_CONTROL);
inbyte(ioaddr + PAR_STATUS);
low_nib = (inbyte(ioaddr + PAR_STATUS) >> 3) & 0x0f;
outb(Ctrl_HNibRead, ioaddr + PAR_CONTROL);
inbyte(ioaddr + PAR_STATUS); /* Settling time delay -- needed! */
inbyte(ioaddr + PAR_STATUS); /* Settling time delay -- needed! */
return low_nib | ((inbyte(ioaddr + PAR_STATUS) << 1) & 0xf0);
}
/* The same as read_byte_mode0(), but does multiple inb()s for stability. */
extern inline unsigned char read_byte_mode2(short ioaddr)
{
unsigned char low_nib;
outb(Ctrl_LNibRead, ioaddr + PAR_CONTROL);
inbyte(ioaddr + PAR_STATUS);
low_nib = (inbyte(ioaddr + PAR_STATUS) >> 3) & 0x0f;
outb(Ctrl_HNibRead, ioaddr + PAR_CONTROL);
inbyte(ioaddr + PAR_STATUS); /* Settling time delay -- needed! */
return low_nib | ((inbyte(ioaddr + PAR_STATUS) << 1) & 0xf0);
}
/* Read a byte through the data register. */
extern inline unsigned char read_byte_mode4(short ioaddr)
{
unsigned char low_nib;
outb(RdAddr | MAR, ioaddr + PAR_DATA);
low_nib = (inbyte(ioaddr + PAR_STATUS) >> 3) & 0x0f;
outb(RdAddr | HNib | MAR, ioaddr + PAR_DATA);
return low_nib | ((inbyte(ioaddr + PAR_STATUS) << 1) & 0xf0);
}
/* Read a byte through the data register, double reading to allow settling. */
extern inline unsigned char read_byte_mode6(short ioaddr)
{
unsigned char low_nib;
outb(RdAddr | MAR, ioaddr + PAR_DATA);
inbyte(ioaddr + PAR_STATUS);
low_nib = (inbyte(ioaddr + PAR_STATUS) >> 3) & 0x0f;
outb(RdAddr | HNib | MAR, ioaddr + PAR_DATA);
inbyte(ioaddr + PAR_STATUS);
return low_nib | ((inbyte(ioaddr + PAR_STATUS) << 1) & 0xf0);
}
extern inline void
write_reg(short port, unsigned char reg, unsigned char value)
{
unsigned char outval;
outb(EOC | reg, port + PAR_DATA);
outval = WrAddr | reg;
outb(outval, port + PAR_DATA);
outb(outval, port + PAR_DATA); /* Double write for PS/2. */
outval &= 0xf0;
outval |= value;
outb(outval, port + PAR_DATA);
outval &= 0x1f;
outb(outval, port + PAR_DATA);
outb(outval, port + PAR_DATA);
outb(EOC | outval, port + PAR_DATA);
}
extern inline void
write_reg_high(short port, unsigned char reg, unsigned char value)
{
unsigned char outval = EOC | HNib | reg;
outb(outval, port + PAR_DATA);
outval &= WrAddr | HNib | 0x0f;
outb(outval, port + PAR_DATA);
outb(outval, port + PAR_DATA); /* Double write for PS/2. */
outval = WrAddr | HNib | value;
outb(outval, port + PAR_DATA);
outval &= HNib | 0x0f; /* HNib | value */
outb(outval, port + PAR_DATA);
outb(outval, port + PAR_DATA);
outb(EOC | HNib | outval, port + PAR_DATA);
}
/* Write a byte out using nibble mode. The low nibble is written first. */
extern inline void
write_reg_byte(short port, unsigned char reg, unsigned char value)
{
unsigned char outval;
outb(EOC | reg, port + PAR_DATA); /* Reset the address register. */
outval = WrAddr | reg;
outb(outval, port + PAR_DATA);
outb(outval, port + PAR_DATA); /* Double write for PS/2. */
outb((outval & 0xf0) | (value & 0x0f), port + PAR_DATA);
outb(value & 0x0f, port + PAR_DATA);
value >>= 4;
outb(value, port + PAR_DATA);
outb(0x10 | value, port + PAR_DATA);
outb(0x10 | value, port + PAR_DATA);
outb(EOC | value, port + PAR_DATA); /* Reset the address register. */
}
/*
* Bulk data writes to the packet buffer. The interrupt line remains enabled.
* The first, faster method uses only the dataport (data modes 0, 2 & 4).
* The second (backup) method uses data and control regs (modes 1, 3 & 5).
* It should only be needed when there is skew between the individual data
* lines.
*/
extern inline void write_byte_mode0(short ioaddr, unsigned char value)
{
outb(value & 0x0f, ioaddr + PAR_DATA);
outb((value>>4) | 0x10, ioaddr + PAR_DATA);
}
extern inline void write_byte_mode1(short ioaddr, unsigned char value)
{
outb(value & 0x0f, ioaddr + PAR_DATA);
outb(Ctrl_IRQEN | Ctrl_LNibWrite, ioaddr + PAR_CONTROL);
outb((value>>4) | 0x10, ioaddr + PAR_DATA);
outb(Ctrl_IRQEN | Ctrl_HNibWrite, ioaddr + PAR_CONTROL);
}
/* Write 16bit VALUE to the packet buffer: the same as above just doubled. */
extern inline void write_word_mode0(short ioaddr, unsigned short value)
{
outb(value & 0x0f, ioaddr + PAR_DATA);
value >>= 4;
outb((value & 0x0f) | 0x10, ioaddr + PAR_DATA);
value >>= 4;
outb(value & 0x0f, ioaddr + PAR_DATA);
value >>= 4;
outb((value & 0x0f) | 0x10, ioaddr + PAR_DATA);
}
/* EEPROM_Ctrl bits. */
#define EE_SHIFT_CLK 0x04 /* EEPROM shift clock. */
#define EE_CS 0x02 /* EEPROM chip select. */
#define EE_CLK_HIGH 0x12
#define EE_CLK_LOW 0x16
#define EE_DATA_WRITE 0x01 /* EEPROM chip data in. */
#define EE_DATA_READ 0x08 /* EEPROM chip data out. */
/* Delay between EEPROM clock transitions. */
#define eeprom_delay(ticks) \
do { int _i = 40; while (--_i > 0) { __SLOW_DOWN_IO; }} while (0)
/* The EEPROM commands include the alway-set leading bit. */
#define EE_WRITE_CMD(offset) (((5 << 6) + (offset)) << 17)
#define EE_READ(offset) (((6 << 6) + (offset)) << 17)
#define EE_ERASE(offset) (((7 << 6) + (offset)) << 17)
#define EE_CMD_SIZE 27 /* The command+address+data size. */
......@@ -50,7 +50,6 @@ static char *version =
#include <memory.h>
#include "dev.h"
#include "iow.h"
#include "eth.h"
#include "skbuff.h"
#include "arp.h"
......@@ -701,7 +700,7 @@ set_multicast_list(struct device *dev, int num_addrs, void *addrs)
by the list of multicast addresses to be accepted. */
outw(SET_MC_CMD + 6, ioaddr + WRITE_PTR);
outw(num_addrs * 6, ioaddr);
port_write(ioaddr, addrs, num_addrs*3); /* 3 = addr len in words */
outsw(ioaddr, addrs, num_addrs*3); /* 3 = addr len in words */
/* We must trigger a whole 586 reset due to a bug. */
} else {
/* Not written yet, this requires expanding the init_words config
......@@ -770,11 +769,11 @@ init_82586_mem(struct device *dev)
/* Place the write pointer at 0xfff6 (address-aliased to 0xfffff6). */
outw(0xfff6, ioaddr + WRITE_PTR);
port_write(ioaddr, init_words, sizeof(init_words)>>1);
outsw(ioaddr, init_words, sizeof(init_words)>>1);
/* Fill in the station address. */
outw(SA_OFFSET, ioaddr + WRITE_PTR);
port_write(ioaddr, dev->dev_addr, 3);
outsw(ioaddr, dev->dev_addr, 3);
/* The Tx-block list is written as needed. We just set up the values. */
#ifdef initial_text_tx
......@@ -882,7 +881,7 @@ hardware_send_packet(struct device *dev, void *buf, short length)
/* Output the packet using the write pointer.
Hmmm, it feels a little like a 3c501! */
port_write(ioaddr + DATAPORT, buf, (length + 1) >> 1);
outsw(ioaddr + DATAPORT, buf, (length + 1) >> 1);
/* Set the old command link pointing to this send packet. */
outw(lp->tx_cmd_link, ioaddr + WRITE_PTR);
......@@ -961,7 +960,7 @@ eexp_rx(struct device *dev)
outw(data_buffer_addr + 10, ioaddr + READ_PTR);
port_read(ioaddr, (void *)(skb+1), (pkt_len + 1) >> 1);
insw(ioaddr, (void *)(skb+1), (pkt_len + 1) >> 1);
#ifdef HAVE_NETIF_RX
netif_rx(skb);
......
This diff is collapsed.
#ifndef _ASM_IOW_H
#define _ASM_IOW_H
/* I added a few. Please add to the distributed files. -djb. */
/* This file is copied 1:1 from /linux/include/asm/io.h, and changed all
al to ax, all inb to inw and all outb to outw (to get word in/out)
the four inlines here should be added to the original, and
then this one rm'd (and the #include "iow.h" in depca.c removed)...
Gruss PB
*/
/*
* Thanks to James van Artsdalen for a better timing-fix than
* the two short jumps: using outb's to a nonexistent port seems
* to guarantee better timings even on fast machines.
*
* On the other hand, I'd like to be sure of a non-existent port:
* I feel a bit unsafe abou using 0x80.
*
* Linus
*/
/* This is the more general version of outw.. */
extern inline void __outw(unsigned short value, unsigned short port)
{
__asm__ __volatile__ ("outw %w0,%w1"
: /* no outputs */
:"a" (value),"d" (port));
}
/* this is used for constant port numbers < 256.. */
extern inline void __outwc(unsigned short value, unsigned short port)
{
__asm__ __volatile__ ("outw %w0,%1"
: /* no outputs */
:"a" (value),"i" (port));
}
/* general version of inw */
extern inline unsigned int __inw(unsigned short port)
{
unsigned int _v;
__asm__ __volatile__ ("inw %w1,%w0"
:"=a" (_v):"d" (port),"0" (0));
return _v;
}
/* inw with constant port nr 0-255 */
extern inline unsigned int __inwc(unsigned short port)
{
unsigned int _v;
__asm__ __volatile__ ("inw %1,%w0"
:"=a" (_v):"i" (port),"0" (0));
return _v;
}
extern inline void __outw_p(unsigned short value, unsigned short port)
{
__asm__ __volatile__ ("outw %w0,%w1"
: /* no outputs */
:"a" (value),"d" (port));
SLOW_DOWN_IO;
}
extern inline void __outwc_p(unsigned short value, unsigned short port)
{
__asm__ __volatile__ ("outw %w0,%1"
: /* no outputs */
:"a" (value),"i" (port));
SLOW_DOWN_IO;
}
extern inline unsigned int __inw_p(unsigned short port)
{
unsigned int _v;
__asm__ __volatile__ ("inw %w1,%w0"
:"=a" (_v):"d" (port),"0" (0));
SLOW_DOWN_IO;
return _v;
}
extern inline unsigned int __inwc_p(unsigned short port)
{
unsigned int _v;
__asm__ __volatile__ ("inw %1,%w0"
:"=a" (_v):"i" (port),"0" (0));
SLOW_DOWN_IO;
return _v;
}
/*
* Note that due to the way __builtin_constant_p() works, you
* - can't use it inside a inlien function (it will never be true)
* - you don't have to worry about side effects within the __builtin..
*/
#define outw(val,port) \
((__builtin_constant_p((port)) && (port) < 256) ? \
__outwc((val),(port)) : \
__outw((val),(port)))
#define inw(port) \
((__builtin_constant_p((port)) && (port) < 256) ? \
__inwc(port) : \
__inw(port))
#define outw_p(val,port) \
((__builtin_constant_p((port)) && (port) < 256) ? \
__outwc_p((val),(port)) : \
__outw_p((val),(port)))
#define inw_p(port) \
((__builtin_constant_p((port)) && (port) < 256) ? \
__inwc_p(port) : \
__inw_p(port))
/* no longer used */
#endif
/* The word-wide I/O operations are more general, but require a halved
count. */
#define port_read(port,buf,nr) \
__asm__("cld;rep;insw": :"d" (port),"D" (buf),"c" (nr):"cx","di")
#define port_write(port,buf,nr) \
__asm__("cld;rep;outsw": :"d" (port),"S" (buf),"c" (nr):"cx","si")
#define port_read_b(port,buf,nr) \
__asm__("cld;rep;insb": :"d" (port),"D" (buf),"c" (nr):"cx","di")
#define port_write_b(port,buf,nr) \
__asm__("cld;rep;outsb": :"d" (port),"S" (buf),"c" (nr):"cx","si")
......@@ -14,7 +14,7 @@
C/O Supercomputing Research Ctr., 17100 Science Dr., Bowie MD 20715
*/
static char *version = "lance.c:v0.13s 11/15/93 becker@super.org\n";
static char *version = "lance.c:v0.14g 12/21/93 becker@super.org\n";
#include <linux/config.h>
#include <linux/kernel.h>
......@@ -30,7 +30,6 @@ static char *version = "lance.c:v0.13s 11/15/93 becker@super.org\n";
#include <asm/dma.h>
#include "dev.h"
#include "iow.h"
#include "eth.h"
#include "skbuff.h"
#include "arp.h"
......@@ -145,7 +144,7 @@ tx_full and tbusy flags.
Reasonable default values are 4 Tx buffers, and 16 Rx buffers.
That translates to 2 (4 == 2^^2) and 4 (16 == 2^^4). */
#ifndef LANCE_LOG_TX_BUFFERS
#define LANCE_LOG_TX_BUFFERS 2
#define LANCE_LOG_TX_BUFFERS 4
#define LANCE_LOG_RX_BUFFERS 4
#endif
......@@ -224,7 +223,6 @@ unsigned long lance_init(unsigned long mem_start, unsigned long mem_end)
{
int *port, ports[] = {0x300, 0x320, 0x340, 0x360, 0};
printk("lance_init(%#x, %#x).\n", mem_start, mem_end);
for (port = &ports[0]; *port; port++) {
int ioaddr = *port;
......@@ -336,7 +334,8 @@ static unsigned long lance_probe1(short ioaddr, unsigned long mem_start)
dev->irq = autoirq_report(1);
if (dev->irq)
printk(", probed IRQ %d, fixed at DMA %d.\n", dev->irq, dev->dma);
printk(", probed IRQ %d, fixed at DMA %d.\n",
dev->irq, dev->dma);
else {
printk(", failed to detect IRQ line.\n");
return mem_start;
......@@ -617,13 +616,6 @@ lance_interrupt(int reg_ptr)
if (csr0 & 0x0200) { /* Tx-done interrupt */
int dirty_tx = lp->dirty_tx;
if (dirty_tx == lp->cur_tx - TX_RING_SIZE
&& dev->tbusy) {
/* The ring is full, clear tbusy. */
dev->tbusy = 0;
mark_bh(INET_BH);
}
while (dirty_tx < lp->cur_tx) {
int entry = dirty_tx & TX_RING_MOD_MASK;
int status = lp->tx_ring[entry].base;
......@@ -650,7 +642,7 @@ lance_interrupt(int reg_ptr)
/* We don't free the skb if it's a data-only copy in the bounce
buffer. The address checks here are sorted -- the first test
should always works. */
should always work. */
if (databuff >= (void*)(&lp->tx_bounce_buffs[TX_RING_SIZE])
|| databuff < (void*)(lp->tx_bounce_buffs)) {
struct sk_buff *skb = ((struct sk_buff *)databuff) - 1;
......@@ -660,15 +652,21 @@ lance_interrupt(int reg_ptr)
dirty_tx++;
}
lp->dirty_tx = dirty_tx;
#ifndef final_version
if (lp->cur_tx - dirty_tx >= TX_RING_SIZE) {
printk("out-of-sync dirty pointer, %d vs. %d.\n",
dirty_tx, lp->cur_tx);
lp->dirty_tx += TX_RING_SIZE;
dirty_tx += TX_RING_SIZE;
}
#endif
if (dev->tbusy && dirty_tx > lp->cur_tx - TX_RING_SIZE + 2) {
/* The ring is no longer full, clear tbusy. */
dev->tbusy = 0;
mark_bh(INET_BH);
}
lp->dirty_tx = dirty_tx;
}
if (csr0 & 0x8000) {
......
......@@ -17,7 +17,7 @@
/* Routines for the NatSemi-based designs (NE[12]000). */
static char *version =
"ne.c:v0.99-14g 12/21/93 Donald Becker (becker@super.org)\n";
"ne.c:v0.99-14a 12/3/93 Donald Becker (becker@super.org)\n";
#include <linux/config.h>
#include <linux/kernel.h>
......@@ -25,9 +25,6 @@ static char *version =
#include <linux/errno.h>
#include <asm/system.h>
#include <asm/io.h>
#ifndef port_read
#include "iow.h"
#endif
#include "dev.h"
#include "8390.h"
......@@ -306,11 +303,11 @@ ne_block_input(struct device *dev, int count, char *buf, int ring_offset)
outb_p(ring_offset >> 8, nic_base + EN0_RSARHI);
outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD);
if (ei_status.word16) {
port_read(NE_BASE + NE_DATAPORT,buf,count>>1);
insw(NE_BASE + NE_DATAPORT,buf,count>>1);
if (count & 0x01)
buf[count-1] = inb(NE_BASE + NE_DATAPORT), xfer_count++;
} else {
port_read_b(NE_BASE + NE_DATAPORT, buf, count);
insb(NE_BASE + NE_DATAPORT, buf, count);
}
/* This was for the ALPHA version only, but enough people have
......@@ -385,9 +382,9 @@ ne_block_output(struct device *dev, int count,
outb_p(E8390_RWRITE+E8390_START, nic_base + NE_CMD);
if (ei_status.word16) {
port_write(NE_BASE + NE_DATAPORT, buf, count>>1);
outsw(NE_BASE + NE_DATAPORT, buf, count>>1);
} else {
port_write_b(NE_BASE + NE_DATAPORT, buf, count);
outsb(NE_BASE + NE_DATAPORT, buf, count);
}
/* This was for the ALPHA version only, but enough people have
......
......@@ -57,7 +57,6 @@ static char *version =
#include <errno.h>
#include "dev.h"
#include "iow.h"
#include "eth.h"
#include "skbuff.h"
#include "arp.h"
......@@ -425,7 +424,7 @@ net_rx(struct device *dev)
memcpy((unsigned char *) (skb + 1), (void*)dev->rmem_start,
pkt_len);
/* or */
port_read(ioaddr, (void *)(skb+1), (pkt_len + 1) >> 1);
insw(ioaddr, (void *)(skb+1), (pkt_len + 1) >> 1);
#ifdef HAVE_NETIF_RX
netif_rx(skb);
......
......@@ -333,17 +333,6 @@ All Rights Reserved\r\n\0 \r\n \r\n", 0x1029, 102
#define SIGNATURE_COUNT (sizeof( signatures ) / sizeof( struct signature ))
/* These defines are copied from kernel/blk_drv/hd.c */
#define insw( buf, count, port ) \
__asm__ volatile \
("cld;rep;insw": :"d" (port),"D" (buf),"c" (count):"cx","di" )
#define outsw( buf, count, port ) \
__asm__ volatile \
("cld;rep;outsw": :"d" (port),"S" (buf),"c" (count):"cx","si")
static void do_pause( unsigned amount ) /* Pause for amount*10 milliseconds */
{
unsigned long the_time = jiffies + amount; /* 0.01 seconds per jiffy */
......@@ -1469,9 +1458,9 @@ void aha152x_intr( int irqno )
disp_ports();
#endif
outsw( &current_SC->cmnd,
COMMAND_SIZE(current_SC->cmnd[0])>>1,
DATAPORT );
outsw( DATAPORT,
&current_SC->cmnd,
COMMAND_SIZE(current_SC->cmnd[0])>>1 );
#if defined(DEBUG_CMD)
printk("FCNT=%d, STCNT=%d, ", GETPORT(FIFOSTAT), GETSTCNT() );
......@@ -1763,7 +1752,7 @@ void aha152x_intr( int irqno )
{
CLRBITS(DMACNTRL0, _8BIT );
data_count >>= 1; /* Number of words */
insw( current_SC->SCp.ptr, data_count, DATAPORT );
insw( DATAPORT, current_SC->SCp.ptr, data_count );
#if defined(DEBUG_DATAI)
/* show what comes with the last transfer */
if(done)
......@@ -1892,7 +1881,7 @@ void aha152x_intr( int irqno )
{
CLRBITS(DMACNTRL0, _8BIT );
data_count >>= 1; /* Number of words */
outsw( current_SC->SCp.ptr, data_count, DATAPORT );
outsw( DATAPORT, current_SC->SCp.ptr, data_count );
current_SC->SCp.ptr += 2 * data_count;
current_SC->SCp.this_residual -= 2 * data_count;
}
......
......@@ -325,36 +325,6 @@ struct signature {
#define SIGNATURE_COUNT (sizeof( signatures ) / sizeof( struct signature ))
/* These functions are based on include/asm/io.h */
inline static unsigned short inw( unsigned short port )
{
unsigned short _v;
__asm__ volatile ( "inw %1,%0"
:"=a" (_v):"d" ((unsigned short) port) );
return _v;
}
inline static void outw( unsigned short value, unsigned short port )
{
__asm__ volatile ( "outw %0,%1"
: :"a" ((unsigned short) value),
"d" ((unsigned short) port) );
}
/* These defines are copied from kernel/blk_drv/hd.c */
#define insw( buf, count, port ) \
__asm__ volatile \
("cld;rep;insw": :"d" (port),"D" (buf),"c" (count):"cx","di" )
#define outsw( buf, count, port ) \
__asm__ volatile \
("cld;rep;outsw": :"d" (port),"S" (buf),"c" (count):"cx","si")
static void print_banner( void )
{
printk( "%s", fdomain_16x0_info() );
......@@ -1113,7 +1083,7 @@ void fdomain_16x0_intr( int unused )
--current_SC->SCp.this_residual;
} else {
data_count >>= 1;
outsw( current_SC->SCp.ptr, data_count, Write_FIFO_port );
outsw( Write_FIFO_port, current_SC->SCp.ptr, data_count );
current_SC->SCp.ptr += 2 * data_count;
current_SC->SCp.this_residual -= 2 * data_count;
}
......@@ -1146,7 +1116,7 @@ void fdomain_16x0_intr( int unused )
--current_SC->SCp.this_residual;
} else {
data_count >>= 1; /* Number of words */
insw( current_SC->SCp.ptr, data_count, Read_FIFO_port );
insw( Read_FIFO_port, current_SC->SCp.ptr, data_count );
current_SC->SCp.ptr += 2 * data_count;
current_SC->SCp.this_residual -= 2 * data_count;
}
......
......@@ -220,7 +220,7 @@ sb16_dsp_ioctl (int dev, unsigned int cmd, unsigned int arg,int local)
case SOUND_PCM_WRITE_CHANNELS:
if (local)
return dsp_set_stereo(arg-1)+1;
return IOCTL_OUT (arg, dsp_set_stereo(IOCTL_IN (arg)-1))+1;
return IOCTL_OUT (arg, dsp_set_stereo (IOCTL_IN (arg) - 1) + 1);
case SOUND_PCM_READ_CHANNELS:
if (local)
......
......@@ -25,16 +25,43 @@ void minix_put_inode(struct inode *inode)
minix_free_inode(inode);
}
static void minix_commit_super (struct super_block * sb,
struct minix_super_block * ms)
{
sb->u.minix_sb.s_sbh->b_dirt = 1;
sb->s_dirt = 0;
}
void minix_write_super (struct super_block * sb)
{
struct minix_super_block * ms;
if (!(sb->s_flags & MS_RDONLY)) {
ms = sb->u.minix_sb.s_ms;
if (ms->s_state & MINIX_VALID_FS)
ms->s_state &= ~MINIX_VALID_FS;
minix_commit_super (sb, ms);
}
sb->s_dirt = 0;
}
void minix_put_super(struct super_block *sb)
{
int i;
lock_super(sb);
if (!(sb->s_flags & MS_RDONLY)) {
sb->u.minix_sb.s_ms->s_state = sb->u.minix_sb.s_mount_state;
sb->u.minix_sb.s_sbh->b_dirt = 1;
}
sb->s_dev = 0;
for(i = 0 ; i < MINIX_I_MAP_SLOTS ; i++)
brelse(sb->u.minix_sb.s_imap[i]);
for(i = 0 ; i < MINIX_Z_MAP_SLOTS ; i++)
brelse(sb->u.minix_sb.s_zmap[i]);
brelse (sb->u.minix_sb.s_sbh);
unlock_super(sb);
return;
}
......@@ -45,11 +72,46 @@ static struct super_operations minix_sops = {
minix_write_inode,
minix_put_inode,
minix_put_super,
NULL,
minix_write_super,
minix_statfs,
NULL
minix_remount
};
int minix_remount (struct super_block * sb, int * flags, char * data)
{
struct minix_super_block * ms;
ms = sb->u.minix_sb.s_ms;
if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
return 0;
if (*flags & MS_RDONLY) {
if (ms->s_state & MINIX_VALID_FS ||
!(sb->u.minix_sb.s_mount_state & MINIX_VALID_FS))
return 0;
/* Mounting a rw partition read-only. */
ms->s_state = sb->u.minix_sb.s_mount_state;
sb->u.minix_sb.s_sbh->b_dirt = 1;
sb->s_dirt = 1;
minix_commit_super (sb, ms);
}
else {
/* Mount a partition which is read-only, read-write. */
sb->u.minix_sb.s_mount_state = ms->s_state;
ms->s_state &= ~MINIX_VALID_FS;
sb->u.minix_sb.s_sbh->b_dirt = 1;
sb->s_dirt = 1;
if (!(sb->u.minix_sb.s_mount_state & MINIX_VALID_FS))
printk ("MINIX-fs warning: remounting unchecked fs, "
"running fsck is recommended.\n");
else if ((sb->u.minix_sb.s_mount_state & MINIX_ERROR_FS))
printk ("MINIX-fs warning: remounting fs with errors, "
"running fsck is recommended.\n");
}
return 0;
}
struct super_block *minix_read_super(struct super_block *s,void *data,
int silent)
{
......@@ -67,6 +129,9 @@ struct super_block *minix_read_super(struct super_block *s,void *data,
return NULL;
}
ms = (struct minix_super_block *) bh->b_data;
s->u.minix_sb.s_ms = ms;
s->u.minix_sb.s_sbh = bh;
s->u.minix_sb.s_mount_state = ms->s_state;
s->s_blocksize = 1024;
s->s_blocksize_bits = 10;
s->u.minix_sb.s_ninodes = ms->s_ninodes;
......@@ -77,7 +142,6 @@ struct super_block *minix_read_super(struct super_block *s,void *data,
s->u.minix_sb.s_log_zone_size = ms->s_log_zone_size;
s->u.minix_sb.s_max_size = ms->s_max_size;
s->s_magic = ms->s_magic;
brelse(bh);
if (s->s_magic == MINIX_SUPER_MAGIC) {
s->u.minix_sb.s_dirsize = 16;
s->u.minix_sb.s_namelen = 14;
......@@ -87,9 +151,9 @@ struct super_block *minix_read_super(struct super_block *s,void *data,
} else {
s->s_dev = 0;
unlock_super(s);
brelse(bh);
if (!silent)
printk("VFS: Can't find a minix filesystem on dev 0x%04x.\n",
dev);
printk("VFS: Can't find a minix filesystem on dev 0x%04x.\n", dev);
return NULL;
}
for (i=0;i < MINIX_I_MAP_SLOTS;i++)
......@@ -114,21 +178,34 @@ struct super_block *minix_read_super(struct super_block *s,void *data,
brelse(s->u.minix_sb.s_zmap[i]);
s->s_dev=0;
unlock_super(s);
brelse(bh);
printk("MINIX-fs: bad superblock or unable to read bitmaps\n");
return NULL;
}
set_bit(0,s->u.minix_sb.s_imap[0]->b_data);
set_bit(0,s->u.minix_sb.s_zmap[0]->b_data);
unlock_super(s);
/* set up enough so that it can read an inode */
s->s_dev = dev;
s->s_op = &minix_sops;
s->s_mounted = iget(s,MINIX_ROOT_INO);
unlock_super(s);
if (!s->s_mounted) {
s->s_dev = 0;
brelse(bh);
printk("MINIX-fs: get root inode failed\n");
return NULL;
}
if (!(s->s_flags & MS_RDONLY)) {
ms->s_state &= ~MINIX_VALID_FS;
bh->b_dirt = 1;
s->s_dirt = 1;
}
if (!(s->u.minix_sb.s_mount_state & MINIX_VALID_FS))
printk ("MINIX-fs: mounting unchecked file system, "
"running fsck is recommended.\n");
else if (s->u.minix_sb.s_mount_state & MINIX_ERROR_FS)
printk ("MINIX-fs: mounting file system with errors, "
"running fsck is recommended.\n");
return s;
}
......
......@@ -52,6 +52,16 @@ __IN1(s##c) __IN2(s,s1,"") : "=a" (_v) : "i" (port) ,##i ); return _v; } \
__IN1(s##_p) __IN2(s,s1,"w") : "=a" (_v) : "d" (port) ,##i ); SLOW_DOWN_IO; return _v; } \
__IN1(s##c_p) __IN2(s,s1,"") : "=a" (_v) : "i" (port) ,##i ); SLOW_DOWN_IO; return _v; }
#define __INS(s) \
extern inline void ins##s(unsigned short port, void * addr, unsigned long count) \
{ __asm__ __volatile__ ("cld ; rep ; ins" #s \
: "=D" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }
#define __OUTS(s) \
extern inline void outs##s(unsigned short port, void * addr, unsigned long count) \
{ __asm__ __volatile__ ("cld ; rep ; outs" #s \
: "=S" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }
__IN(b,"b","0" (0))
__IN(w,"w","0" (0))
__IN(l,"")
......@@ -60,6 +70,14 @@ __OUT(b,"b",char)
__OUT(w,"w",short)
__OUT(l,,int)
__INS(b)
__INS(w)
__INS(l)
__OUTS(b)
__OUTS(w)
__OUTS(l)
/*
* Note that due to the way __builtin_constant_p() works, you
* - can't use it inside a inline function (it will never be true)
......
......@@ -49,6 +49,7 @@ extern unsigned long file_table_init(unsigned long start, unsigned long end);
#define MAJOR(a) (int)((unsigned short)(a) >> 8)
#define MINOR(a) (int)((unsigned short)(a) & 0xFF)
#define MKDEV(a,b) ((int)((((a) & 0xff) << 8) | ((b) & 0xff)))
#ifndef NULL
#define NULL ((void *) 0)
......
......@@ -68,7 +68,7 @@
/* borrowed from hd.c */
#define READ_DATA(port, buf, nr) \
__asm__("cld;rep;insb": :"d" (port),"D" (buf),"c" (nr):"cx","di")
insb(port, buf, nr)
#define SET_TIMER(func, jifs) \
((timer_table[MCD_TIMER].expires = jiffies + jifs), \
......
......@@ -22,6 +22,8 @@
#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */
#define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */
#define NEW_MINIX_SUPER_MAGIC 0x2468 /* minix V2 - not implemented */
#define MINIX_VALID_FS 0x0001 /* Clean fs. */
#define MINIX_ERROR_FS 0x0002 /* fs has errors. */
#define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
......@@ -65,6 +67,7 @@ struct minix_super_block {
unsigned short s_log_zone_size;
unsigned long s_max_size;
unsigned short s_magic;
unsigned short s_state;
};
struct minix_dir_entry {
......@@ -100,6 +103,8 @@ extern struct buffer_head * minix_bread(struct inode *, int, int);
extern void minix_truncate(struct inode *);
extern void minix_put_super(struct super_block *);
extern struct super_block *minix_read_super(struct super_block *,void *,int);
extern void minix_write_super(struct super_block *);
extern int minix_remount (struct super_block * sb, int * flags, char * data);
extern void minix_read_inode(struct inode *);
extern void minix_write_inode(struct inode *);
extern void minix_put_inode(struct inode *);
......
......@@ -16,6 +16,9 @@ struct minix_sb_info {
struct buffer_head * s_zmap[8];
unsigned long s_dirsize;
unsigned long s_namelen;
struct buffer_head * s_sbh;
struct minix_super_block * s_ms;
unsigned short s_mount_state;
};
#endif
......@@ -429,7 +429,7 @@ NORET_TYPE void do_exit(long code)
current->p_cptr = p->p_osptr;
p->p_ysptr = NULL;
p->flags &= ~(PF_PTRACED|PF_TRACESYS);
if (task[1])
if (task[1] && task[1] != current)
p->p_pptr = task[1];
else
p->p_pptr = task[0];
......
......@@ -10,7 +10,7 @@
#
#
trap "rm -f ksyms.tmp ksyms.lst" 0 1 2
trap "rm -f ksyms.tmp ksyms.lst" 1 2
sed -e '/^#/d' -e '/^[ ]*$/d' ksyms.lst | sort > ksyms.tmp
......@@ -27,7 +27,7 @@ awk 'BEGIN {stringloc = 0}
echo '
strings:'
awk '{print " .ascii \"" $1 "\\0\""}' ksyms.tmp
rm -f ksyms.tmp
#
......
......@@ -748,8 +748,10 @@ static void show_task(int nr,struct task_struct * p)
printk(stat_nam[p->state]);
else
printk(" ");
/* this prints bogus values for the current process */
printk(" %08lX ", ((unsigned long *)p->tss.esp)[2]);
if (p == current)
printk(" current ");
else
printk(" %08lX ", ((unsigned long *)p->tss.esp)[3]);
printk("%5lu %5d %6d ",
p->tss.esp - p->kernel_stack_page, p->pid, p->p_pptr->pid);
if (p->p_cptr)
......
......@@ -22,6 +22,12 @@
#include <asm/segment.h>
#include <asm/io.h>
static inline void console_verbose(void)
{
extern int console_loglevel;
console_loglevel = 15;
}
#define DO_ERROR(trapnr, signr, str, name, tsk) \
asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
{ \
......@@ -78,6 +84,7 @@ asmlinkage void alignment_check(void);
if ((regs->eflags & VM_MASK) || (3 & regs->cs) == 3)
return;
console_verbose();
printk("%s: %04lx\n", str, err & 0xffff);
printk("EIP: %04x:%08lx\nEFLAGS: %08lx\n", 0xffff & regs->cs,regs->eip,regs->eflags);
printk("eax: %08lx ebx: %08lx ecx: %08lx edx: %08lx\n",
......
......@@ -357,7 +357,6 @@ icmp_rcv(struct sk_buff *skb1, struct device *dev, struct options *opt,
unsigned long saddr, int redo, struct inet_protocol *protocol)
{
struct icmphdr *icmph;
unsigned char *buff;
/* Drop broadcast packets. */
if (chk_addr(daddr) == IS_BROADCAST) {
......@@ -368,8 +367,10 @@ icmp_rcv(struct sk_buff *skb1, struct device *dev, struct options *opt,
return(0);
}
buff = skb1->h.raw;
icmph = (struct icmphdr *) buff;
/* Skip IP-Header */
len -= skb1->h.iph->ihl << 2;
skb1->h.raw += skb1->h.iph->ihl << 2;
icmph = (struct icmphdr *) skb1->h.raw;
/* Validate the packet first */
if (ip_compute_csum((unsigned char *) icmph, len)) {
......
......@@ -428,21 +428,22 @@ ip_fast_csum(unsigned char * buff, int wlen)
{
unsigned long sum = 0;
if (wlen)
if (wlen) {
unsigned long bogus;
__asm__("clc\n"
"1:\t"
"lodsl\n\t"
"adcl %%eax, %0\n\t"
"adcl %3, %0\n\t"
"decl %2\n\t"
"jne 1b\n\t"
"adcl $0, %0\n\t"
"movl %0, %%eax\n\t"
"shrl $16, %%eax\n\t"
"addw %%ax, %w0\n\t"
"movl %0, %3\n\t"
"shrl $16, %3\n\t"
"addw %w3, %w0\n\t"
"adcw $0, %w0"
: "=r" (sum), "=S" (buff), "=r" (wlen)
: "0" (sum), "1" (buff), "2" (wlen)
: "ax" );
: "=r" (sum), "=S" (buff), "=r" (wlen), "=a" (bogus)
: "0" (sum), "1" (buff), "2" (wlen));
}
return (~sum) & 0xffff;
}
......@@ -1266,7 +1267,6 @@ ip_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt)
}
/* Point into the IP datagram, just past the header. */
skb->h.raw += iph->ihl*4;
hash = iph->protocol & (MAX_INET_PROTOS -1);
for (ipprot = (struct inet_protocol *)inet_protos[hash];
ipprot != NULL;
......@@ -1305,7 +1305,7 @@ ip_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt)
* check the protocol handler's return values here...
*/
ipprot->handler(skb2, dev, opts_p ? &opt : 0, iph->daddr,
(ntohs(iph->tot_len) - (iph->ihl * 4)),
ntohs(iph->tot_len),
iph->saddr, 0, ipprot);
}
......
......@@ -44,7 +44,7 @@
static struct rtable *rt_base = NULL;
static struct rtable *rt_loopback = NULL;
/* Dump the contents of a routing table entry. */
static void
......@@ -80,6 +80,8 @@ static void rt_del(unsigned long dst)
continue;
}
*rp = r->rt_next;
if (rt_loopback == r)
rt_loopback = NULL;
kfree_s(r, sizeof(struct rtable));
}
restore_flags(flags);
......@@ -105,6 +107,8 @@ void rt_flush(struct device *dev)
continue;
}
*rp = r->rt_next;
if (rt_loopback == r)
rt_loopback = NULL;
kfree_s(r, sizeof(struct rtable));
}
restore_flags(flags);
......@@ -216,6 +220,8 @@ rt_add(short flags, unsigned long dst, unsigned long gw, struct device *dev)
continue;
}
*rp = r->rt_next;
if (rt_loopback == r)
rt_loopback = NULL;
kfree_s(r, sizeof(struct rtable));
}
/* add the new route */
......@@ -227,6 +233,8 @@ rt_add(short flags, unsigned long dst, unsigned long gw, struct device *dev)
}
rt->rt_next = r;
*rp = rt;
if (rt->rt_dev->flags & IFF_LOOPBACK)
rt_loopback = rt;
restore_flags(cpuflags);
return;
}
......@@ -306,41 +314,28 @@ rt_get_info(char *buffer)
return(pos - buffer);
}
/*
* rewrote this too.. Maybe somebody can understand it now. Linus
* This is hackish, but results in better code. Use "-S" to see why.
*/
#define early_out ({ goto no_route; 1; })
struct rtable * rt_route(unsigned long daddr, struct options *opt)
{
struct rtable *rt;
int type;
/*
* This is a hack, I think. -FvK
*/
if ((type=chk_addr(daddr)) == IS_MYADDR) daddr = my_addr();
/*
* Loop over the IP routing table to find a route suitable
* for this packet. Note that we really should have a look
* at the IP options to see if we have been given a hint as
* to what kind of path we should use... -FvK
*/
/*
* This depends on 'rt_mask' and the ordering set up in 'rt_add()' - Linus
*/
for (rt = rt_base; rt != NULL; rt = rt->rt_next) {
if (!((rt->rt_dst ^ daddr) & rt->rt_mask)) {
rt->rt_use++;
return rt;
}
for (rt = rt_base; rt != NULL || early_out ; rt = rt->rt_next) {
if (!((rt->rt_dst ^ daddr) & rt->rt_mask))
break;
/* broadcast addresses can be special cases.. */
if ((rt->rt_dev->flags & IFF_BROADCAST) &&
rt->rt_dev->pa_brdaddr == daddr) {
rt->rt_use++;
return(rt);
}
rt->rt_dev->pa_brdaddr == daddr)
break;
}
if (daddr == rt->rt_dev->pa_addr)
rt = rt_loopback;
rt->rt_use++;
return rt;
no_route:
return NULL;
}
......
......@@ -2934,6 +2934,9 @@ tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
DPRINTF((DBG_TCP, "tcp.c: tcp_rcv dev = NULL\n"));
return(0);
}
/* Skip IP-Header */
len -= skb->h.iph->ihl << 2;
skb->h.raw += skb->h.iph->ihl << 2;
th = skb->h.th;
/* Find the socket. */
......
......@@ -550,6 +550,9 @@ udp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
struct sock *sk;
struct udphdr *uh;
/* Skip IP-Header */
len -= skb->h.iph->ihl << 2;
skb->h.raw += skb->h.iph->ihl << 2;
uh = (struct udphdr *) skb->h.uh;
sk = get_sock(&udp_prot, uh->dest, saddr, uh->source, daddr);
if (sk == NULL)
......
......@@ -231,6 +231,7 @@ static void
sock_release(struct socket *sock)
{
int oldstate;
struct inode *inode;
struct socket *peersock, *nextsock;
DPRINTF((net_debug, "NET: sock_release: socket 0x%x, inode 0x%x\n",
......@@ -251,11 +252,12 @@ sock_release(struct socket *sock)
peersock = (oldstate == SS_CONNECTED) ? sock->conn : NULL;
if (sock->ops) sock->ops->release(sock, peersock);
if (peersock) sock_release_peer(peersock);
inode = SOCK_INODE(sock);
sock->state = SS_FREE; /* this really releases us */
wake_up(&socket_wait_free);
/* We need to do this. If sock alloc was called we already have an inode. */
iput(SOCK_INODE(sock));
iput(inode);
}
......
......@@ -16,7 +16,6 @@
* Fred Baumgarten, <dc6iq@insu1.etec.uni-kalrsruhe.de>
*
* Fixes:
* Andriews Brouwer : Comment errors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment