Commit 537b6ff0 authored by Linus Torvalds's avatar Linus Torvalds

Import 0.99.13k

parent 4779b38b
VERSION = 0.99
PATCHLEVEL = 13
ALPHA = k
all: Version zImage all: Version zImage
...@@ -41,7 +44,8 @@ ROOT_DEV = CURRENT ...@@ -41,7 +44,8 @@ ROOT_DEV = CURRENT
# The number is the same as you would ordinarily press at bootup. # The number is the same as you would ordinarily press at bootup.
# #
SVGA_MODE= -DSVGA_MODE=3 # SVGA_MODE= -DSVGA_MODE=3
SVGA_MODE= -DSVGA_MODE=NORMAL_VGA
# Special options. # Special options.
#OPTS = -pro #OPTS = -pro
...@@ -50,7 +54,7 @@ SVGA_MODE= -DSVGA_MODE=3 ...@@ -50,7 +54,7 @@ SVGA_MODE= -DSVGA_MODE=3
# standard CFLAGS # standard CFLAGS
# #
CFLAGS = -Wall -Wstrict-prototypes -O6 -fomit-frame-pointer # -x c++ CFLAGS = -Wall -Wstrict-prototypes -O6 -fomit-frame-pointer -pipe # -x c++
ifdef CONFIG_M486 ifdef CONFIG_M486
CFLAGS := $(CFLAGS) -m486 CFLAGS := $(CFLAGS) -m486
...@@ -77,15 +81,27 @@ STRIP =strip ...@@ -77,15 +81,27 @@ STRIP =strip
ARCHIVES =kernel/kernel.o mm/mm.o fs/fs.o net/net.o ipc/ipc.o ARCHIVES =kernel/kernel.o mm/mm.o fs/fs.o net/net.o ipc/ipc.o
FILESYSTEMS =fs/filesystems.a FILESYSTEMS =fs/filesystems.a
DRIVERS =kernel/blk_drv/blk_drv.a kernel/chr_drv/chr_drv.a \ DRIVERS =drivers/block/block.a \
kernel/blk_drv/scsi/scsi.a kernel/chr_drv/sound/sound.a \ drivers/char/char.a \
drivers/net/net.a \
ibcs/ibcs.o ibcs/ibcs.o
MATH =kernel/FPU-emu/math.a
LIBS =lib/lib.a LIBS =lib/lib.a
SUBDIRS =kernel mm fs net ipc ibcs lib SUBDIRS =kernel drivers mm fs net ipc ibcs lib
KERNELHDRS =/usr/src/linux/include KERNELHDRS =/usr/src/linux/include
ifdef CONFIG_SCSI
DRIVERS := $(DRIVERS) drivers/scsi/scsi.a
endif
ifdef CONFIG_SOUND
DRIVERS := $(DRIVERS) drivers/sound/sound.a
endif
ifdef CONFIG_MATH_EMULATION
DRIVERS := $(DRIVERS) drivers/FPU-emu/math.a
endif
.c.s: .c.s:
$(CC) $(CFLAGS) -S -o $*.s $< $(CC) $(CFLAGS) -S -o $*.s $<
.s.o: .s.o:
...@@ -102,7 +118,7 @@ config: ...@@ -102,7 +118,7 @@ config:
$(MAKE) soundconf $(MAKE) soundconf
soundconf: soundconf:
cd kernel/chr_drv/sound;$(MAKE) config cd drivers/sound;$(MAKE) config
linuxsubdirs: dummy linuxsubdirs: dummy
@for i in $(SUBDIRS); do (cd $$i && echo $$i && $(MAKE)) || exit; done @for i in $(SUBDIRS); do (cd $$i && echo $$i && $(MAKE)) || exit; done
...@@ -111,7 +127,7 @@ tools/./version.h: tools/version.h ...@@ -111,7 +127,7 @@ tools/./version.h: tools/version.h
tools/version.h: $(CONFIGURE) Makefile tools/version.h: $(CONFIGURE) Makefile
@./makever.sh @./makever.sh
@echo \#define UTS_RELEASE \"0.99.13\" > tools/version.h @echo \#define UTS_RELEASE \"$(VERSION).$(PATCHLEVEL)$(ALPHA)\" > tools/version.h
@echo \#define UTS_VERSION \"\#`cat .version` `date`\" >> tools/version.h @echo \#define UTS_VERSION \"\#`cat .version` `date`\" >> tools/version.h
@echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> tools/version.h @echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> tools/version.h
@echo \#define LINUX_COMPILE_BY \"`whoami`\" >> tools/version.h @echo \#define LINUX_COMPILE_BY \"`whoami`\" >> tools/version.h
...@@ -137,7 +153,6 @@ tools/system: boot/head.o init/main.o tools/version.o linuxsubdirs ...@@ -137,7 +153,6 @@ tools/system: boot/head.o init/main.o tools/version.o linuxsubdirs
$(ARCHIVES) \ $(ARCHIVES) \
$(FILESYSTEMS) \ $(FILESYSTEMS) \
$(DRIVERS) \ $(DRIVERS) \
$(MATH) \
$(LIBS) \ $(LIBS) \
-o tools/system > System.map -o tools/system > System.map
...@@ -176,7 +191,6 @@ tools/zSystem: boot/head.o init/main.o tools/version.o linuxsubdirs ...@@ -176,7 +191,6 @@ tools/zSystem: boot/head.o init/main.o tools/version.o linuxsubdirs
$(ARCHIVES) \ $(ARCHIVES) \
$(FILESYSTEMS) \ $(FILESYSTEMS) \
$(DRIVERS) \ $(DRIVERS) \
$(MATH) \
$(LIBS) \ $(LIBS) \
-o tools/zSystem > zSystem.map -o tools/zSystem > zSystem.map
...@@ -192,11 +206,15 @@ mm: dummy ...@@ -192,11 +206,15 @@ mm: dummy
kernel: dummy kernel: dummy
$(MAKE) linuxsubdirs SUBDIRS=kernel $(MAKE) linuxsubdirs SUBDIRS=kernel
drivers: dummy
$(MAKE) linuxsubdirs SUBDIRS=drivers
clean: clean:
rm -f zImage zSystem.map tools/zSystem rm -f core `find . -name '*.[oas]' -print`
rm -f Image System.map core boot/bootsect boot/setup \ rm -f zImage zSystem.map tools/zSystem tools/system
rm -f Image System.map boot/bootsect boot/setup \
boot/bootsect.s boot/setup.s boot/head.s init/main.s boot/bootsect.s boot/setup.s boot/head.s init/main.s
rm -f init/*.o tools/system tools/build boot/*.o tools/*.o rm -f init/*.o tools/build boot/*.o tools/*.o
for i in zBoot $(SUBDIRS); do (cd $$i && $(MAKE) clean); done for i in zBoot $(SUBDIRS); do (cd $$i && $(MAKE) clean); done
mrproper: clean mrproper: clean
...@@ -204,6 +222,8 @@ mrproper: clean ...@@ -204,6 +222,8 @@ mrproper: clean
rm -f .version .config* config.old rm -f .version .config* config.old
rm -f .depend `find . -name .depend -print` rm -f .depend `find . -name .depend -print`
distclean: mrproper
backup: mrproper backup: mrproper
cd .. && tar cf - linux | gzip -9 > backup.gz cd .. && tar cf - linux | gzip -9 > backup.gz
sync sync
......
...@@ -165,8 +165,8 @@ CONFIGURING the kernel: ...@@ -165,8 +165,8 @@ CONFIGURING the kernel:
should probably answer 'n' to the questions for a "production" should probably answer 'n' to the questions for a "production"
kernel. kernel.
- edit net/inet/CONFIG to configure the networking parts of the kernel. - edit drivers/net/CONFIG to configure the networking parts of the
The comments should hopefully clarify it all. kernel. The comments should hopefully clarify it all.
- Check the top Makefile for further site-dependent configuration - Check the top Makefile for further site-dependent configuration
(default SVGA mode etc). (default SVGA mode etc).
......
This diff is collapsed.
...@@ -822,7 +822,7 @@ moparadise: .byte 0x04, 0x55, 0x54 ...@@ -822,7 +822,7 @@ moparadise: .byte 0x04, 0x55, 0x54
motrident: .byte 0x09, 0x50, 0x51, 0x52, 0x57, 0x58, 0x59, 0x5a motrident: .byte 0x09, 0x50, 0x51, 0x52, 0x57, 0x58, 0x59, 0x5a
motseng: .byte 0x07, 0x26, 0x2a, 0x23, 0x24, 0x22 motseng: .byte 0x07, 0x26, 0x2a, 0x23, 0x24, 0x22
movideo7: .byte 0x08, 0x40, 0x43, 0x44, 0x41, 0x42, 0x45 movideo7: .byte 0x08, 0x40, 0x43, 0x44, 0x41, 0x42, 0x45
mooakvga: .byte 0x07, 0x00, 0x07, 0x4f, 0x50, 0x51 mooakvga: .byte 0x08, 0x00, 0x07, 0x4e, 0x4f, 0x50, 0x51
mof1280: .byte 0x04, 0x54, 0x55 mof1280: .byte 0x04, 0x54, 0x55
mounknown: .byte 0x02 mounknown: .byte 0x02
...@@ -840,7 +840,7 @@ dscparadise: .word 0x5032, 0x501c, 0x8419, 0x842b ...@@ -840,7 +840,7 @@ dscparadise: .word 0x5032, 0x501c, 0x8419, 0x842b
dsctrident: .word 0x5032, 0x501c, 0x501e, 0x502b, 0x503c, 0x8419, 0x841e, 0x842b, 0x843c dsctrident: .word 0x5032, 0x501c, 0x501e, 0x502b, 0x503c, 0x8419, 0x841e, 0x842b, 0x843c
dsctseng: .word 0x5032, 0x501c, 0x503c, 0x6428, 0x8419, 0x841c, 0x842c dsctseng: .word 0x5032, 0x501c, 0x503c, 0x6428, 0x8419, 0x841c, 0x842c
dscvideo7: .word 0x5032, 0x501c, 0x502b, 0x503c, 0x643c, 0x8419, 0x842c, 0x841c dscvideo7: .word 0x5032, 0x501c, 0x502b, 0x503c, 0x643c, 0x8419, 0x842c, 0x841c
dscoakvga: .word 0x5032, 0x501c, 0x2819, 0x5019, 0x843c, 0x8419, 0x842C dscoakvga: .word 0x5032, 0x501c, 0x2819, 0x5019, 0x503c, 0x843c, 0x8419, 0x842b
dscf1280: .word 0x5032, 0x501c, 0x842b, 0x8419 dscf1280: .word 0x5032, 0x501c, 0x842b, 0x8419
dsunknown: .word 0x5032, 0x501c dsunknown: .word 0x5032, 0x501c
modesave: .word SVGA_MODE modesave: .word SVGA_MODE
......
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
* *
* General setup * General setup
* *
bool 'Kernel math emulation' CONFIG_MATH_EMULATION y bool 'Kernel math emulation' CONFIG_MATH_EMULATION n
bool 'Normal harddisk support' CONFIG_BLK_DEV_HD y bool 'Normal harddisk support' CONFIG_BLK_DEV_HD y
bool 'XT harddisk support' CONFIG_BLK_DEV_XD n bool 'XT harddisk support' CONFIG_BLK_DEV_XD n
bool 'TCP/IP networking' CONFIG_INET y bool 'TCP/IP networking' CONFIG_INET y
bool 'Limit memory to low 16MB' CONFIG_MAX_16M n bool 'Limit memory to low 16MB' CONFIG_MAX_16M y
bool 'System V IPC' CONFIG_SYSVIPC y bool 'System V IPC' CONFIG_SYSVIPC y
bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y
* *
...@@ -28,23 +28,28 @@ else ...@@ -28,23 +28,28 @@ else
* *
* SCSI support type (disk, tape, CDrom) * SCSI support type (disk, tape, CDrom)
* *
bool 'Scsi disk support' CONFIG_BLK_DEV_SD n bool 'Scsi disk support' CONFIG_BLK_DEV_SD y
bool 'Scsi tape support' CONFIG_BLK_DEV_ST n bool 'Scsi tape support' CONFIG_CHR_DEV_ST y
bool 'Scsi CDROM support' CONFIG_BLK_DEV_SR n bool 'Scsi CDROM support' CONFIG_BLK_DEV_SR y
bool 'Scsi generic support' CONFIG_CHR_DEV_SG y
* *
* SCSI low-level drivers * SCSI low-level drivers
* *
bool 'Adaptec AHA1542 support' CONFIG_SCSI_AHA1542 n bool 'Adaptec AHA152X support' CONFIG_SCSI_AHA152X y
bool 'Adaptec AHA1740 support' CONFIG_SCSI_AHA1740 n bool 'Adaptec AHA1542 support' CONFIG_SCSI_AHA1542 y
bool 'Future Domain SCSI support' CONFIG_SCSI_FUTURE_DOMAIN n bool 'Adaptec AHA1740 support' CONFIG_SCSI_AHA1740 y
bool 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE n bool 'Future Domain 16xx SCSI support' CONFIG_SCSI_FUTURE_DOMAIN y
bool 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR n bool 'Generic NCR5380 SCSI support' CONFIG_SCSI_GENERIC_NCR5380 y
bool '7000FASST SCSI support' CONFIG_SCSI_7000FASST n bool 'PAS16 SCSI support' CONFIG_SCSI_PAS16 y
bool 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE y
bool 'Trantor T128/T128F/T228 SCSI support' CONFIG_SCSI_T128 y
bool 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR y
bool '7000FASST SCSI support' CONFIG_SCSI_7000FASST y
fi fi
* *
* Network device support * Network device support
* *
bool 'Network device support?' CONFIG_ETHERCARDS y bool 'Network device support?' CONFIG_ETHERCARDS n
if [ "$CONFIG_ETHERCARDS" = "n" ] if [ "$CONFIG_ETHERCARDS" = "n" ]
: :
: Skipping ethercard configuration options... : Skipping ethercard configuration options...
...@@ -52,17 +57,22 @@ if [ "$CONFIG_ETHERCARDS" = "n" ] ...@@ -52,17 +57,22 @@ if [ "$CONFIG_ETHERCARDS" = "n" ]
else else
bool 'SLIP (serial line) support' CONFIG_SLIP n bool 'SLIP (serial line) support' CONFIG_SLIP n
bool 'PLIP (parallel port) support' CONFIG_PLIP n bool 'PLIP (parallel port) support' CONFIG_PLIP n
bool 'NE2000/NE1000 support' CONFIG_NE2000 y bool 'NE2000/NE1000 support' CONFIG_NE2000 n
bool 'WD80*3 support' CONFIG_WD80x3 y bool 'WD80*3 support' CONFIG_WD80x3 y
#bool '3c501 support' CONFIG_EL1 n bool 'SMC Ultra support' CONFIG_ULTRA n
bool '3c503 support' CONFIG_EL2 y bool '3c501 support' CONFIG_EL1 n
#bool '3c509 support' CONFIG_EL3 n bool '3c503 support' CONFIG_EL2 n
bool 'HP PCLAN support' CONFIG_HPLAN y #bool '3c507 support' CONFIG_EL16 n
bool 'AT1500 and NE2100 support' CONFIG_AT1500 y bool '3c509 support' CONFIG_EL3 n
bool 'HP PCLAN support' CONFIG_HPLAN n
bool 'AT1500 and NE2100 support' CONFIG_AT1500 n
bool 'D-Link DE600 pocket adaptor support' CONFIG_DE600 n
#bool 'Zenith Z-Note support' CONFIG_ZNET n
#bool 'EtherExpress support' CONFIG_EEXPRESS n
#bool 'DEPCA support' CONFIG_DEPCA n #bool 'DEPCA support' CONFIG_DEPCA n
bool 'D-Link DE600 pocket adaptor support' CONFIG_DE600 y #bool 'NI52** support' CONFIG_NI52 n
#bool 'NI65** support' CONFIG_NI65 n
#bool 'AT-LAN-TEC pocket adaptor support' CONFIG_ATP n #bool 'AT-LAN-TEC pocket adaptor support' CONFIG_ATP n
#bool 'EtherExpress support' CONFIG_EEXPRESS n
fi fi
* *
bool 'Sony CDU31A CDROM driver support' CONFIG_CDU31A n bool 'Sony CDU31A CDROM driver support' CONFIG_CDU31A n
...@@ -82,11 +92,12 @@ bool 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS n ...@@ -82,11 +92,12 @@ bool 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS n
* character devices * character devices
* *
bool 'Keyboard meta-key sends ESC-prefix' CONFIG_KBD_META y bool 'Keyboard meta-key sends ESC-prefix' CONFIG_KBD_META y
bool 'Keyboard Num Lock on by default' CONFIG_KBD_NUML y bool 'Keyboard Num Lock on by default' CONFIG_KBD_NUML n
bool 'Logitech busmouse support' CONFIG_BUSMOUSE y bool 'Parallel printer support' CONFIG_PRINTER y
bool 'QuickPort mouse support' CONFIG_QUICKPORT_MOUSE y bool 'Logitech busmouse support' CONFIG_BUSMOUSE n
bool 'QuickPort mouse support' CONFIG_QUICKPORT_MOUSE n
if [ "$CONFIG_QUICKPORT_MOUSE" = "n" ] if [ "$CONFIG_QUICKPORT_MOUSE" = "n" ]
bool 'PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE n bool 'PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE y
fi fi
bool 'Microsoft busmouse support' CONFIG_MS_BUSMOUSE n bool 'Microsoft busmouse support' CONFIG_MS_BUSMOUSE n
bool 'ATIXL busmouse support' CONFIG_ATIXL_BUSMOUSE n bool 'ATIXL busmouse support' CONFIG_ATIXL_BUSMOUSE n
...@@ -102,5 +113,5 @@ bool 'Sound card support (distributed separately)' CONFIG_SOUND n ...@@ -102,5 +113,5 @@ bool 'Sound card support (distributed separately)' CONFIG_SOUND n
bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC n bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC n
bool 'Kernel profiling support' CONFIG_PROFILE n bool 'Kernel profiling support' CONFIG_PROFILE n
if [ "$CONFIG_SCSI" = "y" ] if [ "$CONFIG_SCSI" = "y" ]
bool 'Verbose scsi error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS n bool 'Verbose scsi error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS y
fi fi
...@@ -15,11 +15,7 @@ CFLAGS := $(CFLAGS) -DPARANOID $(DEBUG) -fno-builtin ...@@ -15,11 +15,7 @@ CFLAGS := $(CFLAGS) -DPARANOID $(DEBUG) -fno-builtin
.s.o: .s.o:
$(CC) -c $< $(CC) -c $<
OBJS = fpu_entry.o OBJS = fpu_entry.o div_small.o errors.o \
ifdef CONFIG_MATH_EMULATION
OBJS := $(OBJS) div_small.o errors.o \
fpu_arith.o fpu_aux.o fpu_etc.o fpu_trig.o \ fpu_arith.o fpu_aux.o fpu_etc.o fpu_trig.o \
load_store.o get_address.o \ load_store.o get_address.o \
poly_atan.o poly_l2.o poly_2xm1.o poly_sin.o poly_tan.o \ poly_atan.o poly_l2.o poly_2xm1.o poly_sin.o poly_tan.o \
...@@ -30,8 +26,6 @@ OBJS := $(OBJS) div_small.o errors.o \ ...@@ -30,8 +26,6 @@ OBJS := $(OBJS) div_small.o errors.o \
reg_round.o \ reg_round.o \
wm_shrx.o wm_sqrt.o wm_shrx.o wm_sqrt.o
endif
math.a: $(OBJS) math.a: $(OBJS)
rm -f math.a rm -f math.a
$(AR) rcs math.a $(OBJS) $(AR) rcs math.a $(OBJS)
......
...@@ -23,10 +23,6 @@ ...@@ -23,10 +23,6 @@
| math_emulate() is the sole entry point for wm-FPU-emu | | math_emulate() is the sole entry point for wm-FPU-emu |
+---------------------------------------------------------------------------*/ +---------------------------------------------------------------------------*/
#include <linux/config.h>
#ifdef CONFIG_MATH_EMULATION
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/segment.h> #include <linux/segment.h>
...@@ -607,18 +603,3 @@ void __math_abort(struct info * info, unsigned int signal) ...@@ -607,18 +603,3 @@ void __math_abort(struct info * info, unsigned int signal)
printk("ERROR: wm-FPU-emu math_abort failed!\n"); printk("ERROR: wm-FPU-emu math_abort failed!\n");
#endif PARANOID #endif PARANOID
} }
#else /* no math emulation */
#include <linux/signal.h>
#include <linux/sched.h>
asmlinkage void math_emulate(long arg)
{
printk("math-emulation not enabled and no coprocessor found.\n");
printk("killing %s.\n",current->comm);
send_sig(SIGFPE,current,1);
schedule();
}
#endif /* CONFIG_MATH_EMULATION */
...@@ -34,7 +34,7 @@ _mul64: ...@@ -34,7 +34,7 @@ _mul64:
movl (%esi),%eax movl (%esi),%eax
mull (%ecx) mull (%ecx)
movl %eax,-16(%ebp) // Not used movl %eax,-16(%ebp) /* Not used */
movl %edx,-12(%ebp) movl %edx,-12(%ebp)
movl (%esi),%eax movl (%esi),%eax
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "fpu_asm.h" #include "fpu_asm.h"
// #define EXTRA_PRECISE // Do not use: not complete /* #define EXTRA_PRECISE Do not use: not complete */
#define TERM_SIZE $8 #define TERM_SIZE $8
#define SUM_MS -20(%ebp) /* sum ms long */ #define SUM_MS -20(%ebp) /* sum ms long */
...@@ -45,16 +45,16 @@ _polynomial: ...@@ -45,16 +45,16 @@ _polynomial:
pushl %edi pushl %edi
pushl %ebx pushl %ebx
movl PARAM2,%esi // x movl PARAM2,%esi /* x */
movl PARAM3,%edi // terms movl PARAM3,%edi /* terms */
movl TERM_SIZE,%eax movl TERM_SIZE,%eax
mull PARAM4 // n mull PARAM4 /* n */
addl %eax,%edi addl %eax,%edi
movl 4(%edi),%edx // terms[n] movl 4(%edi),%edx /* terms[n] */
movl %edx,SUM_MS movl %edx,SUM_MS
movl (%edi),%edx // terms[n] movl (%edi),%edx /* terms[n] */
movl %edx,SUM_MIDDLE movl %edx,SUM_MIDDLE
xor %eax,%eax xor %eax,%eax
movl %eax,SUM_LS movl %eax,SUM_LS
...@@ -69,41 +69,43 @@ L_accum_loop: ...@@ -69,41 +69,43 @@ L_accum_loop:
movl %eax,ACCUM_MIDDLE movl %eax,ACCUM_MIDDLE
movl SUM_MIDDLE,%eax movl SUM_MIDDLE,%eax
mull (%esi) // x ls long mull (%esi) /* x ls long */
// movl %eax,-16(%ebp) // Not needed /* movl %eax,-16(%ebp) Not needed */
movl %edx,ACCUM_LS movl %edx,ACCUM_LS
movl SUM_MIDDLE,%eax movl SUM_MIDDLE,%eax
mull 4(%esi) // x ms long mull 4(%esi) /* x ms long */
addl %eax,ACCUM_LS addl %eax,ACCUM_LS
adcl %edx,ACCUM_MIDDLE adcl %edx,ACCUM_MIDDLE
adcl $0,ACCUM_MS adcl $0,ACCUM_MS
movl SUM_MS,%eax movl SUM_MS,%eax
mull (%esi) // x ls long mull (%esi) /* x ls long */
addl %eax,ACCUM_LS addl %eax,ACCUM_LS
adcl %edx,ACCUM_MIDDLE adcl %edx,ACCUM_MIDDLE
adcl $0,ACCUM_MS adcl $0,ACCUM_MS
movl SUM_MS,%eax movl SUM_MS,%eax
mull 4(%esi) // x ms long mull 4(%esi) /* x ms long */
addl %eax,ACCUM_MIDDLE addl %eax,ACCUM_MIDDLE
adcl %edx,ACCUM_MS adcl %edx,ACCUM_MS
// Now put the sum of next term and the accumulator /*
// into the sum register * Now put the sum of next term and the accumulator
* into the sum register
*/
movl ACCUM_MIDDLE,%eax movl ACCUM_MIDDLE,%eax
addl (%edi),%eax // term ls long addl (%edi),%eax /* term ls long */
movl %eax,SUM_MIDDLE movl %eax,SUM_MIDDLE
movl ACCUM_MS,%eax movl ACCUM_MS,%eax
adcl 4(%edi),%eax // term ms long adcl 4(%edi),%eax /* term ms long */
movl %eax,SUM_MS movl %eax,SUM_MS
#ifdef EXTRA_PRECISE #ifdef EXTRA_PRECISE
movl ACCUM_LS,%eax movl ACCUM_LS,%eax
movl %eax,SUM_LS movl %eax,SUM_LS
#else #else
testb $0x80,ACCUM_LS_HI // ms bit of ACCUM_LS testb $0x80,ACCUM_LS_HI /* ms bit of ACCUM_LS */
je L_no_poly_round je L_no_poly_round
addl $1,SUM_MIDDLE addl $1,SUM_MIDDLE
...@@ -126,7 +128,7 @@ L_accum_done: ...@@ -126,7 +128,7 @@ L_accum_done:
#endif EXTRA_PRECISE #endif EXTRA_PRECISE
L_poly_done: L_poly_done:
movl PARAM1,%edi // accum movl PARAM1,%edi /* accum */
movl SUM_MIDDLE,%eax movl SUM_MIDDLE,%eax
movl %eax,(%edi) movl %eax,(%edi)
movl SUM_MS,%eax movl SUM_MS,%eax
......
...@@ -36,10 +36,10 @@ _reg_div: ...@@ -36,10 +36,10 @@ _reg_div:
movb TAG(%esi),%al movb TAG(%esi),%al
orb TAG(%ebx),%al orb TAG(%ebx),%al
jne L_div_special // Not (both numbers TW_Valid) jne L_div_special /* Not (both numbers TW_Valid) */
#ifdef DENORM_OPERAND #ifdef DENORM_OPERAND
// Check for denormals /* Check for denormals */
cmpl EXP_UNDER,EXP(%esi) cmpl EXP_UNDER,EXP(%esi)
jg xL_arg1_not_denormal jg xL_arg1_not_denormal
...@@ -58,12 +58,12 @@ xL_arg1_not_denormal: ...@@ -58,12 +58,12 @@ xL_arg1_not_denormal:
xL_arg2_not_denormal: xL_arg2_not_denormal:
#endif DENORM_OPERAND #endif DENORM_OPERAND
// Both arguments are TW_Valid /* Both arguments are TW_Valid */
movb TW_Valid,TAG(%edi) movb TW_Valid,TAG(%edi)
movb SIGN(%esi),%cl movb SIGN(%esi),%cl
cmpb %cl,SIGN(%ebx) cmpb %cl,SIGN(%ebx)
setne (%edi) // Set the sign, requires SIGN_NEG=1, SIGN_POS=0 setne (%edi) /* Set the sign, requires SIGN_NEG=1, SIGN_POS=0 */
movl EXP(%esi),%edx movl EXP(%esi),%edx
movl EXP(%ebx),%eax movl EXP(%ebx),%eax
...@@ -76,27 +76,27 @@ xL_arg2_not_denormal: ...@@ -76,27 +76,27 @@ xL_arg2_not_denormal:
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
L_div_special: L_div_special:
cmpb TW_NaN,TAG(%esi) // A NaN with anything to give NaN cmpb TW_NaN,TAG(%esi) /* A NaN with anything to give NaN */
je L_arg1_NaN je L_arg1_NaN
cmpb TW_NaN,TAG(%ebx) // A NaN with anything to give NaN cmpb TW_NaN,TAG(%ebx) /* A NaN with anything to give NaN */
jne L_no_NaN_arg jne L_no_NaN_arg
// Operations on NaNs /* Operations on NaNs */
L_arg1_NaN: L_arg1_NaN:
L_arg2_NaN: L_arg2_NaN:
pushl %edi // Destination pushl %edi /* Destination */
// pushl %ebx /* pushl %ebx */
pushl %esi pushl %esi
pushl %ebx // Ordering is important here pushl %ebx /* Ordering is important here */
call _real_2op_NaN call _real_2op_NaN
jmp LDiv_exit jmp LDiv_exit
// Invalid operations /* Invalid operations */
L_zero_zero: L_zero_zero:
L_inf_inf: L_inf_inf:
pushl %edi // Destination pushl %edi /* Destination */
call _arith_invalid // 0/0 or Infinity/Infinity call _arith_invalid /* 0/0 or Infinity/Infinity */
jmp LDiv_exit jmp LDiv_exit
L_no_NaN_arg: L_no_NaN_arg:
...@@ -104,50 +104,50 @@ L_no_NaN_arg: ...@@ -104,50 +104,50 @@ L_no_NaN_arg:
jne L_arg1_not_inf jne L_arg1_not_inf
cmpb TW_Infinity,TAG(%ebx) cmpb TW_Infinity,TAG(%ebx)
je L_inf_inf // invalid operation je L_inf_inf /* invalid operation */
cmpb TW_Valid,TAG(%ebx) cmpb TW_Valid,TAG(%ebx)
je L_inf_valid je L_inf_valid
#ifdef PARANOID #ifdef PARANOID
// arg2 must be zero or valid /* arg2 must be zero or valid */
cmpb TW_Zero,TAG(%ebx) cmpb TW_Zero,TAG(%ebx)
ja L_unknown_tags ja L_unknown_tags
#endif PARANOID #endif PARANOID
// Note that p16-9 says that infinity/0 returns infinity /* Note that p16-9 says that infinity/0 returns infinity */
jmp L_copy_arg1 // Answer is Inf jmp L_copy_arg1 /* Answer is Inf */
L_inf_valid: L_inf_valid:
#ifdef DENORM_OPERAND #ifdef DENORM_OPERAND
cmpl EXP_UNDER,EXP(%ebx) cmpl EXP_UNDER,EXP(%ebx)
jg L_copy_arg1 // Answer is Inf jg L_copy_arg1 /* Answer is Inf */
call _denormal_operand call _denormal_operand
orl %eax,%eax orl %eax,%eax
jnz FPU_Arith_exit jnz FPU_Arith_exit
#endif DENORM_OPERAND #endif DENORM_OPERAND
jmp L_copy_arg1 // Answer is Inf jmp L_copy_arg1 /* Answer is Inf */
L_arg1_not_inf: L_arg1_not_inf:
cmpb TW_Zero,TAG(%ebx) // Priority to div-by-zero error cmpb TW_Zero,TAG(%ebx) /* Priority to div-by-zero error */
jne L_arg2_not_zero jne L_arg2_not_zero
cmpb TW_Zero,TAG(%esi) cmpb TW_Zero,TAG(%esi)
je L_zero_zero // invalid operation je L_zero_zero /* invalid operation */
#ifdef PARANOID #ifdef PARANOID
// arg1 must be valid /* arg1 must be valid */
cmpb TW_Valid,TAG(%esi) cmpb TW_Valid,TAG(%esi)
ja L_unknown_tags ja L_unknown_tags
#endif PARANOID #endif PARANOID
// Division by zero error /* Division by zero error */
pushl %edi // destination pushl %edi /* destination */
movb SIGN(%esi),%al movb SIGN(%esi),%al
xorb SIGN(%ebx),%al xorb SIGN(%ebx),%al
pushl %eax // lower 8 bits have the sign pushl %eax /* lower 8 bits have the sign */
call _divide_by_zero call _divide_by_zero
jmp LDiv_exit jmp LDiv_exit
...@@ -160,14 +160,14 @@ L_arg2_not_zero: ...@@ -160,14 +160,14 @@ L_arg2_not_zero:
jne L_return_zero jne L_return_zero
cmpl EXP_UNDER,EXP(%esi) cmpl EXP_UNDER,EXP(%esi)
jg L_return_zero // Answer is zero jg L_return_zero /* Answer is zero */
call _denormal_operand call _denormal_operand
orl %eax,%eax orl %eax,%eax
jnz FPU_Arith_exit jnz FPU_Arith_exit
#endif DENORM_OPERAND #endif DENORM_OPERAND
jmp L_return_zero // Answer is zero jmp L_return_zero /* Answer is zero */
L_arg2_not_inf: L_arg2_not_inf:
...@@ -176,11 +176,11 @@ L_arg2_not_inf: ...@@ -176,11 +176,11 @@ L_arg2_not_inf:
jne L_unknown_tags jne L_unknown_tags
#endif PARANOID #endif PARANOID
// arg1 is zero, arg2 is not Infinity or a NaN /* arg1 is zero, arg2 is not Infinity or a NaN */
#ifdef DENORM_OPERAND #ifdef DENORM_OPERAND
cmpl EXP_UNDER,EXP(%ebx) cmpl EXP_UNDER,EXP(%ebx)
jg L_copy_arg1 // Answer is zero jg L_copy_arg1 /* Answer is zero */
call _denormal_operand call _denormal_operand
orl %eax,%eax orl %eax,%eax
...@@ -203,12 +203,12 @@ LDiv_set_result_sign: ...@@ -203,12 +203,12 @@ LDiv_set_result_sign:
jne LDiv_negative_result jne LDiv_negative_result
movb SIGN_POS,SIGN(%edi) movb SIGN_POS,SIGN(%edi)
xorl %eax,%eax // Valid result xorl %eax,%eax /* Valid result */
jmp LDiv_exit jmp LDiv_exit
LDiv_negative_result: LDiv_negative_result:
movb SIGN_NEG,SIGN(%edi) movb SIGN_NEG,SIGN(%edi)
xorl %eax,%eax // Valid result xorl %eax,%eax /* Valid result */
LDiv_exit: LDiv_exit:
leal -12(%ebp),%esp leal -12(%ebp),%esp
...@@ -233,12 +233,12 @@ L_unknown_tags: ...@@ -233,12 +233,12 @@ L_unknown_tags:
push EX_INTERNAL | 0x208 push EX_INTERNAL | 0x208
call EXCEPTION call EXCEPTION
// Generate a NaN for unknown tags /* Generate a NaN for unknown tags */
movl _CONST_QNaN,%eax movl _CONST_QNaN,%eax
movl %eax,(%edi) movl %eax,(%edi)
movl _CONST_QNaN+4,%eax movl _CONST_QNaN+4,%eax
movl %eax,SIGL(%edi) movl %eax,SIGL(%edi)
movl _CONST_QNaN+8,%eax movl _CONST_QNaN+8,%eax
movl %eax,SIGH(%edi) movl %eax,SIGH(%edi)
jmp LDiv_exit // %eax is nz jmp LDiv_exit /* %eax is nz */
#endif PARANOID #endif PARANOID
...@@ -32,17 +32,17 @@ _normalize: ...@@ -32,17 +32,17 @@ _normalize:
movl SIGH(%ebx),%edx movl SIGH(%ebx),%edx
movl SIGL(%ebx),%eax movl SIGL(%ebx),%eax
orl %edx,%edx // ms bits orl %edx,%edx /* ms bits */
js L_done // Already normalized js L_done /* Already normalized */
jnz L_shift_1 // Shift left 1 - 31 bits jnz L_shift_1 /* Shift left 1 - 31 bits */
orl %eax,%eax orl %eax,%eax
jz L_zero // The contents are zero jz L_zero /* The contents are zero */
// L_shift_32: /* L_shift_32: */
movl %eax,%edx movl %eax,%edx
xorl %eax,%eax xorl %eax,%eax
subl $32,EXP(%ebx) // This can cause an underflow subl $32,EXP(%ebx) /* This can cause an underflow */
/* We need to shift left by 1 - 31 bits */ /* We need to shift left by 1 - 31 bits */
L_shift_1: L_shift_1:
...@@ -51,7 +51,7 @@ L_shift_1: ...@@ -51,7 +51,7 @@ L_shift_1:
negl %ecx negl %ecx
shld %cl,%eax,%edx shld %cl,%eax,%edx
shl %cl,%eax shl %cl,%eax
subl %ecx,EXP(%ebx) // This can cause an underflow subl %ecx,EXP(%ebx) /* This can cause an underflow */
movl %edx,SIGH(%ebx) movl %edx,SIGH(%ebx)
movl %eax,SIGL(%ebx) movl %eax,SIGL(%ebx)
...@@ -88,7 +88,7 @@ L_overflow: ...@@ -88,7 +88,7 @@ L_overflow:
// Normalise without reporting underflow or overflow /* Normalise without reporting underflow or overflow */
.align 2,144 .align 2,144
.globl _normalize_nuo .globl _normalize_nuo
...@@ -102,17 +102,17 @@ _normalize_nuo: ...@@ -102,17 +102,17 @@ _normalize_nuo:
movl SIGH(%ebx),%edx movl SIGH(%ebx),%edx
movl SIGL(%ebx),%eax movl SIGL(%ebx),%eax
orl %edx,%edx // ms bits orl %edx,%edx /* ms bits */
js L_exit // Already normalized js L_exit /* Already normalized */
jnz L_nuo_shift_1 // Shift left 1 - 31 bits jnz L_nuo_shift_1 /* Shift left 1 - 31 bits */
orl %eax,%eax orl %eax,%eax
jz L_zero // The contents are zero jz L_zero /* The contents are zero */
// L_nuo_shift_32: /* L_nuo_shift_32: */
movl %eax,%edx movl %eax,%edx
xorl %eax,%eax xorl %eax,%eax
subl $32,EXP(%ebx) // This can cause an underflow subl $32,EXP(%ebx) /* This can cause an underflow */
/* We need to shift left by 1 - 31 bits */ /* We need to shift left by 1 - 31 bits */
L_nuo_shift_1: L_nuo_shift_1:
...@@ -121,7 +121,7 @@ L_nuo_shift_1: ...@@ -121,7 +121,7 @@ L_nuo_shift_1:
negl %ecx negl %ecx
shld %cl,%eax,%edx shld %cl,%eax,%edx
shl %cl,%eax shl %cl,%eax
subl %ecx,EXP(%ebx) // This can cause an underflow subl %ecx,EXP(%ebx) /* This can cause an underflow */
movl %edx,SIGH(%ebx) movl %edx,SIGH(%ebx)
movl %eax,SIGL(%ebx) movl %eax,SIGL(%ebx)
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
_reg_u_add: _reg_u_add:
pushl %ebp pushl %ebp
movl %esp,%ebp movl %esp,%ebp
// subl $16,%esp /* subl $16,%esp */
pushl %esi pushl %esi
pushl %edi pushl %edi
pushl %ebx pushl %ebx
...@@ -61,10 +61,10 @@ xOp1_not_denorm: ...@@ -61,10 +61,10 @@ xOp1_not_denorm:
xOp2_not_denorm: xOp2_not_denorm:
#endif DENORM_OPERAND #endif DENORM_OPERAND
// xorl %ecx,%ecx /* xorl %ecx,%ecx */
movl EXP(%esi),%ecx movl EXP(%esi),%ecx
subl EXP(%edi),%ecx /* exp1 - exp2 */ subl EXP(%edi),%ecx /* exp1 - exp2 */
// jnc L_arg1_larger /* jnc L_arg1_larger */
jge L_arg1_larger jge L_arg1_larger
/* num1 is smaller */ /* num1 is smaller */
...@@ -82,8 +82,8 @@ L_arg1_larger: ...@@ -82,8 +82,8 @@ L_arg1_larger:
L_accum_loaded: L_accum_loaded:
movl PARAM3,%edi /* destination */ movl PARAM3,%edi /* destination */
// movb SIGN(%esi),%dl /* movb SIGN(%esi),%dl */
// movb %dl,SIGN(%edi) /* Copy the sign from the first arg */ /* movb %dl,SIGN(%edi) */ /* Copy the sign from the first arg */
movl EXP(%esi),%edx movl EXP(%esi),%edx
...@@ -99,7 +99,7 @@ L_accum_loaded: ...@@ -99,7 +99,7 @@ L_accum_loaded:
je L_bugged je L_bugged
#endif PARANOID #endif PARANOID
// The number to be shifted is in %eax:%ebx:%edx /* The number to be shifted is in %eax:%ebx:%edx */
cmpw $32,%cx /* shrd only works for 0..31 bits */ cmpw $32,%cx /* shrd only works for 0..31 bits */
jnc L_more_than_31 jnc L_more_than_31
...@@ -119,9 +119,9 @@ L_more_than_31: ...@@ -119,9 +119,9 @@ L_more_than_31:
shrd %cl,%eax,%edx shrd %cl,%eax,%edx
shr %cl,%eax shr %cl,%eax
orl %ebx,%ebx orl %ebx,%ebx
jz L_more_31_no_low // none of the lowest bits is set jz L_more_31_no_low /* none of the lowest bits is set */
orl $1,%edx // record the fact in the extension orl $1,%edx /* record the fact in the extension */
L_more_31_no_low: L_more_31_no_low:
movl %eax,%ebx movl %eax,%ebx
...@@ -146,7 +146,7 @@ L_more_than_63: ...@@ -146,7 +146,7 @@ L_more_than_63:
jmp L_more_63_no_low jmp L_more_63_no_low
L_more_than_64: L_more_than_64:
movl $1,%edx // The shifted nr always at least one '1' movl $1,%edx /* The shifted nr always at least one '1' */
L_more_63_no_low: L_more_63_no_low:
xorl %ebx,%ebx xorl %ebx,%ebx
...@@ -170,7 +170,7 @@ L_no_bit_lost: ...@@ -170,7 +170,7 @@ L_no_bit_lost:
incl EXP(%edi) incl EXP(%edi)
L_round_the_result: L_round_the_result:
jmp FPU_round // Round the result jmp FPU_round /* Round the result */
......
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
#include "control_w.h" #include "control_w.h"
// #define dSIGL(x) (x) /* #define dSIGL(x) (x) */
// #define dSIGH(x) 4(x) /* #define dSIGH(x) 4(x) */
.data .data
...@@ -94,9 +94,9 @@ xOp2_not_denorm: ...@@ -94,9 +94,9 @@ xOp2_not_denorm:
_divide_kernel: _divide_kernel:
#ifdef PARANOID #ifdef PARANOID
// testl $0x80000000, SIGH(%esi) // Dividend /* testl $0x80000000, SIGH(%esi) // Dividend */
// je L_bugged /* je L_bugged */
testl $0x80000000, SIGH(%ebx) // Divisor testl $0x80000000, SIGH(%ebx) /* Divisor */
je L_bugged je L_bugged
#endif PARANOID #endif PARANOID
...@@ -143,7 +143,7 @@ L_no_adjust: ...@@ -143,7 +143,7 @@ L_no_adjust:
rcrl %eax rcrl %eax
L_no_overflow: L_no_overflow:
jmp LRound_precision // Do the rounding as required jmp LRound_precision /* Do the rounding as required */
/*---------------------------------------------------------------------------+ /*---------------------------------------------------------------------------+
...@@ -165,7 +165,7 @@ L_no_overflow: ...@@ -165,7 +165,7 @@ L_no_overflow:
L_Full_Division: L_Full_Division:
// Save extended dividend in local register /* Save extended dividend in local register */
movl SIGL(%esi),%eax movl SIGL(%esi),%eax
movl %eax,accum_2 movl %eax,accum_2
movl SIGH(%esi),%eax movl SIGH(%esi),%eax
...@@ -280,7 +280,7 @@ LPrevent_2nd_overflow: ...@@ -280,7 +280,7 @@ LPrevent_2nd_overflow:
#endif PARANOID #endif PARANOID
LDo_2nd_div: LDo_2nd_div:
cmpl $0,%ecx // augmented denom msw cmpl $0,%ecx /* augmented denom msw */
jnz LSecond_div_not_1 jnz LSecond_div_not_1
/* %ecx == 0, we are dividing by 1.0 */ /* %ecx == 0, we are dividing by 1.0 */
...@@ -348,11 +348,11 @@ LDo_3rd_32_bits: ...@@ -348,11 +348,11 @@ LDo_3rd_32_bits:
movl accum_0,%eax movl accum_0,%eax
/* need to check for possible subsequent overflow */ /* need to check for possible subsequent overflow */
cmpl SIGH(%ebx),%edx // denom cmpl SIGH(%ebx),%edx /* denom */
jb LRound_prep jb LRound_prep
ja LPrevent_3rd_overflow ja LPrevent_3rd_overflow
cmpl SIGL(%ebx),%eax // denom cmpl SIGL(%ebx),%eax /* denom */
jb LRound_prep jb LRound_prep
LPrevent_3rd_overflow: LPrevent_3rd_overflow:
...@@ -371,36 +371,38 @@ LPrevent_3rd_overflow: ...@@ -371,36 +371,38 @@ LPrevent_3rd_overflow:
movb $255,ovfl_flag /* Overflow -> 1.000 */ movb $255,ovfl_flag /* Overflow -> 1.000 */
LRound_prep: LRound_prep:
// Prepare for rounding. /*
// To test for rounding, we just need to compare 2*accum with the * Prepare for rounding.
// denom. * To test for rounding, we just need to compare 2*accum with the
* denom.
*/
movl accum_0,%ecx movl accum_0,%ecx
movl accum_1,%edx movl accum_1,%edx
movl %ecx,%eax movl %ecx,%eax
orl %edx,%eax orl %edx,%eax
jz LRound_ovfl // The accumulator contains zero. jz LRound_ovfl /* The accumulator contains zero. */
// Multiply by 2 /* Multiply by 2 */
clc clc
rcll $1,%ecx rcll $1,%ecx
rcll $1,%edx rcll $1,%edx
jc LRound_large // No need to compare, denom smaller jc LRound_large /* No need to compare, denom smaller */
subl SIGL(%ebx),%ecx subl SIGL(%ebx),%ecx
sbbl SIGH(%ebx),%edx sbbl SIGH(%ebx),%edx
jnc LRound_not_small jnc LRound_not_small
movl $0x70000000,%eax // Denom was larger movl $0x70000000,%eax /* Denom was larger */
jmp LRound_ovfl jmp LRound_ovfl
LRound_not_small: LRound_not_small:
jnz LRound_large jnz LRound_large
movl $0x80000000,%eax // Remainder was exactly 1/2 denom movl $0x80000000,%eax /* Remainder was exactly 1/2 denom */
jmp LRound_ovfl jmp LRound_ovfl
LRound_large: LRound_large:
movl $0xff000000,%eax // Denom was smaller movl $0xff000000,%eax /* Denom was smaller */
LRound_ovfl: LRound_ovfl:
/* We are now ready to deal with rounding, but first we must get /* We are now ready to deal with rounding, but first we must get
...@@ -411,12 +413,12 @@ LRound_ovfl: ...@@ -411,12 +413,12 @@ LRound_ovfl:
incl EXP(%edi) incl EXP(%edi)
/* shift the mantissa right one bit */ /* shift the mantissa right one bit */
stc // Will set the ms bit stc /* Will set the ms bit */
rcrl result_2 rcrl result_2
rcrl result_1 rcrl result_1
rcrl %eax rcrl %eax
// Round the result as required /* Round the result as required */
LRound_precision: LRound_precision:
decl EXP(%edi) /* binary point between 1st & 2nd bits */ decl EXP(%edi) /* binary point between 1st & 2nd bits */
......
...@@ -88,7 +88,7 @@ xOp2_not_denorm: ...@@ -88,7 +88,7 @@ xOp2_not_denorm:
mull SIGH(%edi) mull SIGH(%edi)
addl %eax,accum_1 addl %eax,accum_1
adcl %edx,%ebx adcl %edx,%ebx
// adcl $0,%ecx // overflow here is not possible /* adcl $0,%ecx // overflow here is not possible */
movl SIGH(%esi),%eax movl SIGH(%esi),%eax
mull SIGL(%edi) mull SIGL(%edi)
...@@ -104,11 +104,11 @@ xOp2_not_denorm: ...@@ -104,11 +104,11 @@ xOp2_not_denorm:
movl EXP(%esi),%eax /* Compute the exponent */ movl EXP(%esi),%eax /* Compute the exponent */
addl EXP(%edi),%eax addl EXP(%edi),%eax
subl EXP_BIAS-1,%eax subl EXP_BIAS-1,%eax
// Have now finished with the sources /* Have now finished with the sources */
movl PARAM3,%edi // Point to the destination movl PARAM3,%edi /* Point to the destination */
movl %eax,EXP(%edi) movl %eax,EXP(%edi)
// Now make sure that the result is normalized /* Now make sure that the result is normalized */
testl $0x80000000,%ecx testl $0x80000000,%ecx
jnz LResult_Normalised jnz LResult_Normalised
......
...@@ -79,16 +79,16 @@ xOp2_not_denorm: ...@@ -79,16 +79,16 @@ xOp2_not_denorm:
| Form a register holding the | | Form a register holding the |
| smaller number | | smaller number |
+--------------------------------------*/ +--------------------------------------*/
movl SIGH(%edi),%eax // register ms word movl SIGH(%edi),%eax /* register ms word */
movl SIGL(%edi),%ebx // register ls word movl SIGL(%edi),%ebx /* register ls word */
movl PARAM3,%edi /* destination */ movl PARAM3,%edi /* destination */
movl EXP(%esi),%edx movl EXP(%esi),%edx
movl %edx,EXP(%edi) /* Copy exponent to destination */ movl %edx,EXP(%edi) /* Copy exponent to destination */
// movb SIGN(%esi),%dl /* movb SIGN(%esi),%dl */
// movb %dl,SIGN(%edi) /* Copy the sign from the first arg */ /* movb %dl,SIGN(%edi) */ /* Copy the sign from the first arg */
xorl %edx,%edx // register extension xorl %edx,%edx /* register extension */
/*--------------------------------------+ /*--------------------------------------+
| Shift the temporary register | | Shift the temporary register |
...@@ -115,9 +115,9 @@ L_more_than_31: ...@@ -115,9 +115,9 @@ L_more_than_31:
shrd %cl,%eax,%edx shrd %cl,%eax,%edx
shr %cl,%eax shr %cl,%eax
orl %ebx,%ebx orl %ebx,%ebx
jz L_more_31_no_low // none of the lowest bits is set jz L_more_31_no_low /* none of the lowest bits is set */
orl $1,%edx // record the fact in the extension orl $1,%edx /* record the fact in the extension */
L_more_31_no_low: L_more_31_no_low:
movl %eax,%ebx movl %eax,%ebx
...@@ -134,7 +134,7 @@ L_more_than_63: ...@@ -134,7 +134,7 @@ L_more_than_63:
cmpw $65,%cx cmpw $65,%cx
jnc L_more_than_64 jnc L_more_than_64
// Shift right by 64 bits /* Shift right by 64 bits */
movl %eax,%edx movl %eax,%edx
orl %ebx,%ebx orl %ebx,%ebx
jz L_more_63_no_low jz L_more_63_no_low
...@@ -145,8 +145,8 @@ L_more_than_63: ...@@ -145,8 +145,8 @@ L_more_than_63:
L_more_than_64: L_more_than_64:
jne L_more_than_65 jne L_more_than_65
// Shift right by 65 bits /* Shift right by 65 bits */
// Carry is clear if we get here /* Carry is clear if we get here */
movl %eax,%edx movl %eax,%edx
rcrl %edx rcrl %edx
jnc L_shift_65_nc jnc L_shift_65_nc
...@@ -162,7 +162,7 @@ L_shift_65_nc: ...@@ -162,7 +162,7 @@ L_shift_65_nc:
jmp L_more_63_no_low jmp L_more_63_no_low
L_more_than_65: L_more_than_65:
movl $1,%edx // The shifted nr always at least one '1' movl $1,%edx /* The shifted nr always at least one '1' */
L_more_63_no_low: L_more_63_no_low:
xorl %ebx,%ebx xorl %ebx,%ebx
...@@ -200,11 +200,13 @@ L_subtr: ...@@ -200,11 +200,13 @@ L_subtr:
orl %ebx,%ebx orl %ebx,%ebx
jnz L_shift_32 /* shift left 32 - 63 bits */ jnz L_shift_32 /* shift left 32 - 63 bits */
// A rare case, the only one which is non-zero if we got here /*
// is: 1000000 .... 0000 * A rare case, the only one which is non-zero if we got here
// -0111111 .... 1111 1 * is: 1000000 .... 0000
// -------------------- * -0111111 .... 1111 1
// 0000000 .... 0000 1 * --------------------
* 0000000 .... 0000 1
*/
cmpl $0x80000000,%edx cmpl $0x80000000,%edx
jnz L_must_be_zero jnz L_must_be_zero
...@@ -225,7 +227,7 @@ L_must_be_zero: ...@@ -225,7 +227,7 @@ L_must_be_zero:
movl $0,EXP(%edi) /* exponent */ movl $0,EXP(%edi) /* exponent */
movl $0,SIGL(%edi) movl $0,SIGL(%edi)
movl $0,SIGH(%edi) movl $0,SIGH(%edi)
jmp L_exit // %eax contains zero jmp L_exit /* %eax contains zero */
L_shift_32: L_shift_32:
movl %ebx,%eax movl %ebx,%eax
...@@ -244,7 +246,7 @@ L_shift_1: ...@@ -244,7 +246,7 @@ L_shift_1:
subl %ecx,EXP(%edi) /* Can get underflow here */ subl %ecx,EXP(%edi) /* Can get underflow here */
L_round: L_round:
jmp FPU_round // Round the result jmp FPU_round /* Round the result */
#ifdef PARANOID #ifdef PARANOID
......
...@@ -46,9 +46,9 @@ _shrx: ...@@ -46,9 +46,9 @@ _shrx:
/* less than 32 bits */ /* less than 32 bits */
pushl %ebx pushl %ebx
movl (%esi),%ebx // lsl movl (%esi),%ebx /* lsl */
movl 4(%esi),%edx // msl movl 4(%esi),%edx /* msl */
xorl %eax,%eax // extension xorl %eax,%eax /* extension */
shrd %cl,%ebx,%eax shrd %cl,%ebx,%eax
shrd %cl,%edx,%ebx shrd %cl,%edx,%ebx
shr %cl,%edx shr %cl,%edx
...@@ -64,8 +64,8 @@ L_more_than_31: ...@@ -64,8 +64,8 @@ L_more_than_31:
jnc L_more_than_63 jnc L_more_than_63
subb $32,%cl subb $32,%cl
movl (%esi),%eax // lsl movl (%esi),%eax /* lsl */
movl 4(%esi),%edx // msl movl 4(%esi),%edx /* msl */
shrd %cl,%edx,%eax shrd %cl,%edx,%eax
shr %cl,%edx shr %cl,%edx
movl %edx,(%esi) movl %edx,(%esi)
...@@ -79,7 +79,7 @@ L_more_than_63: ...@@ -79,7 +79,7 @@ L_more_than_63:
jnc L_more_than_95 jnc L_more_than_95
subb $64,%cl subb $64,%cl
movl 4(%esi),%eax // msl movl 4(%esi),%eax /* msl */
shr %cl,%eax shr %cl,%eax
xorl %edx,%edx xorl %edx,%edx
movl %edx,(%esi) movl %edx,(%esi)
...@@ -131,8 +131,8 @@ _shrxs: ...@@ -131,8 +131,8 @@ _shrxs:
is for small integers */ is for small integers */
/* Shift by [32..63] bits */ /* Shift by [32..63] bits */
subb $32,%cl subb $32,%cl
movl (%esi),%eax // lsl movl (%esi),%eax /* lsl */
movl 4(%esi),%edx // msl movl 4(%esi),%edx /* msl */
xorl %ebx,%ebx xorl %ebx,%ebx
shrd %cl,%eax,%ebx shrd %cl,%eax,%ebx
shrd %cl,%edx,%eax shrd %cl,%edx,%eax
...@@ -152,9 +152,9 @@ _shrxs: ...@@ -152,9 +152,9 @@ _shrxs:
/* Shift by [0..31] bits */ /* Shift by [0..31] bits */
Ls_less_than_32: Ls_less_than_32:
movl (%esi),%ebx // lsl movl (%esi),%ebx /* lsl */
movl 4(%esi),%edx // msl movl 4(%esi),%edx /* msl */
xorl %eax,%eax // extension xorl %eax,%eax /* extension */
shrd %cl,%ebx,%eax shrd %cl,%ebx,%eax
shrd %cl,%edx,%ebx shrd %cl,%edx,%ebx
shr %cl,%edx shr %cl,%edx
...@@ -173,9 +173,9 @@ Ls_more_than_63: ...@@ -173,9 +173,9 @@ Ls_more_than_63:
jnc Ls_more_than_95 jnc Ls_more_than_95
subb $64,%cl subb $64,%cl
movl (%esi),%ebx // lsl movl (%esi),%ebx /* lsl */
movl 4(%esi),%eax // msl movl 4(%esi),%eax /* msl */
xorl %edx,%edx // extension xorl %edx,%edx /* extension */
shrd %cl,%ebx,%edx shrd %cl,%ebx,%edx
shrd %cl,%eax,%ebx shrd %cl,%eax,%ebx
shr %cl,%eax shr %cl,%eax
...@@ -186,8 +186,8 @@ Ls_more_than_63: ...@@ -186,8 +186,8 @@ Ls_more_than_63:
orw %bx,%bx orw %bx,%bx
setne %al setne %al
xorl %edx,%edx xorl %edx,%edx
movl %edx,(%esi) // set to zero movl %edx,(%esi) /* set to zero */
movl %edx,4(%esi) // set to zero movl %edx,4(%esi) /* set to zero */
popl %ebx popl %ebx
popl %esi popl %esi
leave leave
......
# #
# Makefile for the kernel character device drivers. # Makefile for the linux kernel device drivers.
# #
# Note! Dependencies are done automagically by 'make dep', which also # Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here # removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file). # unless it's something special (ie not a .c file).
# #
# Note 2! The CFLAGS definitions are now inherited from the # Note 2! The CFLAGS definitions are now in the main makefile...
# parent makes..
#
.S.s:
$(CPP) -traditional $< -o $*.s
.c.s: .c.s:
$(CC) $(CFLAGS) -S $< $(CC) $(CFLAGS) -S $<
.s.o: .s.o:
...@@ -16,28 +16,30 @@ ...@@ -16,28 +16,30 @@
.c.o: .c.o:
$(CC) $(CFLAGS) -c $< $(CC) $(CFLAGS) -c $<
SUBDIRS= sound SUBDIRS = block char net
ifdef CONFIG_MATH_EMULATION
SUBDIRS := $(SUBDIRS) FPU-emu
endif
OBJS = tty_io.o console.o keyboard.o serial.o \ ifdef CONFIG_SCSI
tty_ioctl.o pty.o lp.o vt.o mem.o mouse.o \ SUBDIRS := $(SUBDIRS) scsi
busmouse.o psaux.o msbusmouse.o atixlmouse.o \ endif
tpqic02.o defkeymap.o
all: chr_drv.a subdirs ifdef CONFIG_SOUND
SUBDIRS := $(SUBDIRS) sound
endif
chr_drv.a: $(OBJS) all: driversubdirs
$(AR) rcs chr_drv.a $(OBJS)
sync
subdirs: dummy driversubdirs: dummy
@for i in $(SUBDIRS); do (cd $$i && echo $$i && $(MAKE)) || exit; done @for i in $(SUBDIRS); do (cd $$i && echo $$i && $(MAKE)) || exit; done
clean: clean:
rm -f core *.o *.a *.s rm -f core *.o *.a *.s
for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean) || exit; done for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean); done
dep: dep:
$(CPP) -M *.c > .depend
for i in $(SUBDIRS); do (cd $$i && $(MAKE) dep) || exit; done for i in $(SUBDIRS); do (cd $$i && $(MAKE) dep) || exit; done
dummy: dummy:
...@@ -48,3 +50,4 @@ dummy: ...@@ -48,3 +50,4 @@ dummy:
ifeq (.depend,$(wildcard .depend)) ifeq (.depend,$(wildcard .depend))
include .depend include .depend
endif endif
...@@ -10,36 +10,53 @@ ...@@ -10,36 +10,53 @@
# #
.c.s: .c.s:
$(CC) $(CFLAGS) $(RAMDISK) -S $< $(CC) $(CFLAGS) -S $<
.s.o: .s.o:
$(AS) -c -o $*.o $< $(AS) -c -o $*.o $<
.c.o: .c.o:
$(CC) $(CFLAGS) $(RAMDISK) -c $< $(CC) $(CFLAGS) -c $<
SUBDIRS = scsi #
# Note : at this point, these files are compiled on all systems.
# In the future, some of these should be built conditionally.
#
OBJS = xd.o hd.o ll_rw_blk.o floppy.o ramdisk.o genhd.o cdu31a.o mcd.o OBJS := ll_rw_blk.o floppy.o ramdisk.o genhd.o
SRCS := ll_rw_blk.c floppy.c ramdisk.c genhd.c
all: blk_drv.a scsisubdirs ifdef CONFIG_CDU31A
OBJS := $(OBJS) cdu31a.o
SRCS := $(SRCS) cdu31a.c
endif
blk_drv.a: $(OBJS) ifdef CONFIG_MCD
rm -f blk_drv.a OBJS := $(OBJS) mcd.o
$(AR) rcs blk_drv.a $(OBJS) SRCS := $(SRCS) mcd.c
sync endif
scsisubdirs: dummy ifdef CONFIG_BLK_DEV_HD
@for i in $(SUBDIRS); do (cd $$i && echo $$i && $(MAKE)) || exit; done OBJS := $(OBJS) hd.o
SRCS := $(SRCS) hd.c
endif
clean: ifdef CONFIG_BLK_DEV_XD
OBJS := $(OBJS) xd.o
SRCS := $(SRCS) xd.c
endif
all: block.a
block.a: $(OBJS)
rm -f block.a
$(AR) rcs block.a $(OBJS)
sync
clean:
rm -f core *.o *.a *.s rm -f core *.o *.a *.s
for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean); done for i in $(ALL_SUBDIRS); do (cd $$i && $(MAKE) clean); done
dep: dep:
$(CPP) -M *.c > .depend $(CPP) -M $(SRCS) > .depend
for i in $(SUBDIRS); do (cd $$i && $(MAKE) dep); done
xd.o:
$(CC) $(CFLAGS) -fno-omit-frame-pointer $(RAMDISK) -c $<
dummy: dummy:
...@@ -49,4 +66,3 @@ dummy: ...@@ -49,4 +66,3 @@ dummy:
ifeq (.depend,$(wildcard .depend)) ifeq (.depend,$(wildcard .depend))
include .depend include .depend
endif endif
...@@ -59,8 +59,6 @@ ...@@ -59,8 +59,6 @@
*/ */
#include <linux/config.h>
#ifdef CONFIG_CDU31A
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/signal.h> #include <linux/signal.h>
...@@ -1702,4 +1700,3 @@ cdu31a_init(unsigned long mem_start, unsigned long mem_end) ...@@ -1702,4 +1700,3 @@ cdu31a_init(unsigned long mem_start, unsigned long mem_end)
return mem_start; return mem_start;
} }
#endif
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
* in the early extended-partition checks and added DM partitions * in the early extended-partition checks and added DM partitions
*/ */
#include <linux/config.h>
#ifdef CONFIG_BLK_DEV_HD
#define HD_IRQ 14 #define HD_IRQ 14
...@@ -29,6 +27,7 @@ ...@@ -29,6 +27,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/hdreg.h> #include <linux/hdreg.h>
#include <linux/genhd.h> #include <linux/genhd.h>
#include <linux/config.h>
#define REALLY_SLOW_IO #define REALLY_SLOW_IO
#include <asm/system.h> #include <asm/system.h>
...@@ -803,4 +802,3 @@ static int revalidate_hddisk(int dev, int maxusage) ...@@ -803,4 +802,3 @@ static int revalidate_hddisk(int dev, int maxusage)
return 0; return 0;
} }
#endif
...@@ -258,8 +258,8 @@ void ll_rw_page(int rw, int dev, int page, char * buffer) ...@@ -258,8 +258,8 @@ void ll_rw_page(int rw, int dev, int page, char * buffer)
printk("Can't page to read-only device 0x%X\n",dev); printk("Can't page to read-only device 0x%X\n",dev);
return; return;
} }
cli();
repeat: repeat:
cli();
req = request+NR_REQUEST; req = request+NR_REQUEST;
while (--req >= request) while (--req >= request)
if (req->dev<0) if (req->dev<0)
...@@ -268,9 +268,9 @@ void ll_rw_page(int rw, int dev, int page, char * buffer) ...@@ -268,9 +268,9 @@ void ll_rw_page(int rw, int dev, int page, char * buffer)
sleep_on(&wait_for_request); sleep_on(&wait_for_request);
goto repeat; goto repeat;
} }
sti();
/* fill up the request-info, and add it to the queue */ /* fill up the request-info, and add it to the queue */
req->dev = dev; req->dev = dev;
sti();
req->cmd = rw; req->cmd = rw;
req->errors = 0; req->errors = 0;
req->sector = page<<3; req->sector = page<<3;
...@@ -391,6 +391,7 @@ void ll_rw_swap_file(int rw, int dev, unsigned int *b, int nb, char *buf) ...@@ -391,6 +391,7 @@ void ll_rw_swap_file(int rw, int dev, unsigned int *b, int nb, char *buf)
for (i=0; i<nb; i++, buf += buffersize) for (i=0; i<nb; i++, buf += buffersize)
{ {
repeat: repeat:
cli();
req = request+NR_REQUEST; req = request+NR_REQUEST;
while (--req >= request) while (--req >= request)
if (req->dev<0) if (req->dev<0)
...@@ -399,8 +400,8 @@ void ll_rw_swap_file(int rw, int dev, unsigned int *b, int nb, char *buf) ...@@ -399,8 +400,8 @@ void ll_rw_swap_file(int rw, int dev, unsigned int *b, int nb, char *buf)
sleep_on(&wait_for_request); sleep_on(&wait_for_request);
goto repeat; goto repeat;
} }
req->dev = dev; req->dev = dev;
sti();
req->cmd = rw; req->cmd = rw;
req->errors = 0; req->errors = 0;
req->sector = (b[i] * buffersize) >> 9; req->sector = (b[i] * buffersize) >> 9;
......
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
(Jon Tombs <jon@robots.ox.ac.uk>) (Jon Tombs <jon@robots.ox.ac.uk>)
*/ */
#include <linux/config.h>
#ifdef CONFIG_MCD
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/signal.h> #include <linux/signal.h>
...@@ -522,6 +520,7 @@ do_mcd_request(void) ...@@ -522,6 +520,7 @@ do_mcd_request(void)
unsigned int nsect; unsigned int nsect;
repeat: repeat:
if (!(CURRENT) || CURRENT->dev < 0) return;
INIT_REQUEST; INIT_REQUEST;
dev = MINOR(CURRENT->dev); dev = MINOR(CURRENT->dev);
block = CURRENT->sector; block = CURRENT->sector;
...@@ -1193,4 +1192,3 @@ Toc[i].diskTime.min, Toc[i].diskTime.sec, Toc[i].diskTime.frame); ...@@ -1193,4 +1192,3 @@ Toc[i].diskTime.min, Toc[i].diskTime.sec, Toc[i].diskTime.frame);
return limit > 0 ? 0 : -1; return limit > 0 ? 0 : -1;
} }
#endif
...@@ -139,7 +139,8 @@ void rd_load(void) ...@@ -139,7 +139,8 @@ void rd_load(void)
*((struct minix_super_block *) bh->b_data); *((struct minix_super_block *) bh->b_data);
brelse(bh); brelse(bh);
nblocks = s.s_nzones << s.s_log_zone_size; nblocks = s.s_nzones << s.s_log_zone_size;
if (s.s_magic != MINIX_SUPER_MAGIC) { if (s.s_magic != MINIX_SUPER_MAGIC &&
s.s_magic != MINIX_SUPER_MAGIC2) {
printk("RAMDISK: trying old-style RAM image.\n"); printk("RAMDISK: trying old-style RAM image.\n");
continue; continue;
} }
......
This diff is collapsed.
# #
# Makefile for the WE8003 device driver.. # Makefile for the kernel character device drivers.
# #
# Note! Dependencies are done automagically by 'make dep', which also # Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here # removes any old dependencies. DON'T put your own dependencies here
...@@ -9,9 +9,6 @@ ...@@ -9,9 +9,6 @@
# parent makes.. # parent makes..
# #
SUBDIRS =
.c.s: .c.s:
$(CC) $(CFLAGS) -S $< $(CC) $(CFLAGS) -S $<
.s.o: .s.o:
...@@ -19,21 +16,76 @@ SUBDIRS = ...@@ -19,21 +16,76 @@ SUBDIRS =
.c.o: .c.o:
$(CC) $(CFLAGS) -c $< $(CC) $(CFLAGS) -c $<
OBJS = main.o OBJS = tty_io.o console.o keyboard.o serial.o \
tty_ioctl.o pty.o vt.o mem.o \
defkeymap.o
SRCS = tty_io.c console.c keyboard.c serial.c \
tty_ioctl.c pty.c vt.c mem.c \
defkeymap.c
ifdef CONFIG_ATIXL_BUSMOUSE
M = y
OBJS := $(OBJS) atixlmouse.o
SRCS := $(SRCS) atixlmouse.c
endif
ifdef CONFIG_BUSMOUSE
M = y
OBJS := $(OBJS) busmouse.o
SRCS := $(SRCS) busmouse.c
endif
ifdef CONFIG_PRINTER
OBJS := $(OBJS) lp.o
SRCS := $(SRCS) lp.c
endif
ifdef CONFIG_MS_BUSMOUSE
M = y
OBJS := $(OBJS) msbusmouse.o
SRCS := $(SRCS) msbusmouse.c
endif
ifdef CONFIG_QUICKPORT_MOUSE
CONFIG_PSMOUSE = CONFIG_PSMOUSE
endif
ifdef CONFIG_PSMOUSE
M = y
OBJS := $(OBJS) psaux.o
SRCS := $(SRCS) psaux.c
endif
we8003.o: $(OBJS) ifdef CONFIG_TAPE_QIC02
ld -r -o we8003.o $(OBJS) OBJS := $(OBJS) tpqic02.o
SRCS := $(SRCS) tpqic02.c
endif
clean: ifdef M
rm -f core *.o *.a tmp_make .depend OBJS := $(OBJS) mouse.o
for i in *.c;do rm -f `basename $$i .c`.s;done SRCS := $(SRCS) mouse.c
endif
all: char.a
char.a: $(OBJS)
$(AR) rcs char.a $(OBJS)
sync
defkeymap.c: defkeymap.map
./loadkeys defkeymap.map
./mktable > defkeymap.c
clean:
rm -f core *.o *.a *.s
dep: dep:
$(CPP) -M *.c > .depend $(CPP) -M $(SRCS) > .depend
@for i in $(SUBDIRS); do (cd $$i && echo $$i && $(MAKE) dep) || exit; done
dummy: dummy:
# #
# include a dependency file if one exists # include a dependency file if one exists
# #
......
...@@ -73,6 +73,7 @@ static char sel_buffer[SEL_BUFFER_SIZE] = { '\0' }; ...@@ -73,6 +73,7 @@ static char sel_buffer[SEL_BUFFER_SIZE] = { '\0' };
extern void vt_init(void); extern void vt_init(void);
extern void register_console(void (*proc)(const char *)); extern void register_console(void (*proc)(const char *));
extern void compute_shiftstate(void);
unsigned long video_num_columns; /* Number of text columns */ unsigned long video_num_columns; /* Number of text columns */
unsigned long video_num_lines; /* Number of test lines */ unsigned long video_num_lines; /* Number of test lines */
...@@ -224,9 +225,9 @@ static unsigned char * translations[] = { ...@@ -224,9 +225,9 @@ static unsigned char * translations[] = {
"\040\255\233\234\376\235\174\025\376\376\246\256\252\055\376\376" "\040\255\233\234\376\235\174\025\376\376\246\256\252\055\376\376"
"\370\361\375\376\376\346\024\371\376\376\247\257\254\253\376\250" "\370\361\375\376\376\346\024\371\376\376\247\257\254\253\376\250"
"\376\376\376\376\216\217\222\200\376\220\376\376\376\376\376\376" "\376\376\376\376\216\217\222\200\376\220\376\376\376\376\376\376"
"\376\245\376\376\376\376\231\376\235\376\376\376\232\376\376\341" "\376\245\376\376\376\376\231\376\350\376\376\376\232\376\376\341"
"\205\240\203\376\204\206\221\207\212\202\210\211\215\241\214\213" "\205\240\203\376\204\206\221\207\212\202\210\211\215\241\214\213"
"\376\244\225\242\223\376\224\366\233\227\243\226\201\376\376\230", "\376\244\225\242\223\376\224\366\355\227\243\226\201\376\376\230",
/* vt100 graphics */ /* vt100 graphics */
(unsigned char *) (unsigned char *)
"\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"
...@@ -1511,6 +1512,7 @@ void update_screen(int new_console) ...@@ -1511,6 +1512,7 @@ void update_screen(int new_console)
set_origin(fg_console); set_origin(fg_console);
set_cursor(new_console); set_cursor(new_console);
set_leds(); set_leds();
compute_shiftstate();
lock = 0; lock = 0;
} }
...@@ -1525,7 +1527,7 @@ int do_screendump(int arg) ...@@ -1525,7 +1527,7 @@ int do_screendump(int arg)
if (l) if (l)
return l; return l;
currcons = get_fs_byte(buf+1); currcons = get_fs_byte(buf+1);
if ((currcons<0) || (currcons>=NR_CONSOLES)) if ((currcons<0) || (currcons>NR_CONSOLES))
return -EIO; return -EIO;
put_fs_byte((char)(video_num_lines),buf++); put_fs_byte((char)(video_num_lines),buf++);
put_fs_byte((char)(video_num_columns),buf++); put_fs_byte((char)(video_num_columns),buf++);
...@@ -1708,7 +1710,7 @@ int set_selection(const int arg) ...@@ -1708,7 +1710,7 @@ int set_selection(const int arg)
if (obp != bp) if (obp != bp)
{ {
bp = obp; bp = obp;
*bp++ = '\n'; *bp++ = '\r';
} }
obp = bp; obp = bp;
} }
......
...@@ -5,6 +5,7 @@ keycode 2 = one exclam ...@@ -5,6 +5,7 @@ keycode 2 = one exclam
alt keycode 2 = Meta_one alt keycode 2 = Meta_one
keycode 3 = two at at keycode 3 = two at at
control keycode 3 = nul control keycode 3 = nul
shift control keycode 3 = nul
alt keycode 3 = Meta_two alt keycode 3 = Meta_two
keycode 4 = three numbersign keycode 4 = three numbersign
control keycode 4 = Escape control keycode 4 = Escape
...@@ -30,6 +31,7 @@ keycode 11 = zero parenright braceright ...@@ -30,6 +31,7 @@ keycode 11 = zero parenright braceright
alt keycode 11 = Meta_zero alt keycode 11 = Meta_zero
keycode 12 = minus underscore backslash keycode 12 = minus underscore backslash
control keycode 12 = Control_underscore control keycode 12 = Control_underscore
shift control keycode 12 = Control_underscore
alt keycode 12 = Meta_minus alt keycode 12 = Meta_minus
keycode 13 = equal plus keycode 13 = equal plus
alt keycode 13 = Meta_equal alt keycode 13 = Meta_equal
...@@ -54,7 +56,7 @@ keycode 27 = bracketright braceright asciitilde ...@@ -54,7 +56,7 @@ keycode 27 = bracketright braceright asciitilde
control keycode 27 = Control_bracketright control keycode 27 = Control_bracketright
alt keycode 27 = Meta_bracketright alt keycode 27 = Meta_bracketright
keycode 28 = Return keycode 28 = Return
alt keycode 28 = 0x080d alt keycode 28 = Meta_Control_m
keycode 29 = Control keycode 29 = Control
keycode 30 = a keycode 30 = a
keycode 31 = s keycode 31 = s
...@@ -87,6 +89,7 @@ keycode 50 = m ...@@ -87,6 +89,7 @@ keycode 50 = m
keycode 51 = comma less keycode 51 = comma less
alt keycode 51 = Meta_comma alt keycode 51 = Meta_comma
keycode 52 = period greater keycode 52 = period greater
control keycode 52 = Dead_Key_Next
alt keycode 52 = Meta_period alt keycode 52 = Meta_period
keycode 53 = slash question keycode 53 = slash question
control keycode 53 = Delete control keycode 53 = Delete
...@@ -196,13 +199,13 @@ keycode 110 = Insert ...@@ -196,13 +199,13 @@ keycode 110 = Insert
keycode 111 = Remove keycode 111 = Remove
altgr control keycode 111 = Boot altgr control keycode 111 = Boot
control alt keycode 111 = Boot control alt keycode 111 = Boot
keycode 112 = keycode 112 = Macro
keycode 113 = keycode 113 = F13
keycode 114 = keycode 114 = F14
keycode 115 = keycode 115 = Help
keycode 116 = keycode 116 = Do
keycode 117 = keycode 117 = F17
keycode 118 = keycode 118 = KP_MinPlus
keycode 119 = keycode 119 =
keycode 120 = keycode 120 =
keycode 121 = keycode 121 =
...@@ -244,3 +247,6 @@ string F23 = "" ...@@ -244,3 +247,6 @@ string F23 = ""
string F24 = "" string F24 = ""
string F25 = "" string F25 = ""
string F26 = "" string F26 = ""
string Macro = "\033[M"
string Help = ""
string Do = ""
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/lp.h> #include <linux/lp.h>
#include <linux/malloc.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/segment.h> #include <asm/segment.h>
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Copyright (C) 1991, 1992 Linus Torvalds * Copyright (C) 1991, 1992 Linus Torvalds
*/ */
#include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -11,15 +12,15 @@ ...@@ -11,15 +12,15 @@
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/mouse.h> #include <linux/mouse.h>
#include <linux/tpqic02.h> #include <linux/tpqic02.h>
#include <linux/malloc.h>
#include <linux/user.h> #include <linux/mman.h>
#include <linux/a.out.h>
#include <linux/string.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/io.h> #include <asm/io.h>
#ifdef CONFIG_SOUND
extern long soundcard_init(long mem_start); extern long soundcard_init(long mem_start);
#endif
static int read_ram(struct inode * inode, struct file * file,char * buf, int count) static int read_ram(struct inode * inode, struct file * file,char * buf, int count)
{ {
...@@ -31,51 +32,6 @@ static int write_ram(struct inode * inode, struct file * file,char * buf, int co ...@@ -31,51 +32,6 @@ static int write_ram(struct inode * inode, struct file * file,char * buf, int co
return -EIO; return -EIO;
} }
static int read_core(struct inode * inode, struct file * file,char * buf, int count)
{
unsigned long p = file->f_pos;
int read;
int count1;
char * pnt;
struct user dump;
memset(&dump, 0, sizeof(struct user));
dump.magic = CMAGIC;
dump.u_dsize = high_memory >> 12;
if (count < 0)
return -EINVAL;
if (p >= high_memory)
return 0;
if (count > high_memory - p)
count = high_memory - p;
read = 0;
if (p < sizeof(struct user) && count > 0) {
count1 = count;
if (p + count1 > sizeof(struct user))
count1 = sizeof(struct user)-p;
pnt = (char *) &dump + p;
memcpy_tofs(buf,(void *) pnt, count1);
buf += count1;
p += count1;
count -= count1;
read += count1;
}
while (p < 2*PAGE_SIZE && count > 0) {
put_fs_byte(0,buf);
buf++;
p++;
count--;
read++;
}
memcpy_tofs(buf,(void *) (p - PAGE_SIZE),count);
read += count;
file->f_pos += read;
return read;
}
static int read_mem(struct inode * inode, struct file * file,char * buf, int count) static int read_mem(struct inode * inode, struct file * file,char * buf, int count)
{ {
unsigned long p = file->f_pos; unsigned long p = file->f_pos;
...@@ -149,8 +105,8 @@ static int mmap_mem(struct inode * inode, struct file * file, ...@@ -149,8 +105,8 @@ static int mmap_mem(struct inode * inode, struct file * file,
inode->i_count++; inode->i_count++;
mpnt->vm_offset = off; mpnt->vm_offset = off;
mpnt->vm_ops = NULL; mpnt->vm_ops = NULL;
mpnt->vm_next = current->mmap; insert_vm_struct(current, mpnt);
current->mmap = mpnt; merge_segments(current->mmap, NULL, NULL);
return 0; return 0;
} }
...@@ -206,10 +162,31 @@ static int read_zero(struct inode * node,struct file * file,char * buf,int count ...@@ -206,10 +162,31 @@ static int read_zero(struct inode * node,struct file * file,char * buf,int count
static int mmap_zero(struct inode * inode, struct file * file, static int mmap_zero(struct inode * inode, struct file * file,
unsigned long addr, size_t len, int prot, unsigned long off) unsigned long addr, size_t len, int prot, unsigned long off)
{ {
struct vm_area_struct *mpnt;
if (prot & PAGE_RW) if (prot & PAGE_RW)
return -EINVAL; return -EINVAL;
if (zeromap_page_range(addr, len, prot)) if (zeromap_page_range(addr, len, prot))
return -EAGAIN; return -EAGAIN;
/*
* try to create a dummy vmm-structure so that the
* rest of the kernel knows we are here
*/
mpnt = (struct vm_area_struct *)kmalloc(sizeof(*mpnt), GFP_KERNEL);
if (!mpnt)
return 0;
mpnt->vm_task = current;
mpnt->vm_start = addr;
mpnt->vm_end = addr + len;
mpnt->vm_page_prot = prot;
mpnt->vm_share = NULL;
mpnt->vm_inode = inode;
inode->i_count++;
mpnt->vm_offset = off;
mpnt->vm_ops = NULL;
insert_vm_struct(current, mpnt);
merge_segments(current->mmap, ignoff_mergep, inode);
return 0; return 0;
} }
...@@ -330,19 +307,6 @@ static struct file_operations zero_fops = { ...@@ -330,19 +307,6 @@ static struct file_operations zero_fops = {
NULL /* no special release code */ NULL /* no special release code */
}; };
static struct file_operations core_fops = {
memory_lseek,
read_core,
NULL,
NULL, /* zero_readdir */
NULL, /* zero_select */
NULL, /* zero_ioctl */
NULL, /* zero_mmap */
NULL, /* no special open code */
NULL, /* no special release code */
NULL /* fsync */
};
static int memory_open(struct inode * inode, struct file * filp) static int memory_open(struct inode * inode, struct file * filp)
{ {
switch (MINOR(inode->i_rdev)) { switch (MINOR(inode->i_rdev)) {
...@@ -364,9 +328,6 @@ static int memory_open(struct inode * inode, struct file * filp) ...@@ -364,9 +328,6 @@ static int memory_open(struct inode * inode, struct file * filp)
case 5: case 5:
filp->f_op = &zero_fops; filp->f_op = &zero_fops;
break; break;
case 6:
filp->f_op = &core_fops;
break;
default: default:
return -ENODEV; return -ENODEV;
} }
...@@ -393,9 +354,17 @@ long chr_dev_init(long mem_start, long mem_end) ...@@ -393,9 +354,17 @@ long chr_dev_init(long mem_start, long mem_end)
if (register_chrdev(1,"mem",&memory_fops)) if (register_chrdev(1,"mem",&memory_fops))
printk("unable to get major 1 for memory devs\n"); printk("unable to get major 1 for memory devs\n");
mem_start = tty_init(mem_start); mem_start = tty_init(mem_start);
#ifdef CONFIG_PRINTER
mem_start = lp_init(mem_start); mem_start = lp_init(mem_start);
#endif
#if defined (CONFIG_BUSMOUSE) || defined (CONFIG_QUICKPORT_MOUSE) || \
defined (CONFIG_PSMOUSE) || defined (CONFIG_MS_BUSMOUSE) || \
defined (CONFIG_ATIXL_BUSMOUSE)
mem_start = mouse_init(mem_start); mem_start = mouse_init(mem_start);
#endif
#ifdef CONFIG_SOUND
mem_start = soundcard_init(mem_start); mem_start = soundcard_init(mem_start);
#endif
#if CONFIG_TAPE_QIC02 #if CONFIG_TAPE_QIC02
mem_start = tape_qic02_init(mem_start); mem_start = tape_qic02_init(mem_start);
#endif #endif
......
...@@ -1195,7 +1195,7 @@ static int set_modem_info(struct async_struct * info, unsigned int cmd, ...@@ -1195,7 +1195,7 @@ static int set_modem_info(struct async_struct * info, unsigned int cmd,
control &= ~UART_MCR_DTR; control &= ~UART_MCR_DTR;
break; break;
case TIOCMSET: case TIOCMSET:
control = (control & ~0x03) control = (control & ~(UART_MCR_RTS | UART_MCR_DTR))
| ((arg & TIOCM_RTS) ? UART_MCR_RTS : 0) | ((arg & TIOCM_RTS) ? UART_MCR_RTS : 0)
| ((arg & TIOCM_DTR) ? UART_MCR_DTR : 0); | ((arg & TIOCM_DTR) ? UART_MCR_DTR : 0);
break; break;
...@@ -1328,7 +1328,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file, ...@@ -1328,7 +1328,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
send_break(info, arg ? arg*(HZ/10) : HZ/4); send_break(info, arg ? arg*(HZ/10) : HZ/4);
return 0; return 0;
case TIOCGSOFTCAR: case TIOCGSOFTCAR:
error = verify_area(VERIFY_WRITE, (void *) arg,sizeof(unsigned int *)); error = verify_area(VERIFY_WRITE, (void *) arg,sizeof(long));
if (error) if (error)
return error; return error;
put_fs_long(C_LOCAL(tty) ? 1 : 0, put_fs_long(C_LOCAL(tty) ? 1 : 0,
...@@ -1341,7 +1341,8 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file, ...@@ -1341,7 +1341,8 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
(arg ? CLOCAL : 0)); (arg ? CLOCAL : 0));
return 0; return 0;
case TIOCMGET: case TIOCMGET:
error = verify_area(VERIFY_WRITE, (void *) arg,sizeof(unsigned int *)); error = verify_area(VERIFY_WRITE, (void *) arg,
sizeof(unsigned int));
if (error) if (error)
return error; return error;
return get_modem_info(info, (unsigned int *) arg); return get_modem_info(info, (unsigned int *) arg);
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/keyboard.h> #include <linux/keyboard.h>
#include <linux/malloc.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -620,6 +621,8 @@ void copy_to_cooked(struct tty_struct * tty) ...@@ -620,6 +621,8 @@ void copy_to_cooked(struct tty_struct * tty)
if (c == STOP_CHAR(tty)) { if (c == STOP_CHAR(tty)) {
tty->ctrl_status &= ~(TIOCPKT_START); tty->ctrl_status &= ~(TIOCPKT_START);
tty->ctrl_status |= TIOCPKT_STOP; tty->ctrl_status |= TIOCPKT_STOP;
if (tty->link)
wake_up_interruptible(&tty->link->except_q);
tty->stopped=1; tty->stopped=1;
if (tty->stop) if (tty->stop)
(tty->stop)(tty); (tty->stop)(tty);
...@@ -634,6 +637,8 @@ void copy_to_cooked(struct tty_struct * tty) ...@@ -634,6 +637,8 @@ void copy_to_cooked(struct tty_struct * tty)
tty->ctrl_status &= ~(TIOCPKT_STOP); tty->ctrl_status &= ~(TIOCPKT_STOP);
tty->ctrl_status |= TIOCPKT_START; tty->ctrl_status |= TIOCPKT_START;
tty->stopped=0; tty->stopped=0;
if (tty->link)
wake_up_interruptible(&tty->link->except_q);
if (tty->start) if (tty->start)
(tty->start)(tty); (tty->start)(tty);
if (IS_A_CONSOLE(tty->line)) { if (IS_A_CONSOLE(tty->line)) {
...@@ -1318,6 +1323,9 @@ static int tty_open(struct inode * inode, struct file * filp) ...@@ -1318,6 +1323,9 @@ static int tty_open(struct inode * inode, struct file * filp)
* process opens up a tty in packet mode, all the packet * process opens up a tty in packet mode, all the packet
* variables get cleared. Come to think of it, is anything * variables get cleared. Come to think of it, is anything
* using the packet mode at all??? - Ted, 1/27/93 * using the packet mode at all??? - Ted, 1/27/93
*
* Not to worry, a pty master can only be opened once.
* And rlogind and telnetd both use packet mode. -- jrs
*/ */
tty->ctrl_status = 0; tty->ctrl_status = 0;
tty->packet = 0; tty->packet = 0;
...@@ -1400,8 +1408,7 @@ static int tty_select(struct inode * inode, struct file * filp, int sel_type, se ...@@ -1400,8 +1408,7 @@ static int tty_select(struct inode * inode, struct file * filp, int sel_type, se
} }
/* see if the status byte can be read. */ /* see if the status byte can be read. */
if (tty->packet && tty->link && if (tty->packet && tty->link && tty->link->ctrl_status)
tty->link->status_changed)
return 1; return 1;
select_wait(&tty->secondary.proc_list, wait); select_wait(&tty->secondary.proc_list, wait);
...@@ -1417,11 +1424,15 @@ static int tty_select(struct inode * inode, struct file * filp, int sel_type, se ...@@ -1417,11 +1424,15 @@ static int tty_select(struct inode * inode, struct file * filp, int sel_type, se
if ((tty->flags & (1 << TTY_SLAVE_OPENED)) if ((tty->flags & (1 << TTY_SLAVE_OPENED))
&& tty->link->count <= 1) && tty->link->count <= 1)
return 1; return 1;
if (tty->packet
&& tty->link->ctrl_status)
return 1;
} else { } else {
if (!tty->link->count) if (!tty->link->count)
return 1; return 1;
} }
} }
select_wait(&tty->except_q, wait);
return 0; return 0;
} }
return 0; return 0;
...@@ -1591,6 +1602,7 @@ static void initialize_tty_struct(int line, struct tty_struct *tty) ...@@ -1591,6 +1602,7 @@ static void initialize_tty_struct(int line, struct tty_struct *tty)
} else if IS_A_PTY(line) { } else if IS_A_PTY(line) {
tty->open = pty_open; tty->open = pty_open;
} }
tty->except_q = NULL;
} }
static void initialize_termios(int line, struct termios * tp) static void initialize_termios(int line, struct termios * tp)
......
...@@ -52,6 +52,8 @@ static void flush(struct tty_queue * queue) ...@@ -52,6 +52,8 @@ static void flush(struct tty_queue * queue)
void flush_input(struct tty_struct * tty) void flush_input(struct tty_struct * tty)
{ {
tty->ctrl_status |= TIOCPKT_FLUSHREAD; tty->ctrl_status |= TIOCPKT_FLUSHREAD;
if (tty->link)
wake_up_interruptible(&tty->link->except_q);
flush(&tty->read_q); flush(&tty->read_q);
wake_up_interruptible(&tty->read_q.proc_list); wake_up_interruptible(&tty->read_q.proc_list);
flush(&tty->secondary); flush(&tty->secondary);
...@@ -66,6 +68,8 @@ void flush_input(struct tty_struct * tty) ...@@ -66,6 +68,8 @@ void flush_input(struct tty_struct * tty)
void flush_output(struct tty_struct * tty) void flush_output(struct tty_struct * tty)
{ {
tty->ctrl_status |= TIOCPKT_FLUSHWRITE; tty->ctrl_status |= TIOCPKT_FLUSHWRITE;
if (tty->link)
wake_up_interruptible(&tty->link->except_q);
flush(&tty->write_q); flush(&tty->write_q);
wake_up_interruptible(&tty->write_q.proc_list); wake_up_interruptible(&tty->write_q.proc_list);
if ((tty = tty->link) != NULL) { if ((tty = tty->link) != NULL) {
...@@ -202,17 +206,23 @@ static int set_termios(struct tty_struct * tty, struct termios * termios, ...@@ -202,17 +206,23 @@ static int set_termios(struct tty_struct * tty, struct termios * termios,
(tty->termios->c_cc[VSTART] == '\021'); (tty->termios->c_cc[VSTART] == '\021');
if (old_flow != new_flow) { if (old_flow != new_flow) {
tty->ctrl_status &= ~(TIOCPKT_DOSTOP|TIOCPKT_NOSTOP); tty->ctrl_status &= ~(TIOCPKT_DOSTOP|TIOCPKT_NOSTOP);
if (new_flow) if (new_flow)
tty->ctrl_status |= TIOCPKT_DOSTOP; tty->ctrl_status |= TIOCPKT_DOSTOP;
else else
tty->ctrl_status |= TIOCPKT_NOSTOP; tty->ctrl_status |= TIOCPKT_NOSTOP;
if (tty->link)
wake_up_interruptible(&tty->link->except_q);
} }
#if 0
/* puting mpty's into echo mode is very bad, and I think under /* puting mpty's into echo mode is very bad, and I think under
some situations can cause the kernel to do nothing but some situations can cause the kernel to do nothing but
copy characters back and forth. -RAB */ copy characters back and forth. -RAB */
/* This can no longer happen because a set_termios is redirected
to the pty slave. -- jrs */
if (IS_A_PTY_MASTER(channel)) tty->termios->c_lflag &= ~ECHO; if (IS_A_PTY_MASTER(channel)) tty->termios->c_lflag &= ~ECHO;
#endif
unset_locked_termios(tty->termios, &old_termios, unset_locked_termios(tty->termios, &old_termios,
termios_locked[tty->line]); termios_locked[tty->line]);
...@@ -283,14 +293,15 @@ static int set_termio(struct tty_struct * tty, struct termio * termio, ...@@ -283,14 +293,15 @@ static int set_termio(struct tty_struct * tty, struct termio * termio,
(tty->termios->c_cc[VSTART] == '\021'); (tty->termios->c_cc[VSTART] == '\021');
if (old_flow != new_flow) { if (old_flow != new_flow) {
tty->ctrl_status &= ~(TIOCPKT_DOSTOP|TIOCPKT_NOSTOP); tty->ctrl_status &= ~(TIOCPKT_DOSTOP|TIOCPKT_NOSTOP);
if (new_flow) if (new_flow)
tty->ctrl_status |= TIOCPKT_DOSTOP; tty->ctrl_status |= TIOCPKT_DOSTOP;
else else
tty->ctrl_status |= TIOCPKT_NOSTOP; tty->ctrl_status |= TIOCPKT_NOSTOP;
if (tty->link)
wake_up_interruptible(&tty->link->except_q);
} }
unset_locked_termios(tty->termios, &old_termios, unset_locked_termios(tty->termios, &old_termios,
termios_locked[tty->line]); termios_locked[tty->line]);
...@@ -611,20 +622,14 @@ int tty_ioctl(struct inode * inode, struct file * file, ...@@ -611,20 +622,14 @@ int tty_ioctl(struct inode * inode, struct file * file,
return set_lcktrmios(tty, (struct termios *) arg, return set_lcktrmios(tty, (struct termios *) arg,
termios_dev); termios_dev);
case TIOCPKT: case TIOCPKT:
{ if (!IS_A_PTY_MASTER(dev))
int on; return -EINVAL;
if (!IS_A_PTY_MASTER(dev)) retval = verify_area(VERIFY_READ,
return -EINVAL; (unsigned long *)arg, sizeof (unsigned long));
retval = verify_area(VERIFY_READ, (unsigned long *)arg, sizeof (int)); if (retval)
if (retval) return retval;
return retval; tty->packet = (get_fs_long ((unsigned long *)arg) != 0);
on=get_fs_long ((unsigned long *)arg); return 0;
if (on )
tty->packet = 1;
else
tty->packet = 0;
return (0);
}
case TCSBRK: case TCSBRKP: case TCSBRK: case TCSBRKP:
wait_until_sent(tty); wait_until_sent(tty);
if (!tty->ioctl) if (!tty->ioctl)
......
...@@ -37,6 +37,7 @@ struct vt_cons vt_cons[NR_CONSOLES]; ...@@ -37,6 +37,7 @@ struct vt_cons vt_cons[NR_CONSOLES];
asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on); asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on);
extern void compute_shiftstate(void);
extern void change_console(unsigned int new_console); extern void change_console(unsigned int new_console);
extern void complete_change_console(unsigned int new_console); extern void complete_change_console(unsigned int new_console);
extern int vt_waitactive(void); extern int vt_waitactive(void);
...@@ -208,10 +209,15 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, ...@@ -208,10 +209,15 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
case KDSKBMODE: case KDSKBMODE:
if (arg == K_RAW) { if (arg == K_RAW) {
set_vc_kbd_flag(kbd, VC_RAW); set_vc_kbd_flag(kbd, VC_RAW);
clr_vc_kbd_flag(kbd, VC_MEDIUMRAW);
} else if (arg == K_XLATE) { } else if (arg == K_XLATE) {
clr_vc_kbd_flag(kbd, VC_RAW); clr_vc_kbd_flag(kbd, VC_RAW);
} clr_vc_kbd_flag(kbd, VC_MEDIUMRAW);
else compute_shiftstate();
} else if (arg == K_MEDIUMRAW) {
clr_vc_kbd_flag(kbd, VC_RAW);
set_vc_kbd_flag(kbd, VC_MEDIUMRAW);
} else
return -EINVAL; return -EINVAL;
flush_input(tty); flush_input(tty);
return 0; return 0;
...@@ -220,17 +226,22 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, ...@@ -220,17 +226,22 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
i = verify_area(VERIFY_WRITE, (void *) arg, sizeof(unsigned long)); i = verify_area(VERIFY_WRITE, (void *) arg, sizeof(unsigned long));
if (!i) { if (!i) {
ucval = vc_kbd_flag(kbd, VC_RAW); ucval = vc_kbd_flag(kbd, VC_RAW);
put_fs_long(ucval ? K_RAW : K_XLATE, (unsigned long *) arg); if (vc_kbd_flag(kbd, VC_MEDIUMRAW))
put_fs_long(K_MEDIUMRAW, (unsigned long *) arg);
else
put_fs_long(ucval ? K_RAW : K_XLATE,
(unsigned long *) arg);
} }
return i; return i;
case KDGKBENT: case KDGKBENT:
{ {
struct kbentry * const a = (struct kbentry *)arg; struct kbentry * const a = (struct kbentry *)arg;
u_char i;
u_char s; u_char s;
verify_area(VERIFY_WRITE, (void *)a, sizeof(struct kbentry)); i = verify_area(VERIFY_WRITE, (void *)a, sizeof(struct kbentry));
if (i)
return i;
if ((i = get_fs_byte((char *) &a->kb_index)) >= NR_KEYS) if ((i = get_fs_byte((char *) &a->kb_index)) >= NR_KEYS)
return -EINVAL; return -EINVAL;
if ((s = get_fs_byte((char *) &a->kb_table)) >= NR_KEYMAPS) if ((s = get_fs_byte((char *) &a->kb_table)) >= NR_KEYMAPS)
...@@ -242,11 +253,12 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, ...@@ -242,11 +253,12 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
case KDSKBENT: case KDSKBENT:
{ {
const struct kbentry * a = (struct kbentry *)arg; const struct kbentry * a = (struct kbentry *)arg;
u_char i;
u_char s; u_char s;
u_short v; u_short v;
verify_area(VERIFY_WRITE, (void *)a, sizeof(struct kbentry)); i = verify_area(VERIFY_WRITE, (void *)a, sizeof(struct kbentry));
if (i)
return i;
if ((i = get_fs_byte((char *) &a->kb_index)) >= NR_KEYS) if ((i = get_fs_byte((char *) &a->kb_index)) >= NR_KEYS)
return -EINVAL; return -EINVAL;
if ((s = get_fs_byte((char *) &a->kb_table)) >= NR_KEYMAPS) if ((s = get_fs_byte((char *) &a->kb_table)) >= NR_KEYMAPS)
...@@ -262,11 +274,12 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, ...@@ -262,11 +274,12 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
case KDGKBSENT: case KDGKBSENT:
{ {
const struct kbsentry *a = (struct kbsentry *)arg; const struct kbsentry *a = (struct kbsentry *)arg;
u_char i;
char *p; char *p;
u_char *q; u_char *q;
verify_area(VERIFY_WRITE, (void *)a, sizeof(struct kbsentry)); i = verify_area(VERIFY_WRITE, (void *)a, sizeof(struct kbsentry));
if (i)
return i;
if ((i = get_fs_byte(&a->kb_func)) >= NR_FUNC) if ((i = get_fs_byte(&a->kb_func)) >= NR_FUNC)
return -EINVAL; return -EINVAL;
q = a->kb_string; q = a->kb_string;
...@@ -281,12 +294,13 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, ...@@ -281,12 +294,13 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
struct kbsentry * const a = (struct kbsentry *)arg; struct kbsentry * const a = (struct kbsentry *)arg;
int delta; int delta;
char *first_free; char *first_free;
u_char i;
int k; int k;
u_char *p; u_char *p;
char *q; char *q;
verify_area(VERIFY_READ, (void *)a, sizeof(struct kbsentry)); i = verify_area(VERIFY_READ, (void *)a, sizeof(struct kbsentry));
if (i)
return i;
if ((i = get_fs_byte(&a->kb_func)) >= NR_FUNC) if ((i = get_fs_byte(&a->kb_func)) >= NR_FUNC)
return -EINVAL; return -EINVAL;
delta = -strlen(func_table[i]); delta = -strlen(func_table[i]);
......
This diff is collapsed.
This diff is collapsed.
/* Definitions for the 3Com 3c503 Etherlink 2. */ /* Definitions for the 3Com 3c503 Etherlink 2. */
/* This file is distributed under the GPL. /* This file is distributed under the GPL.
Some of these names and comments are from the Crynwr packet drivers. */ Many of these names and comments are directly from the Crynwr packet
drivers, which are released under the GPL. */
#define EL2H (dev->base_addr + 0x400) #define EL2H (dev->base_addr + 0x400)
#define EL2L (dev->base_addr) #define EL2L (dev->base_addr)
...@@ -11,8 +12,8 @@ ...@@ -11,8 +12,8 @@
#define EL2SM_STOP_PG (0x40) /* Last page +1 of RX ring */ #define EL2SM_STOP_PG (0x40) /* Last page +1 of RX ring */
/* 3Com 3c503 ASIC registers */ /* 3Com 3c503 ASIC registers */
#define E33G_STARTPG (EL2H+0) /* Start page, must match EN0_STARTPG */ #define E33G_STARTPG (EL2H+0) /* Start page, matching EN0_STARTPG */
#define E33G_STOPPG (EL2H+1) /* Stop page, must match EN0_STOPPG */ #define E33G_STOPPG (EL2H+1) /* Stop page, must match EN0_STOPPG */
#define E33G_DRQCNT (EL2H+2) /* DMA burst count */ #define E33G_DRQCNT (EL2H+2) /* DMA burst count */
#define E33G_IOBASE (EL2H+3) /* Read of I/O base jumpers. */ #define E33G_IOBASE (EL2H+3) /* Read of I/O base jumpers. */
/* (non-useful, but it also appears at the end of EPROM space) */ /* (non-useful, but it also appears at the end of EPROM space) */
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
C/O Supercomputing Research Ctr., 17100 Science Dr., Bowie MD 20715 C/O Supercomputing Research Ctr., 17100 Science Dr., Bowie MD 20715
*/ */
static char *version = "3c509.c: v0.06 9/3/93 becker@super.org\n"; static char *version = "3c509.c:pl14 10/18/93 becker@super.org\n";
#include <linux/config.h> #include <linux/config.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -23,30 +23,18 @@ static char *version = "3c509.c: v0.06 9/3/93 becker@super.org\n"; ...@@ -23,30 +23,18 @@ static char *version = "3c509.c: v0.06 9/3/93 becker@super.org\n";
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/in.h> #include <linux/in.h>
#include <linux/malloc.h>
#ifndef PRE_PL13
#include <linux/ioport.h> #include <linux/ioport.h>
#else #include <asm/bitops.h>
#define snarf_region(base,extent) do {;}while(0)
#define check_region(base,extent) (0)
#endif
/*#include <asm/system.h>*/
#include <asm/io.h> #include <asm/io.h>
#ifndef port_read
#include "iow.h"
#endif
#include "dev.h" #include "dev.h"
#include "eth.h" #include "eth.h"
#include "skbuff.h" #include "skbuff.h"
#include "arp.h" #include "arp.h"
#ifndef HAVE_AUTOIRQ #ifndef port_read
/* From auto_irq.c, should be in a *.h file. */ #include "iow.h"
extern void autoirq_setup(int waittime);
extern int autoirq_report(int waittime);
extern struct device *irq2dev_map[16];
#endif #endif
/* These should be in <asm/io.h>. */ /* These should be in <asm/io.h>. */
...@@ -55,6 +43,11 @@ __asm__("cld;rep;insl": :"d" (port),"D" (buf),"c" (nr):"cx","di") ...@@ -55,6 +43,11 @@ __asm__("cld;rep;insl": :"d" (port),"D" (buf),"c" (nr):"cx","di")
#define port_write_l(port,buf,nr) \ #define port_write_l(port,buf,nr) \
__asm__("cld;rep;outsl": :"d" (port),"S" (buf),"c" (nr):"cx","si") __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)
#define kfree_skb(buff,size) kfree_s(buff,size)
#endif
#ifdef EL3_DEBUG #ifdef EL3_DEBUG
int el3_debug = EL3_DEBUG; int el3_debug = EL3_DEBUG;
...@@ -96,6 +89,9 @@ static void update_stats(int addr, struct device *dev); ...@@ -96,6 +89,9 @@ static void update_stats(int addr, struct device *dev);
static struct enet_statistics *el3_get_stats(struct device *dev); static struct enet_statistics *el3_get_stats(struct device *dev);
static int el3_rx(struct device *dev); static int el3_rx(struct device *dev);
static int el3_close(struct device *dev); static int el3_close(struct device *dev);
#ifdef HAVE_MULTICAST
static void set_multicast_list(struct device *dev, int num_addrs, void *addrs);
#endif
...@@ -184,8 +180,11 @@ int el3_probe(struct device *dev) ...@@ -184,8 +180,11 @@ int el3_probe(struct device *dev)
dev->hard_start_xmit = &el3_start_xmit; dev->hard_start_xmit = &el3_start_xmit;
dev->stop = &el3_close; dev->stop = &el3_close;
dev->get_stats = &el3_get_stats; dev->get_stats = &el3_get_stats;
#ifdef HAVE_MULTICAST
dev->set_multicast_list = &set_multicast_list;
#endif
/* Fill in the generic field of the device structure. */ /* Fill in the generic fields of the device structure. */
for (i = 0; i < DEV_NUMBUFFS; i++) for (i = 0; i < DEV_NUMBUFFS; i++)
dev->buffs[i] = NULL; dev->buffs[i] = NULL;
...@@ -328,6 +327,7 @@ el3_start_xmit(struct sk_buff *skb, struct device *dev) ...@@ -328,6 +327,7 @@ el3_start_xmit(struct sk_buff *skb, struct device *dev)
arp_queue (skb); arp_queue (skb);
return 0; return 0;
} }
skb->arp=1;
if (skb->len <= 0) if (skb->len <= 0)
return 0; return 0;
...@@ -347,27 +347,26 @@ el3_start_xmit(struct sk_buff *skb, struct device *dev) ...@@ -347,27 +347,26 @@ el3_start_xmit(struct sk_buff *skb, struct device *dev)
} }
/* Avoid timer-based retransmission conflicts. */ /* Avoid timer-based retransmission conflicts. */
dev->tbusy=1; if (set_bit(0, (void*)&dev->tbusy) != 0)
printk("%s: Transmitter access conflict.\n", dev->name);
/* Put out the doubleword header... */ else {
outw(skb->len, ioaddr + TX_FIFO); /* Put out the doubleword header... */
outw(0x00, ioaddr + TX_FIFO); outw(skb->len, ioaddr + TX_FIFO);
/* ... and the packet rounded to a doubleword. */ outw(0x00, ioaddr + TX_FIFO);
port_write_l(ioaddr + TX_FIFO, (void *)(skb+1), (skb->len + 3) >> 2); /* ... and the packet rounded to a doubleword. */
port_write_l(ioaddr + TX_FIFO, (void *)(skb+1), (skb->len + 3) >> 2);
dev->trans_start = jiffies; dev->trans_start = jiffies;
if (inw(ioaddr + TX_FREE) > 1536) {
dev->tbusy=0;
} else
/* Interrupt us when the FIFO has room for max-sized packet. */
outw(0x9000 + 1536, ioaddr + EL3_CMD);
}
if (skb->free) if (skb->free)
kfree_skb (skb, FREE_WRITE); kfree_skb (skb, FREE_WRITE);
if (inw(ioaddr + TX_FREE) > 1536) {
dev->tbusy=0;
} else
/* Interrupt us when the FIFO has room for max-sized packet. */
outw(0x9000 + 1536, ioaddr + EL3_CMD);
if (el3_debug > 4)
printk(" Finished queueing packet, FIFO room remaining %d.\n",
inw(ioaddr + TX_FREE));
/* Clear the Tx status stack. */ /* Clear the Tx status stack. */
{ {
short tx_status; short tx_status;
...@@ -515,8 +514,8 @@ el3_rx(struct device *dev) ...@@ -515,8 +514,8 @@ el3_rx(struct device *dev)
short pkt_len = rx_status & 0x7ff; short pkt_len = rx_status & 0x7ff;
int sksize = sizeof(struct sk_buff) + pkt_len + 3; int sksize = sizeof(struct sk_buff) + pkt_len + 3;
struct sk_buff *skb; struct sk_buff *skb;
skb = (struct sk_buff *) kmalloc(sksize, GFP_ATOMIC);
skb = alloc_skb(sksize, GFP_ATOMIC);
if (el3_debug > 4) if (el3_debug > 4)
printk(" Receiving packet size %d status %4.4x.\n", printk(" Receiving packet size %d status %4.4x.\n",
pkt_len, rx_status); pkt_len, rx_status);
...@@ -551,7 +550,7 @@ el3_rx(struct device *dev) ...@@ -551,7 +550,7 @@ el3_rx(struct device *dev)
continue; continue;
} else { } else {
printk("%s: receive buffers full.\n", dev->name); printk("%s: receive buffers full.\n", dev->name);
kfree_s(skb, sksize); kfree_skbmem(skb, sksize);
} }
#endif #endif
} else if (el3_debug) } else if (el3_debug)
...@@ -572,6 +571,26 @@ el3_rx(struct device *dev) ...@@ -572,6 +571,26 @@ el3_rx(struct device *dev)
return 0; return 0;
} }
#ifdef HAVE_MULTICAST
/* Set or clear the multicast filter for this adaptor.
num_addrs == -1 Promiscuous mode, receive all packets
num_addrs == 0 Normal mode, clear multicast list
num_addrs > 0 Multicast mode, receive normal and MC packets, and do
best-effort filtering.
*/
static void
set_multicast_list(struct device *dev, int num_addrs, void *addrs)
{
short ioaddr = dev->base_addr;
if (num_addrs > 0) {
outw(0x8007, ioaddr + EL3_CMD);
} else if (num_addrs < 0) {
outw(0x8008, ioaddr + EL3_CMD);
} else
outw(0x8005, ioaddr + EL3_CMD);
}
#endif
static int static int
el3_close(struct device *dev) el3_close(struct device *dev)
{ {
......
This diff is collapsed.
...@@ -36,10 +36,6 @@ ...@@ -36,10 +36,6 @@
# D_LINK_DEBUG Enable or disable D-Link debugging # D_LINK_DEBUG Enable or disable D-Link debugging
# #
# This is at the top level with 'make config'
CARDS =
OPTS = #-DEI8390=0 -DEI8390_IRQ=0 OPTS = #-DEI8390=0 -DEI8390_IRQ=0
WD_OPTS = #-DWD_SHMEM=0 WD_OPTS = #-DWD_SHMEM=0
EL2_OPTS = #-UEL2_AUI EL2_OPTS = #-UEL2_AUI
...@@ -47,5 +43,5 @@ NE_OPTS = ...@@ -47,5 +43,5 @@ NE_OPTS =
HP_OPTS = HP_OPTS =
PLIP_OPTS = PLIP_OPTS =
SLIP_OPTS = -DSL_DUMP -DSL_COMPRESSED SLIP_OPTS = -DSL_DUMP -DSL_COMPRESSED
DL_OPTS = -DD_LINK_IO=0x378 -DD_LINK_IRQ=7 -UD_LINK_DEBUG DL_OPTS = # -DD_LINK_IO=0x378 -DD_LINK_IRQ=7 -UD_LINK_DEBUG
AT_OPTS = # -DLANCE_DMA=5 AT_OPTS = # -DLANCE_DMA=5
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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