Commit 88d15e9d authored by Linus Torvalds's avatar Linus Torvalds

Import 1.3.30

parent f8f29af2
VERSION = 1
PATCHLEVEL = 3
SUBLEVEL = 29
SUBLEVEL = 30
ARCH = i386
......
......@@ -30,11 +30,13 @@ choice 'Alpha system type' \
EB66+ CONFIG_ALPHA_EB66P \
EB64 CONFIG_ALPHA_EB64 \
EB64+ CONFIG_ALPHA_EB64P" Cabriolet
if [ "$CONFIG_ALPHA_NONAME" = "y" ]; then
if [ "$CONFIG_ALPHA_NONAME" = "y" -o "$CONFIG_ALPHA_EB66" = "y" \
-o "$CONFIG_ALPHA_EB66P" = "y" ]
then
define_bool CONFIG_PCI y
define_bool CONFIG_ALPHA_LCA y
fi
if [ "$CONFIG_ALPHA_CABRIOLET" = "y" -o "$CONFIG_ALPHA_EB66" = "y" \
if [ "$CONFIG_ALPHA_CABRIOLET" = "y" \
-o "$CONFIG_ALPHA_EB64" = "y" -o "$CONFIG_ALPHA_EB64P" = "y" ]
then
define_bool CONFIG_PCI y
......
......@@ -13,7 +13,7 @@
$(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
OBJS = entry.o traps.o process.o osf_sys.o irq.o signal.o setup.o \
bios32.o ptrace.o apecs.o lca.o
bios32.o ptrace.o time.o apecs.o lca.o
all: kernel.o head.o
......
......@@ -648,6 +648,8 @@ unsigned long pcibios_fixup(unsigned long mem_start, unsigned long mem_end)
noname_fixup();
#elif defined(CONFIG_ALPHA_CABRIOLET)
cabriolet_fixup();
#elif defined(CONFIG_ALPHA_EB66P)
eb66p_fixup();
#elif defined(CONFIG_ALPHA_EB66)
eb66_and_eb64p_fixup();
#elif defined(CONFIG_ALPHA_EB64P)
......
......@@ -313,6 +313,10 @@ static inline void device_interrupt(int irq, int ack, struct pt_regs * regs)
kstat.interrupts[irq]++;
action = irq_action + irq;
#ifdef CONFIG_RANDOM
if (action->flags & SA_SAMPLE_RANDOM)
add_interrupt_randomness(irq);
#endif
/* quick interrupts get executed with no extra overhead */
if (action->flags & SA_INTERRUPT) {
action->handler(irq, regs);
......
/*
* linux/arch/alpha/kernel/time.c
*
* Copyright (C) 1991, 1992, 1995 Linus Torvalds
*
* This file contains the PC-specific time handling details:
* reading the RTC at bootup, etc..
* 1994-07-02 Alan Modra
* fixed set_rtc_mmss, fixed time.year for >= 2000, new mktime
* 1995-03-26 Markus Kuhn
* fixed 500 ms bug at call to set_rtc_mmss, fixed DS12887
* precision CMOS clock update
*/
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/param.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <asm/segment.h>
#include <asm/io.h>
#include <linux/mc146818rtc.h>
#include <linux/timex.h>
#define TIMER_IRQ 0
static int set_rtc_mmss(unsigned long);
/*
* timer_interrupt() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick
*/
static void timer_interrupt(int irq, struct pt_regs * regs)
{
/* last time the cmos clock got updated */
static long last_rtc_update=0;
do_timer(regs);
/*
* If we have an externally synchronized Linux clock, then update
* CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
* called as close as possible to 500 ms before the new second starts.
*/
if (time_state != TIME_BAD && xtime.tv_sec > last_rtc_update + 660 &&
xtime.tv_usec > 500000 - (tick >> 1) &&
xtime.tv_usec < 500000 + (tick >> 1))
if (set_rtc_mmss(xtime.tv_sec) == 0)
last_rtc_update = xtime.tv_sec;
else
last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */
}
/* Converts Gregorian date to seconds since 1970-01-01 00:00:00.
* Assumes input in normal date format, i.e. 1980-12-31 23:59:59
* => year=1980, mon=12, day=31, hour=23, min=59, sec=59.
*
* [For the Julian calendar (which was used in Russia before 1917,
* Britain & colonies before 1752, anywhere else before 1582,
* and is still in use by some communities) leave out the
* -year/100+year/400 terms, and add 10.]
*
* This algorithm was first published by Gauss (I think).
*
* WARNING: this function will overflow on 2106-02-07 06:28:16 on
* machines were long is 32-bit! (However, as time_t is signed, we
* will already get problems at other places on 2038-01-19 03:14:08)
*/
static inline unsigned long mktime(unsigned int year, unsigned int mon,
unsigned int day, unsigned int hour,
unsigned int min, unsigned int sec)
{
if (0 >= (int) (mon -= 2)) { /* 1..12 -> 11,12,1..10 */
mon += 12; /* Puts Feb last since it has leap day */
year -= 1;
}
return (((
(unsigned long)(year/4 - year/100 + year/400 + 367*mon/12 + day) +
year*365 - 719499
)*24 + hour /* now have hours */
)*60 + min /* now have minutes */
)*60 + sec; /* finally seconds */
}
void time_init(void)
{
unsigned int year, mon, day, hour, min, sec;
int i;
/* The Linux interpretation of the CMOS clock register contents:
* When the Update-In-Progress (UIP) flag goes from 1 to 0, the
* RTC registers show the second which has precisely just started.
* Let's hope other operating systems interpret the RTC the same way.
*/
/* read RTC exactly on falling edge of update flag */
for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)
break;
for (i = 0 ; i < 1000000 ; i++) /* must try at least 2.228 ms */
if (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP))
break;
do { /* Isn't this overkill ? UIP above should guarantee consistency */
sec = CMOS_READ(RTC_SECONDS);
min = CMOS_READ(RTC_MINUTES);
hour = CMOS_READ(RTC_HOURS);
day = CMOS_READ(RTC_DAY_OF_MONTH);
mon = CMOS_READ(RTC_MONTH);
year = CMOS_READ(RTC_YEAR);
} while (sec != CMOS_READ(RTC_SECONDS));
if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
{
BCD_TO_BIN(sec);
BCD_TO_BIN(min);
BCD_TO_BIN(hour);
BCD_TO_BIN(day);
BCD_TO_BIN(mon);
BCD_TO_BIN(year);
}
#ifdef ALPHA_PRE_V1_2_SRM_CONSOLE
/*
* The meaning of life, the universe, and everything. Plus
* this makes the year come out right on SRM consoles earlier
* than v1.2.
*/
year -= 42;
#endif
if ((year += 1900) < 1970)
year += 100;
xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
xtime.tv_usec = 0;
if (request_irq(TIMER_IRQ, timer_interrupt, 0, "timer") != 0)
panic("Could not allocate timer IRQ!");
}
/*
* We could get better timer accuracy by using the alpha
* time counters or something. Now this is limited to
* the HZ clock frequency.
*/
void do_gettimeofday(struct timeval *tv)
{
unsigned long flags;
save_flags(flags);
cli();
*tv = xtime;
restore_flags(flags);
}
void do_settimeofday(struct timeval *tv)
{
cli();
xtime = *tv;
time_state = TIME_BAD;
time_maxerror = 0x70000000;
time_esterror = 0x70000000;
sti();
}
/*
* In order to set the CMOS clock precisely, set_rtc_mmss has to be
* called 500 ms after the second nowtime has started, because when
* nowtime is written into the registers of the CMOS clock, it will
* jump to the next second precisely 500 ms later. Check the Motorola
* MC146818A or Dallas DS12887 data sheet for details.
*/
static int set_rtc_mmss(unsigned long nowtime)
{
int retval = 0;
int real_seconds, real_minutes, cmos_minutes;
unsigned char save_control, save_freq_select;
save_control = CMOS_READ(RTC_CONTROL); /* tell the clock it's being set */
CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL);
save_freq_select = CMOS_READ(RTC_FREQ_SELECT); /* stop and reset prescaler */
CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
cmos_minutes = CMOS_READ(RTC_MINUTES);
if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
BCD_TO_BIN(cmos_minutes);
/*
* since we're only adjusting minutes and seconds,
* don't interfere with hour overflow. This avoids
* messing with unknown time zones but requires your
* RTC not to be off by more than 15 minutes
*/
real_seconds = nowtime % 60;
real_minutes = nowtime / 60;
if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
real_minutes += 30; /* correct for half hour time zone */
real_minutes %= 60;
if (abs(real_minutes - cmos_minutes) < 30) {
if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
BIN_TO_BCD(real_seconds);
BIN_TO_BCD(real_minutes);
}
CMOS_WRITE(real_seconds,RTC_SECONDS);
CMOS_WRITE(real_minutes,RTC_MINUTES);
} else
retval = -1;
/* The following flags have to be released exactly in this order,
* otherwise the DS12887 (popular MC146818A clone with integrated
* battery and quartz) will not reset the oscillator and will not
* update precisely 500 ms later. You won't find this mentioned in
* the Dallas Semiconductor data sheets, but who believes data
* sheets anyway ... -- Markus Kuhn
*/
CMOS_WRITE(save_control, RTC_CONTROL);
CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
return retval;
}
......@@ -13,6 +13,7 @@
#include <linux/tty.h>
#include <asm/unaligned.h>
#include <asm/gentrap.h>
void die_if_kernel(char * str, struct pt_regs * regs, long err)
{
......@@ -69,8 +70,45 @@ asmlinkage void do_entIF(unsigned long type, unsigned long a1, unsigned long a2,
send_sig(SIGTRAP, current, 1);
break;
case 1: /* bugcheck */
case 2: /* gentrap */
/*
* The translation from the gentrap error code into a
* siginfo structure (see /usr/include/sys/siginfo.h)
* is missing as Linux does not presently support the
* siginfo argument that is normally passed to a
* signal handler.
*/
switch ((long) regs.r16) {
case GEN_INTOVF: case GEN_INTDIV: case GEN_FLTOVF:
case GEN_FLTDIV: case GEN_FLTUND: case GEN_FLTINV:
case GEN_FLTINE:
send_sig(SIGFPE, current, 1);
break;
case GEN_DECOVF:
case GEN_DECDIV:
case GEN_DECINV:
case GEN_ROPRAND:
case GEN_ASSERTERR:
case GEN_NULPTRERR:
case GEN_STKOVF:
case GEN_STRLENERR:
case GEN_SUBSTRERR:
case GEN_RANGERR:
case GEN_SUBRNG:
case GEN_SUBRNG1:
case GEN_SUBRNG2:
case GEN_SUBRNG3:
case GEN_SUBRNG4:
case GEN_SUBRNG5:
case GEN_SUBRNG6:
case GEN_SUBRNG7:
send_sig(SIGILL, current, 1);
break;
}
break;
case 1: /* bugcheck */
case 3: /* FEN fault */
case 4: /* opDEC */
send_sig(SIGILL, current, 1);
......
......@@ -120,6 +120,7 @@ bool 'Trantor T128/T128F/T228 SCSI support' CONFIG_SCSI_T128 n
dep_tristate 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR n $CONFIG_SCSI
dep_tristate '7000FASST SCSI support' CONFIG_SCSI_7000FASST n $CONFIG_SCSI
dep_tristate 'EATA ISA/EISA (DPT PM2011/021/012/022/122/322) support' CONFIG_SCSI_EATA n $CONFIG_SCSI
dep_tristate 'NCR53c406a SCSI support' CONFIG_SCSI_NCR53C406A n $CONFIG_SCSI
#dep_tristate 'SCSI debugging host adapter' CONFIG_SCSI_DEBUG n $CONFIG_SCSI
fi
......
......@@ -15,7 +15,7 @@
all: kernel.o head.o
O_TARGET := kernel.o
O_OBJS := process.o signal.o entry.o traps.o irq.o vm86.o bios32.o \
ptrace.o ioport.o ldt.o setup.o sys_i386.o
ptrace.o ioport.o ldt.o setup.o time.o sys_i386.o
#head.o: head.s
......
......@@ -23,6 +23,7 @@
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/timex.h>
#include <linux/random.h>
#include <asm/system.h>
#include <asm/io.h>
......@@ -188,6 +189,10 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
struct irqaction * action = irq + irq_action;
kstat.interrupts[irq]++;
#ifdef CONFIG_RANDOM
if (action->flags & SA_SAMPLE_RANDOM)
add_interrupt_randomness(irq);
#endif
action->handler(irq, regs);
}
......@@ -201,6 +206,10 @@ asmlinkage void do_fast_IRQ(int irq)
struct irqaction * action = irq + irq_action;
kstat.interrupts[irq]++;
#ifdef CONFIG_RANDOM
if (action->flags & SA_SAMPLE_RANDOM)
add_interrupt_randomness(irq);
#endif
action->handler(irq, NULL);
}
......
/*
* linux/arch/i386/kernel/time.c
*
* Copyright (C) 1991, 1992, 1995 Linus Torvalds
*
* This file contains the PC-specific time handling details:
* reading the RTC at bootup, etc..
* 1994-07-02 Alan Modra
* fixed set_rtc_mmss, fixed time.year for >= 2000, new mktime
* 1995-03-26 Markus Kuhn
* fixed 500 ms bug at call to set_rtc_mmss, fixed DS12887
* precision CMOS clock update
*/
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/param.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <asm/segment.h>
#include <asm/io.h>
#include <linux/mc146818rtc.h>
#include <linux/timex.h>
#define TIMER_IRQ 0
static int set_rtc_mmss(unsigned long);
/*
* timer_interrupt() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick
*/
static void timer_interrupt(int irq, struct pt_regs * regs)
{
/* last time the cmos clock got updated */
static long last_rtc_update=0;
do_timer(regs);
/*
* If we have an externally synchronized Linux clock, then update
* CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
* called as close as possible to 500 ms before the new second starts.
*/
if (time_state != TIME_BAD && xtime.tv_sec > last_rtc_update + 660 &&
xtime.tv_usec > 500000 - (tick >> 1) &&
xtime.tv_usec < 500000 + (tick >> 1))
if (set_rtc_mmss(xtime.tv_sec) == 0)
last_rtc_update = xtime.tv_sec;
else
last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */
}
/* Converts Gregorian date to seconds since 1970-01-01 00:00:00.
* Assumes input in normal date format, i.e. 1980-12-31 23:59:59
* => year=1980, mon=12, day=31, hour=23, min=59, sec=59.
*
* [For the Julian calendar (which was used in Russia before 1917,
* Britain & colonies before 1752, anywhere else before 1582,
* and is still in use by some communities) leave out the
* -year/100+year/400 terms, and add 10.]
*
* This algorithm was first published by Gauss (I think).
*
* WARNING: this function will overflow on 2106-02-07 06:28:16 on
* machines were long is 32-bit! (However, as time_t is signed, we
* will already get problems at other places on 2038-01-19 03:14:08)
*/
static inline unsigned long mktime(unsigned int year, unsigned int mon,
unsigned int day, unsigned int hour,
unsigned int min, unsigned int sec)
{
if (0 >= (int) (mon -= 2)) { /* 1..12 -> 11,12,1..10 */
mon += 12; /* Puts Feb last since it has leap day */
year -= 1;
}
return (((
(unsigned long)(year/4 - year/100 + year/400 + 367*mon/12 + day) +
year*365 - 719499
)*24 + hour /* now have hours */
)*60 + min /* now have minutes */
)*60 + sec; /* finally seconds */
}
void time_init(void)
{
unsigned int year, mon, day, hour, min, sec;
int i;
/* The Linux interpretation of the CMOS clock register contents:
* When the Update-In-Progress (UIP) flag goes from 1 to 0, the
* RTC registers show the second which has precisely just started.
* Let's hope other operating systems interpret the RTC the same way.
*/
/* read RTC exactly on falling edge of update flag */
for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)
break;
for (i = 0 ; i < 1000000 ; i++) /* must try at least 2.228 ms */
if (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP))
break;
do { /* Isn't this overkill ? UIP above should guarantee consistency */
sec = CMOS_READ(RTC_SECONDS);
min = CMOS_READ(RTC_MINUTES);
hour = CMOS_READ(RTC_HOURS);
day = CMOS_READ(RTC_DAY_OF_MONTH);
mon = CMOS_READ(RTC_MONTH);
year = CMOS_READ(RTC_YEAR);
} while (sec != CMOS_READ(RTC_SECONDS));
if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
{
BCD_TO_BIN(sec);
BCD_TO_BIN(min);
BCD_TO_BIN(hour);
BCD_TO_BIN(day);
BCD_TO_BIN(mon);
BCD_TO_BIN(year);
}
if ((year += 1900) < 1970)
year += 100;
xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
xtime.tv_usec = 0;
if (request_irq(TIMER_IRQ, timer_interrupt, 0, "timer") != 0)
panic("Could not allocate timer IRQ!");
}
/* This function must be called with interrupts disabled
* It was inspired by Steve McCanne's microtime-i386 for BSD. -- jrs
*
* However, the pc-audio speaker driver changes the divisor so that
* it gets interrupted rather more often - it loads 64 into the
* counter rather than 11932! This has an adverse impact on
* do_gettimeoffset() -- it stops working! What is also not
* good is that the interval that our timer function gets called
* is no longer 10.0002 ms, but 9.9767 ms. To get around this
* would require using a different timing source. Maybe someone
* could use the RTC - I know that this can interrupt at frequencies
* ranging from 8192Hz to 2Hz. If I had the energy, I'd somehow fix
* it so that at startup, the timer code in sched.c would select
* using either the RTC or the 8253 timer. The decision would be
* based on whether there was any other device around that needed
* to trample on the 8253. I'd set up the RTC to interrupt at 1024 Hz,
* and then do some jiggery to have a version of do_timer that
* advanced the clock by 1/1024 s. Every time that reached over 1/100
* of a second, then do all the old code. If the time was kept correct
* then do_gettimeoffset could just return 0 - there is no low order
* divider that can be accessed.
*
* Ideally, you would be able to use the RTC for the speaker driver,
* but it appears that the speaker driver really needs interrupt more
* often than every 120 us or so.
*
* Anyway, this needs more thought.... pjsg (1993-08-28)
*
* If you are really that interested, you should be reading
* comp.protocols.time.ntp!
*/
#define TICK_SIZE tick
static inline unsigned long do_gettimeoffset(void)
{
int count;
unsigned long offset = 0;
/* timer count may underflow right here */
outb_p(0x00, 0x43); /* latch the count ASAP */
count = inb_p(0x40); /* read the latched count */
count |= inb(0x40) << 8;
/* we know probability of underflow is always MUCH less than 1% */
if (count > (LATCH - LATCH/100)) {
/* check for pending timer interrupt */
outb_p(0x0a, 0x20);
if (inb(0x20) & 1)
offset = TICK_SIZE;
}
count = ((LATCH-1) - count) * TICK_SIZE;
count = (count + LATCH/2) / LATCH;
return offset + count;
}
/*
* This version of gettimeofday has near microsecond resolution.
*/
void do_gettimeofday(struct timeval *tv)
{
unsigned long flags;
save_flags(flags);
cli();
*tv = xtime;
tv->tv_usec += do_gettimeoffset();
if (tv->tv_usec >= 1000000) {
tv->tv_usec -= 1000000;
tv->tv_sec++;
}
restore_flags(flags);
}
void do_settimeofday(struct timeval *tv)
{
cli();
/* This is revolting. We need to set the xtime.tv_usec
* correctly. However, the value in this location is
* is value at the last tick.
* Discover what correction gettimeofday
* would have done, and then undo it!
*/
tv->tv_usec -= do_gettimeoffset();
if (tv->tv_usec < 0) {
tv->tv_usec += 1000000;
tv->tv_sec--;
}
xtime = *tv;
time_state = TIME_BAD;
time_maxerror = 0x70000000;
time_esterror = 0x70000000;
sti();
}
/*
* In order to set the CMOS clock precisely, set_rtc_mmss has to be
* called 500 ms after the second nowtime has started, because when
* nowtime is written into the registers of the CMOS clock, it will
* jump to the next second precisely 500 ms later. Check the Motorola
* MC146818A or Dallas DS12887 data sheet for details.
*/
static int set_rtc_mmss(unsigned long nowtime)
{
int retval = 0;
int real_seconds, real_minutes, cmos_minutes;
unsigned char save_control, save_freq_select;
save_control = CMOS_READ(RTC_CONTROL); /* tell the clock it's being set */
CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL);
save_freq_select = CMOS_READ(RTC_FREQ_SELECT); /* stop and reset prescaler */
CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
cmos_minutes = CMOS_READ(RTC_MINUTES);
if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
BCD_TO_BIN(cmos_minutes);
/*
* since we're only adjusting minutes and seconds,
* don't interfere with hour overflow. This avoids
* messing with unknown time zones but requires your
* RTC not to be off by more than 15 minutes
*/
real_seconds = nowtime % 60;
real_minutes = nowtime / 60;
if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
real_minutes += 30; /* correct for half hour time zone */
real_minutes %= 60;
if (abs(real_minutes - cmos_minutes) < 30) {
if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
BIN_TO_BCD(real_seconds);
BIN_TO_BCD(real_minutes);
}
CMOS_WRITE(real_seconds,RTC_SECONDS);
CMOS_WRITE(real_minutes,RTC_MINUTES);
} else
retval = -1;
/* The following flags have to be released exactly in this order,
* otherwise the DS12887 (popular MC146818A clone with integrated
* battery and quartz) will not reset the oscillator and will not
* update precisely 500 ms later. You won't find this mentioned in
* the Dallas Semiconductor data sheets, but who believes data
* sheets anyway ... -- Markus Kuhn
*/
CMOS_WRITE(save_control, RTC_CONTROL);
CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
return retval;
}
......@@ -2034,7 +2034,7 @@ static void setup_format_params(void)
head_shift = (F_SECT_PER_TRACK + 5) / 6;
/* a ``cylinder'' is two tracks plus a little stepping time */
track_shift = 2 * head_shift + 1;
track_shift = 2 * head_shift + 3;
/* position of logical sector 1 on this track */
n = (track_shift * format_req.track + head_shift * format_req.head )
......@@ -3699,7 +3699,8 @@ static int floppy_grab_irq_and_dma(void)
}
set_dor(0, ~0, 8); /* avoid immediate interrupt */
if (request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT, "floppy")) {
if (request_irq(FLOPPY_IRQ, floppy_interrupt,
SA_INTERRUPT|SA_SAMPLE_RANDOM, "floppy")) {
DPRINT1("Unable to grab IRQ%d for the floppy driver\n",
FLOPPY_IRQ);
return -1;
......
......@@ -2761,7 +2761,8 @@ static int init_irq (ide_hwif_t *hwif)
*/
save_flags(flags);
cli();
if (request_irq(hwif->irq, ide_intr, SA_INTERRUPT, hwif->name)) {
if (request_irq(hwif->irq, ide_intr,
SA_INTERRUPT|SA_SAMPLE_RANDOM, hwif->name)) {
restore_flags(flags);
printk(" -- FAILED!");
return 1;
......
......@@ -17,7 +17,7 @@ FONTMAPFILE = cp437.uni
L_TARGET := char.a
M_OBJS :=
L_OBJS := tty_io.o n_tty.o console.o keyboard.o serial.o \
tty_ioctl.o pty.o vt.o mem.o vc_screen.o \
tty_ioctl.o pty.o vt.o mem.o vc_screen.o random.o \
defkeymap.o consolemap.o vesa_blank.o selection.o
ifdef CONFIG_CYCLADES
......
......@@ -2434,6 +2434,17 @@ static int set_get_font(char * arg, int set, int ch512)
else
ch512 = 0; /* Default font is always 256 */
#ifdef BROKEN_GRAPHICS_PROGRAMS
/*
* All fonts are loaded in slot 0 (0:1 for 512 ch)
*/
if (!arg)
return -EINVAL; /* Return to default font not supported */
video_font_is_default = 0;
font_select = ch512 ? 0x04 : 0x00;
#else
/*
* The default font is kept in slot 0 and is never touched.
* A custom font is loaded in slot 2 (256 ch) or 2:3 (512 ch)
......@@ -2447,6 +2458,7 @@ static int set_get_font(char * arg, int set, int ch512)
if ( !video_font_is_default )
charmap += 4*cmapsz;
#endif
cli();
outb_p( 0x00, seq_port_reg ); /* First, the sequencer */
......
......@@ -27,6 +27,7 @@
#include <linux/signal.h>
#include <linux/string.h>
#include <linux/ioport.h>
#include <linux/random.h>
#include <asm/bitops.h>
......@@ -370,6 +371,9 @@ static void keyboard_interrupt(int irq, struct pt_regs *regs)
prev_scancode = 0;
goto end_kbd_intr;
}
#ifdef CONFIG_RANDOM
add_keyboard_randomness(scancode);
#endif
tty = ttytab[fg_console];
kbd = kbd_table + fg_console;
......
......@@ -16,6 +16,7 @@
#include <linux/malloc.h>
#include <linux/mman.h>
#include <linux/mm.h>
#include <linux/random.h>
#include <asm/segment.h>
#include <asm/io.h>
......@@ -226,6 +227,7 @@ static int memory_lseek(struct inode * inode, struct file * file, off_t offset,
#define mmap_kmem mmap_mem
#define zero_lseek null_lseek
#define write_zero write_null
#define write_random write_null
static struct file_operations ram_fops = {
memory_lseek,
......@@ -316,6 +318,32 @@ static struct file_operations full_fops = {
NULL /* no special release code */
};
#ifdef CONFIG_RANDOM
static struct file_operations random_fops = {
memory_lseek,
read_random,
write_random,
NULL, /* full_readdir */
NULL, /* full_select */
NULL, /* full_ioctl */
NULL, /* full_mmap */
NULL, /* no special open code */
NULL /* no special release code */
};
static struct file_operations urandom_fops = {
memory_lseek,
read_random_unlimited,
write_random,
NULL, /* full_readdir */
NULL, /* full_select */
NULL, /* full_ioctl */
NULL, /* full_mmap */
NULL, /* no special open code */
NULL /* no special release code */
};
#endif
static int memory_open(struct inode * inode, struct file * filp)
{
switch (MINOR(inode->i_rdev)) {
......@@ -340,6 +368,14 @@ static int memory_open(struct inode * inode, struct file * filp)
case 7:
filp->f_op = &full_fops;
break;
#ifdef CONFIG_RANDOM
case 8:
filp->f_op = &random_fops;
break;
case 9:
filp->f_op = &urandom_fops;
break;
#endif
default:
return -ENODEV;
}
......@@ -369,6 +405,9 @@ long chr_dev_init(long mem_start, long mem_end)
{
if (register_chrdev(MEM_MAJOR,"mem",&memory_fops))
printk("unable to get major %d for memory devs\n", MEM_MAJOR);
#ifdef CONFIG_RANDOM
rand_initialize();
#endif
mem_start = tty_init(mem_start);
#ifdef CONFIG_PRINTER
mem_start = lp_init(mem_start);
......
This diff is collapsed.
......@@ -985,6 +985,12 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
if (vt_cons[fg_console]->vc_mode != KD_TEXT)
return -EINVAL;
#ifdef BROKEN_GRAPHICS_PROGRAMS
/* With BROKEN_GRAPHICS_PROGRAMS defined, the default
font is not saved. */
return -ENOSYS;
#else
i = con_set_font(NULL, 0); /* Set font to default */
if (i) return i;
......@@ -993,6 +999,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
con_set_default_unimap();
return 0;
#endif
}
case GIO_FONTX:
......
......@@ -8,6 +8,16 @@
#include <linux/vt.h>
/*
* Presently, a lot of graphics programs do not restore the contents of
* the higher font pages. Defining this flag will avoid use of them, but
* will lose support for PIO_FONTRESET. Note that many font operations are
* not likely to work with these programs anyway; they need to be
* fixed. The linux/Documentation directory includes a code snippet
* to save and restore the text font.
*/
#define BROKEN_GRAPHICS_PROGRAMS 1
extern struct vt_struct {
int vc_num; /* The console number */
unsigned char vc_mode; /* KD_TEXT, ... */
......
......@@ -252,7 +252,7 @@ print_ip(iph);
#ifdef TUNNEL_DEBUG
printk("tunnel: calling ip_forward()\n");
#endif
if(ip_forward(skb2, dev, 0, iph->daddr, 0))
if(ip_forward(skb2, dev, 0, iph->daddr))
kfree_skb(skb2, FREE_WRITE);
......
......@@ -126,7 +126,7 @@ struct pci_dev_info dev_info[] = {
DEVICE( AL, AL_M1461, "M1461"),
DEVICE( AL, AL_M4803, "M4803"),
DEVICE( IMS, IMS_8849, "8849"),
DEVICE( REALTEK, REALTEK_8300, "ENW-8300C"),
DEVICE( REALTEK, REALTEK_8029, "8029"),
DEVICE( VIA, VIA_82C505, "VT 82C505"),
DEVICE( VIA, VIA_82C561, "VT 82C561"),
DEVICE( VIA, VIA_82C576, "VT 82C576 3V"),
......
......@@ -3200,8 +3200,8 @@ static void NCR53c7x0_intr (int irq, struct pt_regs * regs) {
hostdata->state = STATE_HALTED;
/*
* NCR53c700 and NCR53c700-66 change the current SCSI
* process, hostdata->current, in the Linux driver so
* cmd = hostdata->current.
* process, hostdata->current_cmd, in the Linux driver so
* cmd = hostdata->current_cmd.
*
* With other chips, we must look through the commands
* executing and find the command structure which
......@@ -3209,7 +3209,7 @@ static void NCR53c7x0_intr (int irq, struct pt_regs * regs) {
*/
if (hostdata->options & OPTION_700) {
cmd = (struct NCR53c7x0_cmd *) hostdata->current;
cmd = (struct NCR53c7x0_cmd *) hostdata->current_cmd;
} else {
dsa = bus_to_virt(NCR53c7x0_read32(DSA_REG));
for (cmd = (struct NCR53c7x0_cmd *)
......
......@@ -1240,7 +1240,7 @@ struct NCR53c7x0_hostdata {
volatile struct NCR53c7x0_cmd *running_list;
/* commands running, maintained
by Linux driver */
volatile struct NCR53c7x0_cmd *current; /* currently connected
volatile struct NCR53c7x0_cmd *current_cmd; /* currently connected
nexus, ONLY valid for
NCR53c700/NCR53c700-66
*/
......
......@@ -232,6 +232,14 @@ else
endif
endif
ifeq ($(CONFIG_SCSI_NCR53C406A),y)
L_OBJS += NCR53c406a.o
else
ifeq ($(CONFIG_SCSI_NCR53C406A),m)
M_OBJS += NCR53c406a.o
endif
endif
include $(TOPDIR)/Rules.make
ifeq ($(CONFIG_SCSI),m)
......
This diff is collapsed.
#ifndef _NCR53C406A_H
#define _NCR53C406A_H
/*
* NCR53c406a.h
*
* Copyright (C) 1994 Normunds Saumanis (normunds@rx.tech.swh.lv)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
*/
#ifndef NULL
#define NULL 0
#endif
/* NOTE: scatter-gather support only works in PIO mode.
* Use SG_NONE if DMA mode is enabled!
*/
#define NCR53c406a { \
NULL /* next */, \
NULL /* usage count */, \
NULL /* proc_dir */, \
NULL /* proc_info */, \
"NCR53c406a" /* name */, \
NCR53c406a_detect /* detect */, \
NULL /* release */, \
NCR53c406a_info /* info */, \
NCR53c406a_command /* command */, \
NCR53c406a_queue /* queuecommand */, \
NCR53c406a_abort /* abort */, \
NCR53c406a_reset /* reset */, \
NULL /* slave_attach */, \
NCR53c406a_biosparm /* biosparm */, \
1 /* can_queue */, \
7 /* SCSI ID of the chip */, \
32 /*SG_ALL*/ /*SG_NONE*/, \
1 /* commands per lun */, \
0 /* number of boards in system */, \
1 /* unchecked_isa_dma */, \
ENABLE_CLUSTERING \
}
int NCR53c406a_detect(Scsi_Host_Template *);
const char* NCR53c406a_info(struct Scsi_Host *);
int NCR53c406a_command(Scsi_Cmnd *);
int NCR53c406a_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
int NCR53c406a_abort(Scsi_Cmnd *);
int NCR53c406a_reset(Scsi_Cmnd *);
int NCR53c406a_biosparm(Disk *, kdev_t, int []);
#endif /* _NCR53C406A_H */
This file contains brief information about the SCSI tape driver.
Last modified: Sun Sep 10 13:19:02 1995 by root@kai.makisara.fi
Last modified: Sun Sep 24 23:40:06 1995 by root@kai.makisara.fi
BASICS
......@@ -19,15 +19,16 @@ The compile options are defined in the file linux/drivers/scsi/st_options.h.
BUFFERING
The driver uses a buffer allocated at system initialization. The size
of the buffer is selectable at compile and/or boot time. The buffer is
used to store the data being transferred to/from the SCSI adapter. The
following buffering options are selectable at compile time and/or at run
time (via ioctl):
The driver uses tape buffers allocated either at system initialization
or at run-time when needed. One buffer is used for each open tape
device. The size of the buffers is selectable at compile and/or boot
time. The buffers are used to store the data being transferred to/from
the SCSI adapter. The following buffering options are selectable at
compile time and/or at run time (via ioctl):
Buffering of data to be written across write calls for fixed block
mode (define ST_BUFFER_WRITES). This should be disabled if reliable
detection of end of media (EOM) for fixed block mode is desired.
Buffering of data across write calls in fixed block mode (define
ST_BUFFER_WRITES). This should be disabled if reliable detection of
end of medium (EOM) for fixed block mode is desired.
Asynchronous writing. Writing the buffer contents to the tape is
started and the write call returns immediately. The status is checked
......@@ -40,16 +41,27 @@ this read command. Should be disabled for those drives that don't like
a filemark to truncate a read request or that don't like backspacing.
The buffer size is defined (in 1024 byte units) by ST_BUFFER_BLOCKS or
at boot time. The maximum number of buffers allocated is defined by
at boot time. If this size is not enough, the driver tries to allocate
a large enough temporary buffer that is released when the device is
closed.
The maximum number of buffers allocated at initialization is defined by
ST_MAX_BUFFERS. One buffer is allocated for each drive detected when
the driver is initialized up to the maximum. The minimum number of
allocated buffers is ST_EXTRA_DEVS (in hosts.h). This ensures some
functionality also for the drives found after tape driver
initialization (a SCSI adapter driver is loaded as a module). The
default for ST_EXTRA_DEVS is two. This is enough to enable tape copies.
default for ST_EXTRA_DEVS is two. The driver tries to allocate new
buffers at run-time if necessary.
Allocation of the buffers can be postponed to run-time if
(ST_RUNTIME_BUFFERS). The advantage is that memory is not wasted for
buffers not being used. The disadvantage is that there may not be
memory available at the time when a buffer is needed for the first
time (once a buffer is allocated, it is not released).
The threshold for triggering asynchronous write is defined by
ST_WRITE_THRESHOLD.
The threshold for triggering asynchronous write in fixed block mode
is defined by ST_WRITE_THRESHOLD.
BOOT TIME CONFIGURATION
......@@ -149,6 +161,10 @@ MISCELLANEOUS COMPILE OPTIONS
The recovered write errors are considered fatal if ST_RECOVERED_WRITE_FATAL
is defined.
The maximum number of tape devices is determined by the define
ST_MAX_TAPES. If more tapes are detected at driver intialization, the
maximum is adjusted accordingly.
Immediate return from tape positioning SCSI commands can be enabled by
defining ST_NOWAIT.
......
......@@ -200,11 +200,19 @@
**************************************************************************/
#ifdef PCMCIA
#define MODULE
#endif
#ifdef MODULE
#include <linux/config.h>
#include <linux/module.h>
#endif
#ifdef PCMCIA
#undef MODULE
#endif
#include <linux/sched.h>
#include <asm/io.h>
#include "../block/blk.h"
......
......@@ -123,6 +123,10 @@
#include "eata.h"
#endif
#ifdef CONFIG_SCSI_NCR53C406A
#include "NCR53c406a.h"
#endif
#ifdef CONFIG_SCSI_DEBUG
#include "scsi_debug.h"
#endif
......@@ -191,6 +195,9 @@ static Scsi_Host_Template builtin_scsi_hosts[] =
#ifdef CONFIG_SCSI_GENERIC_NCR5380
GENERIC_NCR5380,
#endif
#ifdef CONFIG_SCSI_NCR53C406A /* 53C406A should come before QLOGIC */
NCR53c406a,
#endif
#ifdef CONFIG_SCSI_QLOGIC
QLOGIC,
#endif
......
......@@ -58,7 +58,7 @@ typedef struct SHT
struct SHT * next;
/* Used with loadable modules so that we know when it is safe to unload */
int * usage_count;
long * usage_count;
/* The pointer to the /proc/scsi directory entry */
struct proc_dir_entry *proc_dir;
......@@ -352,7 +352,7 @@ struct Scsi_Device_Template
struct Scsi_Device_Template * next;
const char * name;
const char * tag;
int * usage_count; /* Used for loadable modules */
long * usage_count; /* Used for loadable modules */
unsigned char scsi_type;
unsigned char major;
unsigned char nr_dev; /* Number currently attached */
......
......@@ -571,6 +571,8 @@ void scan_scsis (struct Scsi_Host * shpnt, unchar hardcoded,
SDpnt->manufacturer = SCSI_MAN_TOSHIBA;
else if (!strncmp(scsi_result+8,"SONY",4))
SDpnt->manufacturer = SCSI_MAN_SONY;
else if (!strncmp(scsi_result+8, "PIONEER", 7))
SDpnt->manufacturer = SCSI_MAN_PIONEER;
else
SDpnt->manufacturer = SCSI_MAN_UNKNOWN;
......@@ -2269,6 +2271,7 @@ int scsi_loadable_module_flag; /* Set after we scan builtin drivers */
void * scsi_init_malloc(unsigned int size, int priority)
{
unsigned long retval;
int order, a_size;
/* Use the statically allocated memory instead of kmalloc (DB) */
#if defined(USE_STATIC_SCSI_MEMORY)
......@@ -2281,10 +2284,17 @@ void * scsi_init_malloc(unsigned int size, int priority)
* For buffers used by the DMA pool, we assume page aligned
* structures.
*/
if(size == PAGE_SIZE)
retval = (unsigned long) __get_dma_pages(priority & GFP_LEVEL_MASK, 0);
else
retval = (unsigned long) kmalloc(size, priority);
if ((size % PAGE_SIZE) == 0) {
for (order = 0, a_size = PAGE_SIZE;
a_size < size; order++, a_size <<= 1)
;
retval =
(unsigned long) __get_dma_pages(priority & GFP_LEVEL_MASK,
order);
}
else
retval = (unsigned long) kmalloc(size, priority);
} else {
/*
* Keep all memory aligned on 16-byte boundaries. Some host
......@@ -2311,6 +2321,8 @@ void * scsi_init_malloc(unsigned int size, int priority)
void scsi_init_free(char * ptr, unsigned int size)
{
int order, a_size;
/* We need to compare addresses to see whether this was kmalloc'd or not */
if((unsigned long) ptr >= scsi_init_memory_start ||
......@@ -2320,10 +2332,14 @@ void scsi_init_free(char * ptr, unsigned int size)
* page aligned data. Besides, it is wasteful to allocate
* page sized chunks with kmalloc.
*/
if(size == PAGE_SIZE)
free_pages((unsigned long)ptr, 0);
else
kfree(ptr);
if ((size % PAGE_SIZE) == 0) {
for (order = 0, a_size = PAGE_SIZE;
a_size < size; order++, a_size <<= 1)
;
free_pages((unsigned long)ptr, order);
}
else
kfree(ptr);
} else {
/* Use the same alignment as scsi_init_malloc() */
size = (size + 15) & ~15;
......
......@@ -130,6 +130,7 @@ extern const unsigned char scsi_command_size[8];
#define SCSI_MAN_TOSHIBA 2
#define SCSI_MAN_NEC_OLDCDR 3
#define SCSI_MAN_SONY 4
#define SCSI_MAN_PIONEER 5
/*
* As the scsi do command functions are intelligent, and may need to
......
......@@ -314,6 +314,8 @@ static void rw_intr (Scsi_Cmnd * SCpnt)
* 19950704 operator@melchior.frmug.fr.net (Thomas Quinot)
*
* - SONY: Same as Nec.
*
* - PIONEER: works with SONY code
*/
static void sr_photocd(struct inode *inode)
......@@ -471,8 +473,9 @@ static void sr_photocd(struct inode *inode)
break;
case SCSI_MAN_SONY: /* Thomas QUINOT <thomas@melchior.frmug.fr.net> */
case SCSI_MAN_PIONEER:
#ifdef DEBUG
printk("sr_photocd: use SONY code\n");
printk("sr_photocd: use SONY/PIONEER code\n");
#endif
memset(buf,0,40);
*((unsigned long*)buf) = 0x0; /* we send nothing... */
......
This diff is collapsed.
......@@ -19,9 +19,12 @@ typedef struct {
int last_result;
int last_result_fatal;
unsigned char *b_data;
int orig_size;
unsigned char *orig_b_data;
} ST_buffer;
typedef struct {
kdev_t devt;
unsigned capacity;
struct wait_queue * waiting;
Scsi_Device* device;
......
......@@ -3,7 +3,7 @@
Copyright 1995 Kai Makisara.
Last modified: Mon Sep 18 21:00:49 1995 by root@kai.makisara.fi
Last modified: Sun Sep 24 11:46:15 1995 by root@kai.makisara.fi
*/
#ifndef _ST_OPTIONS_H
......@@ -15,6 +15,11 @@
case the driver tries to allocate a new tape buffer when none is free. */
#define ST_RUNTIME_BUFFERS 0
/* The minimum limit for the number of SCSI tape devices is determined by
ST_MAX_TAPES. If the number of tape devices and the "slack" defined by
ST_EXTRA_DEVS exceeds ST_MAX_TAPES, the large number is used. */
#define ST_MAX_TAPES 4
/* The driver does not wait for some operations to finish before returning
to the user program if ST_NOWAIT is non-zero. This helps if the SCSI
adapter does not support multiple outstanding commands. However, the user
......
#ifndef _ASMAXP_GENTRAP_H
#define _ASMAXP_GENTRAP_H
/*
* Definitions for gentrap causes. They are generated by user-level
* programs and therefore should be compatible with the corresponding
* OSF/1 definitions.
*/
#define GEN_INTOVF -1 /* integer overflow */
#define GEN_INTDIV -2 /* integer division by zero */
#define GEN_FLTOVF -3 /* fp overflow */
#define GEN_FLTDIV -4 /* fp division by zero */
#define GEN_FLTUND -5 /* fp underflow */
#define GEN_FLTINV -6 /* invalid fp operand */
#define GEN_FLTINE -7 /* inexact fp operand */
#define GEN_DECOVF -8 /* decimal overflow (for COBOL??) */
#define GEN_DECDIV -9 /* decimal division by zero */
#define GEN_DECINV -10 /* invalid decimal operand */
#define GEN_ROPRAND -11 /* reserved operand */
#define GEN_ASSERTERR -12 /* assertion error */
#define GEN_NULPTRERR -13 /* null pointer error */
#define GEN_STKOVF -14 /* stack overflow */
#define GEN_STRLENERR -15 /* string length error */
#define GEN_SUBSTRERR -16 /* substring error */
#define GEN_RANGERR -17 /* range error */
#define GEN_SUBRNG -18
#define GEN_SUBRNG1 -19
#define GEN_SUBRNG2 -20
#define GEN_SUBRNG3 -21 /* these report range errors for */
#define GEN_SUBRNG4 -22 /* subscripting (indexing) at levels 0..7 */
#define GEN_SUBRNG5 -23
#define GEN_SUBRNG6 -24
#define GEN_SUBRNG7 -25
/* the remaining codes (-26..-1023) are reserved. */
#endif /* _ASMAXP_GENTRAP_H */
......@@ -60,6 +60,18 @@ typedef unsigned long sigset_t; /* at least 32 bits */
#define SA_NOMASK 0x00000008
#define SA_ONESHOT 0x00000010
#ifdef __KERNEL__
/*
* These values of sa_flags are used only by the kernel as part of the
* irq handling routines.
*
* SA_INTERRUPT is also used by the irq handling routines.
*/
#define SA_PROBE SA_ONESHOT
#define SA_SAMPLE_RANDOM SA_RESTART
#endif
#define SIG_BLOCK 1 /* for blocking signals */
#define SIG_UNBLOCK 2 /* for unblocking signals */
#define SIG_SETMASK 3 /* for setting the signal mask */
......
......@@ -58,6 +58,18 @@ typedef unsigned long sigset_t; /* at least 32 bits */
#define SA_NOMASK 0x40000000
#define SA_ONESHOT 0x80000000
#ifdef __KERNEL__
/*
* These values of sa_flags are used only by the kernel as part of the
* irq handling routines.
*
* SA_INTERRUPT is also used by the irq handling routines.
*/
#define SA_PROBE SA_ONESHOT
#define SA_SAMPLE_RANDOM SA_RESTART
#endif
#define SIG_BLOCK 0 /* for blocking signals */
#define SIG_UNBLOCK 1 /* for unblocking signals */
#define SIG_SETMASK 2 /* for setting the signal mask */
......
......@@ -4,6 +4,8 @@
#ifndef ASSEMBLY
#include <asm/i82489.h>
#include <linux/tasks.h>
#include <linux/ptrace.h>
/*
* Support definitions for SMP machines following the intel multiprocessing
......@@ -163,7 +165,7 @@ struct cpuinfo_x86
};
extern struct cpuinfo_x86 cpu_data[32];
extern struct cpuinfo_x86 cpu_data[NR_PROCS];
/*
* Private routines/data
......@@ -172,7 +174,7 @@ extern struct cpuinfo_x86 cpu_data[32];
extern void smp_scan_config(unsigned long, unsigned long);
extern unsigned long smp_alloc_memory(unsigned long mem_base);
extern unsigned char *apic_reg;
extern unsigned char *kernel_stacks[32];
extern unsigned char *kernel_stacks[NR_PROCS];
extern unsigned char boot_cpu_id;
extern unsigned long cpu_present_map;
extern void smp_invalidate(void);
......
#define PF_AX25 AF_AX25
#define AX25_MTU 256
#define AX25_MAX_DIGIS 8
#define AX25_MAX_DIGIS 6
typedef struct
{
......@@ -29,7 +29,7 @@ struct ax25_routes_struct
ax25_address port_addr;
ax25_address dest_addr;
unsigned char digi_count;
ax25_address digi_addr[AX25_MAX_DIGIS - 2];
ax25_address digi_addr[AX25_MAX_DIGIS];
};
#define AX25_WINDOW 1
......@@ -45,13 +45,15 @@ struct ax25_routes_struct
#define SIOCAX25ADDUID (SIOCPROTOPRIVATE+1)
#define SIOCAX25DELUID (SIOCPROTOPRIVATE+2)
#define SIOCAX25NOUID (SIOCPROTOPRIVATE+3)
#define SIOCAX25DIGCTL (SIOCPROTOPRIVATE+4)
#define SIOCAX25GETPARMS (SIOCPROTOPRIVATE+5)
#define SIOCAX25SETPARMS (SIOCPROTOPRIVATE+6)
#define AX25_NOUID_DEFAULT 0
#define AX25_NOUID_BLOCK 1
#define AX25_DIGI_INBAND 0x01 /* Allow digipeating within port **/
#define AX25_DIGI_XBAND 0x02 /* Allow digipeating across ports **/
#define AX25_VALUES_IPDEFMODE 0 /* 'D'=DG 'V'=VC */
#define AX25_VALUES_AXDEFMODE 1 /* 8=Normal 128=Extended Seq Nos */
#define AX25_VALUES_NETROM 2 /* Allow NET/ROM - 0=No 1=Yes */
......@@ -64,6 +66,7 @@ struct ax25_routes_struct
#define AX25_VALUES_T2 9 /* Default T2 timeout value */
#define AX25_VALUES_T3 10 /* Default T3 timeout value */
#define AX25_VALUES_N2 11 /* Default N2 value */
#define AX25_VALUES_DIGI 12 /* Digipeat mode */
#define AX25_MAX_VALUES 20
struct ax25_parms_struct
......
......@@ -33,7 +33,6 @@
struct timestamp {
__u8 len;
__u8 ptr;
union {
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 flags:4,
overflow:4;
......@@ -43,8 +42,6 @@ struct timestamp {
#else
#error "Please fix <asm/byteorder.h>"
#endif
__u8 full_char;
} x;
__u32 data[9];
};
......@@ -57,20 +54,39 @@ struct route {
unsigned long route[MAX_ROUTE];
};
#define IPOPT_OPTVAL 0
#define IPOPT_OLEN 1
#define IPOPT_OFFSET 2
#define IPOPT_MINOFF 4
#define MAX_IPOPTLEN 40
#define IPOPT_NOP IPOPT_NOOP
#define IPOPT_EOL IPOPT_END
#define IPOPT_TS IPOPT_TIMESTAMP
#define IPOPT_TS_TSONLY 0 /* timestamps only */
#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
#define IPOPT_TS_PRESPEC 2 /* specified modules only */
struct options {
struct route record_route;
struct route loose_route;
struct route strict_route;
struct timestamp tstamp;
unsigned short security;
unsigned short compartment;
unsigned short handling;
unsigned short stream;
unsigned tcc;
__u32 faddr; /* Saved first hop address */
unsigned char optlen;
unsigned char srr;
unsigned char rr;
unsigned char ts;
unsigned char is_setbyuser:1, /* Set by setsockopt? */
is_data:1, /* Options in __data, rather than skb */
is_strictroute:1, /* Strict source route */
srr_is_hit:1, /* Packet destination addr was our one */
is_changed:1, /* IP checksum more not valid */
rr_needaddr:1, /* Need to record addr of outgoing dev */
ts_needtime:1, /* Need to record timestamp */
ts_needaddr:1; /* Need to record addr of outgoing dev */
unsigned char __pad1;
unsigned char __pad2;
unsigned char __pad3;
unsigned char __data[0];
};
struct iphdr {
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8 ihl:4,
......
......@@ -378,7 +378,7 @@
#define PCI_DEVICE_ID_IMS_8849 0x8849
#define PCI_VENDOR_ID_REALTEK 0x10ec
#define PCI_DEVICE_ID_REALTEK_8300 0x8029
#define PCI_DEVICE_ID_REALTEK_8029 0x8029
#define PCI_VENDOR_ID_VIA 0x1106
#define PCI_DEVICE_ID_VIA_82C505 0x0505
......
/*
* include/linux/random.h
*
* Include file for the random number generator.
*/
/*
* We should always include the random number generator, since it's
* relatively small, and it's most useful when application developers
* can assume that all Linux systems have it. (Ideally, it would be
* best if we could assume that all Unix systems had it, but oh
* well....)
*
* Also, many kernel routines will have a use for good random numbers,
* for example, for truely random TCP sequence numbers, which prevent
* certain forms of TCP spoofing attacks.
*/
#define CONFIG_RANDOM
/* Exported functions */
#ifdef CONFIG_RANDOM
void rand_initialize(void);
void add_keyboard_randomness(unsigned char scancode);
void add_interrupt_randomness(int irq);
void get_random_bytes(void *buf, int nbytes);
int read_random(struct inode * inode, struct file * file,
char * buf, int nbytes);
int read_random_unlimited(struct inode * inode, struct file * file,
char * buf, int nbytes);
#else
#define add_keyboard_randomness(x)
#define add_interrupt_randomness(x)
#endif
......@@ -281,6 +281,7 @@ extern unsigned long itimer_ticks;
extern unsigned long itimer_next;
extern struct timeval xtime;
extern int need_resched;
extern void do_timer(struct pt_regs *);
extern unsigned long * prof_buffer;
extern unsigned long prof_len;
......
......@@ -68,6 +68,7 @@ struct sk_buff {
unsigned long daddr; /* IP target address */
unsigned long raddr; /* IP next hop address */
unsigned long csum; /* Checksum */
unsigned char proto_priv[16]; /* Protocol private data */
volatile char acked, /* Are we acked ? */
used, /* Are we in use ? */
free, /* How to free this buffer */
......
......@@ -90,9 +90,7 @@ struct msghdr
#define IPTOS_RELIABILITY 0x04
#define IP_TTL 2
#define IP_HDRINCL 3
#ifdef V1_3_WILL_DO_THIS_FUNKY_STUFF
#define IP_OPTIONS 4
#endif
#define IP_MULTICAST_IF 32
#define IP_MULTICAST_TTL 33
......
......@@ -15,6 +15,7 @@ struct timezone {
#ifdef __KERNEL__
void do_gettimeofday(struct timeval *tv);
void do_settimeofday(struct timeval *tv);
#endif
#define FD_SETSIZE __FD_SETSIZE
......
......@@ -8,12 +8,20 @@
#define _AX25_H
#include <linux/ax25.h>
#define PR_SLOWHZ 10 /* Run timing at 1/10 second - gives us better resolution for 56kbit links */
#define AX25_T1CLAMPLO (1 * PR_SLOWHZ) /* If defined, clamp at 1 second **/
#define AX25_T1CLAMPHI (30 * PR_SLOWHZ) /* If defined, clamp at 30 seconds **/
#define AX25_BROKEN_NETMAC
#define AX25_BPQ_HEADER_LEN 16
#define AX25_KISS_HEADER_LEN 1
#define AX25_MAX_HEADER_LEN 56
#define AX25_HEADER_LEN 17
#define AX25_ADDR_LEN 7
#define AX25_DIGI_HEADER_LEN (AX25_MAX_DIGIS * AX25_ADDR_LEN)
#define AX25_MAX_HEADER_LEN (AX25_HEADER_LEN + AX25_DIGI_HEADER_LEN)
#define AX25_P_IP 0xCC
#define AX25_P_ARP 0xCD
......@@ -100,7 +108,6 @@
#define AX25_STATE_3 3
#define AX25_STATE_4 4
#define PR_SLOWHZ 10 /* Run timing at 1/10 second - gives us better resolution for 56kbit links */
#define MODULUS 8 /* Standard AX.25 modulus */
#define EMODULUS 128 /* Extended AX.25 modulus */
......@@ -116,6 +123,7 @@
#define AX25_DEF_T2 3
#define AX25_DEF_T3 300
#define AX25_DEF_N2 10
#define AX25_DEF_DIGI (AX25_DIGI_INBAND|AX25_DIGI_XBAND)
typedef struct ax25_uid_assoc {
struct ax25_uid_assoc *next;
......@@ -124,8 +132,8 @@ typedef struct ax25_uid_assoc {
} ax25_uid_assoc;
typedef struct {
ax25_address calls[6];
unsigned char repeated[6];
ax25_address calls[AX25_MAX_DIGIS];
unsigned char repeated[AX25_MAX_DIGIS];
unsigned char ndigi;
char lastrepeat;
} ax25_digi;
......@@ -199,6 +207,7 @@ extern int ax25_dev_ioctl(unsigned int, void *);
/* ax25_subr.c */
extern void ax25_clear_queues(ax25_cb *);
extern void ax25_frames_acked(ax25_cb *, unsigned short);
extern void ax25_requeue_frames(ax25_cb *);
extern int ax25_validate_nr(ax25_cb *, unsigned short);
extern int ax25_decode(ax25_cb *, struct sk_buff *, int *, int *, int *);
extern void ax25_send_control(ax25_cb *, int, int, int);
......
......@@ -86,7 +86,12 @@ extern int ip_build_header(struct sk_buff *skb,
/*extern unsigned short ip_compute_csum(unsigned char * buff, int len);*/
extern int ip_rcv(struct sk_buff *skb, struct device *dev,
struct packet_type *pt);
extern int ip_forward(struct sk_buff *skb, struct device *dev, int is_frag, unsigned long target_addr, int target_strict);
extern int ip_forward(struct sk_buff *skb, struct device *dev,
int is_frag, __u32 target_addr);
extern int ip_options_echo(struct options * dopt, struct options * sopt,
__u32 daddr, __u32 saddr,
struct sk_buff * skb);
extern int ip_options_compile(struct options * opt, struct sk_buff * skb);
extern void ip_send_check(struct iphdr *ip);
extern int ip_id_count;
extern void ip_queue_xmit(struct sock *sk,
......@@ -104,6 +109,8 @@ extern int ip_build_xmit(struct sock *sk,
const void *frag,
unsigned short int length,
__u32 daddr,
__u32 saddr,
struct options * opt,
int flags,
int type);
......
......@@ -8,6 +8,9 @@
#define _NETROM_H
#include <linux/netrom.h>
#define NR_T1CLAMPLO (1 * PR_SLOWHZ) /* If defined, clamp at 1 second **/
#define NR_T1CLAMPHI (300 * PR_SLOWHZ) /* If defined, clamp at 30 seconds **/
#define NR_NETWORK_LEN 15
#define NR_TRANSPORT_LEN 5
......@@ -32,8 +35,8 @@
#define NR_STATE_2 2
#define NR_STATE_3 3
#define NR_DEFAULT_T1 (120 * PR_SLOWHZ) /* Outstanding frames - 10 seconds */
#define NR_DEFAULT_T2 (5 * PR_SLOWHZ) /* Response delay - 3 seconds */
#define NR_DEFAULT_T1 (120 * PR_SLOWHZ) /* Outstanding frames - 120 seconds */
#define NR_DEFAULT_T2 (5 * PR_SLOWHZ) /* Response delay - 5 seconds */
#define NR_DEFAULT_N2 3 /* Number of Retries */
#define NR_DEFAULT_T4 (180 * PR_SLOWHZ) /* Transport Busy Delay */
#define NR_DEFAULT_WINDOW 4 /* Default Window Size */
......@@ -90,7 +93,6 @@ struct nr_neigh {
extern struct nr_parms_struct nr_default;
extern int nr_rx_frame(struct sk_buff *, struct device *);
extern void nr_destroy_socket(struct sock *);
/*extern int nr_get_info(char *, char **, off_t, int, int);*/
/* nr_dev.c */
extern int nr_rx_ip(struct sk_buff *, struct device *);
......@@ -106,7 +108,6 @@ extern void nr_output(struct sock *, struct sk_buff *);
extern void nr_send_nak_frame(struct sock *);
extern void nr_kick(struct sock *);
extern void nr_transmit_buffer(struct sock *, struct sk_buff *);
extern void nr_nr_error_recovery(struct sock *);
extern void nr_establish_data_link(struct sock *);
extern void nr_enquiry_response(struct sock *);
extern void nr_check_iframes_acked(struct sock *, unsigned short);
......
......@@ -63,6 +63,7 @@ extern void aha1542_setup(char *str, int *ints);
extern void aic7xxx_setup(char *str, int *ints);
extern void buslogic_setup(char *str, int *ints);
extern void fdomain_setup(char *str, int *ints);
extern void NCR53c406a_setup(char *str, int *ints);
extern void scsi_luns_setup(char *str, int *ints);
extern void sound_setup(char *str, int *ints);
#ifdef CONFIG_CDU31A
......@@ -206,6 +207,9 @@ struct {
#ifdef CONFIG_SCSI_BUSLOGIC
{ "buslogic=", buslogic_setup},
#endif
#ifdef CONFIG_SCSI_NCR53C406A
{ "ncr53c406a=", NCR53c406a_setup},
#endif
#ifdef CONFIG_SCSI_FUTURE_DOMAIN
{ "fdomain=", fdomain_setup},
#endif
......@@ -426,6 +430,7 @@ asmlinkage void start_kernel(void)
trap_init();
init_IRQ();
sched_init();
time_init();
parse_options(command_line);
init_modules();
#ifdef CONFIG_PROFILE
......@@ -464,7 +469,6 @@ asmlinkage void start_kernel(void)
memory_start = name_cache_init(memory_start,memory_end);
mem_init(memory_start,memory_end);
buffer_init();
time_init();
sock_init();
#ifdef CONFIG_SYSVIPC
ipc_init();
......
......@@ -191,11 +191,11 @@ int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs)
goto bad_fork;
new_stack = get_free_page(GFP_KERNEL);
if (!new_stack)
goto bad_fork_free;
goto bad_fork_free_p;
error = -EAGAIN;
nr = find_empty_process();
if (nr < 0)
goto bad_fork_free;
goto bad_fork_free_stack;
*p = *current;
......@@ -263,8 +263,9 @@ int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs)
task[nr] = NULL;
REMOVE_LINKS(p);
nr_tasks--;
bad_fork_free:
bad_fork_free_stack:
free_page(new_stack);
bad_fork_free_p:
kfree(p);
bad_fork:
return error;
......
......@@ -235,6 +235,8 @@ struct symbol_table symbol_table = {
X(free_irq),
X(enable_irq),
X(disable_irq),
X(probe_irq_on),
X(probe_irq_off),
X(bh_active),
X(bh_mask),
X(bh_base),
......
......@@ -32,8 +32,6 @@
#include <asm/segment.h>
#include <asm/pgtable.h>
#define TIMER_IRQ 0
#include <linux/timex.h>
/*
......@@ -78,8 +76,6 @@ unsigned long prof_shift = 0;
extern void mem_use(void);
extern int timer_interrupt(void);
static unsigned long init_kernel_stack[1024] = { STACK_MAGIC, };
unsigned long init_user_stack[1024] = { STACK_MAGIC, };
static struct vm_area_struct init_mmap = INIT_MMAP;
......@@ -633,20 +629,10 @@ void immediate_bh(void * unused)
run_task_queue(&tq_immediate);
}
/*
* The int argument is really a (struct pt_regs *), in case the
* interrupt wants to know from where it was called. The timer
* irq uses this to decide if it should update the user or system
* times.
*/
static void do_timer(int irq, struct pt_regs * regs)
void do_timer(struct pt_regs * regs)
{
unsigned long mask;
struct timer_struct *tp;
/* last time the cmos clock got updated */
static long last_rtc_update=0;
extern int set_rtc_mmss(unsigned long);
long ltemp, psecs;
/* Advance the phase, once it gets to one microsecond, then
......@@ -695,18 +681,6 @@ static void do_timer(int irq, struct pt_regs * regs)
second_overflow();
}
/* If we have an externally synchronized Linux clock, then update
* CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
* called as close as possible to 500 ms before the new second starts.
*/
if (time_state != TIME_BAD && xtime.tv_sec > last_rtc_update + 660 &&
xtime.tv_usec > 500000 - (tick >> 1) &&
xtime.tv_usec < 500000 + (tick >> 1))
if (set_rtc_mmss(xtime.tv_sec) == 0)
last_rtc_update = xtime.tv_sec;
else
last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */
jiffies++;
calc_load();
if (user_mode(regs)) {
......@@ -904,8 +878,6 @@ void sched_init(void)
bh_base[TIMER_BH].routine = timer_bh;
bh_base[TQUEUE_BH].routine = tqueue_bh;
bh_base[IMMEDIATE_BH].routine = immediate_bh;
if (request_irq(TIMER_IRQ, do_timer, 0, "timer") != 0)
panic("Could not allocate timer IRQ!");
enable_bh(TIMER_BH);
enable_bh(TQUEUE_BH);
enable_bh(IMMEDIATE_BH);
......
......@@ -14,11 +14,6 @@
* Created file with time related functions from sched.c and adjtimex()
* 1993-10-08 Torsten Duwe
* adjtime interface update and CMOS clock write code
* 1994-07-02 Alan Modra
* fixed set_rtc_mmss, fixed time.year for >= 2000, new mktime
* 1995-03-26 Markus Kuhn
* fixed 500 ms bug at call to set_rtc_mmss, fixed DS12887
* precision CMOS clock update
* 1995-08-13 Torsten Duwe
* kernel PLL updated to 1994-12-13 specs (rfc-1489)
*/
......@@ -29,92 +24,8 @@
#include <linux/param.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <asm/segment.h>
#include <asm/io.h>
#include <linux/mc146818rtc.h>
#include <linux/timex.h>
/* Converts Gregorian date to seconds since 1970-01-01 00:00:00.
* Assumes input in normal date format, i.e. 1980-12-31 23:59:59
* => year=1980, mon=12, day=31, hour=23, min=59, sec=59.
*
* [For the Julian calendar (which was used in Russia before 1917,
* Britain & colonies before 1752, anywhere else before 1582,
* and is still in use by some communities) leave out the
* -year/100+year/400 terms, and add 10.]
*
* This algorithm was first published by Gauss (I think).
*
* WARNING: this function will overflow on 2106-02-07 06:28:16 on
* machines were long is 32-bit! (However, as time_t is signed, we
* will already get problems at other places on 2038-01-19 03:14:08)
*/
static inline unsigned long mktime(unsigned int year, unsigned int mon,
unsigned int day, unsigned int hour,
unsigned int min, unsigned int sec)
{
if (0 >= (int) (mon -= 2)) { /* 1..12 -> 11,12,1..10 */
mon += 12; /* Puts Feb last since it has leap day */
year -= 1;
}
return (((
(unsigned long)(year/4 - year/100 + year/400 + 367*mon/12 + day) +
year*365 - 719499
)*24 + hour /* now have hours */
)*60 + min /* now have minutes */
)*60 + sec; /* finally seconds */
}
void time_init(void)
{
unsigned int year, mon, day, hour, min, sec;
int i;
/* The Linux interpretation of the CMOS clock register contents:
* When the Update-In-Progress (UIP) flag goes from 1 to 0, the
* RTC registers show the second which has precisely just started.
* Let's hope other operating systems interpret the RTC the same way.
*/
/* read RTC exactly on falling edge of update flag */
for (i = 0 ; i < 1000000 ; i++) /* may take up to 1 second... */
if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)
break;
for (i = 0 ; i < 1000000 ; i++) /* must try at least 2.228 ms */
if (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP))
break;
do { /* Isn't this overkill ? UIP above should guarantee consistency */
sec = CMOS_READ(RTC_SECONDS);
min = CMOS_READ(RTC_MINUTES);
hour = CMOS_READ(RTC_HOURS);
day = CMOS_READ(RTC_DAY_OF_MONTH);
mon = CMOS_READ(RTC_MONTH);
year = CMOS_READ(RTC_YEAR);
} while (sec != CMOS_READ(RTC_SECONDS));
if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
{
BCD_TO_BIN(sec);
BCD_TO_BIN(min);
BCD_TO_BIN(hour);
BCD_TO_BIN(day);
BCD_TO_BIN(mon);
BCD_TO_BIN(year);
}
#ifdef ALPHA_PRE_V1_2_SRM_CONSOLE
/*
* The meaning of life, the universe, and everything. Plus
* this makes the year come out right on SRM consoles earlier
* than v1.2.
*/
year -= 42;
#endif
if ((year += 1900) < 1970)
year += 100;
xtime.tv_sec = mktime(year, mon, day, hour, min, sec);
xtime.tv_usec = 0;
}
/*
* The timezone where the local system is located. Used as a default by some
* programs who obtain this value by using gettimeofday.
......@@ -123,11 +34,11 @@ struct timezone sys_tz = { 0, 0};
asmlinkage int sys_time(int * tloc)
{
int i, error;
int i;
i = CURRENT_TIME;
if (tloc) {
error = verify_area(VERIFY_WRITE, tloc, sizeof(*tloc));
int error = verify_area(VERIFY_WRITE, tloc, sizeof(*tloc));
if (error)
return error;
put_user(i,tloc);
......@@ -155,81 +66,6 @@ asmlinkage int sys_stime(int * tptr)
return 0;
}
/* This function must be called with interrupts disabled
* It was inspired by Steve McCanne's microtime-i386 for BSD. -- jrs
*
* However, the pc-audio speaker driver changes the divisor so that
* it gets interrupted rather more often - it loads 64 into the
* counter rather than 11932! This has an adverse impact on
* do_gettimeoffset() -- it stops working! What is also not
* good is that the interval that our timer function gets called
* is no longer 10.0002 ms, but 9.9767 ms. To get around this
* would require using a different timing source. Maybe someone
* could use the RTC - I know that this can interrupt at frequencies
* ranging from 8192Hz to 2Hz. If I had the energy, I'd somehow fix
* it so that at startup, the timer code in sched.c would select
* using either the RTC or the 8253 timer. The decision would be
* based on whether there was any other device around that needed
* to trample on the 8253. I'd set up the RTC to interrupt at 1024 Hz,
* and then do some jiggery to have a version of do_timer that
* advanced the clock by 1/1024 s. Every time that reached over 1/100
* of a second, then do all the old code. If the time was kept correct
* then do_gettimeoffset could just return 0 - there is no low order
* divider that can be accessed.
*
* Ideally, you would be able to use the RTC for the speaker driver,
* but it appears that the speaker driver really needs interrupt more
* often than every 120 us or so.
*
* Anyway, this needs more thought.... pjsg (1993-08-28)
*
* If you are really that interested, you should be reading
* comp.protocols.time.ntp!
*/
#define TICK_SIZE tick
static inline unsigned long do_gettimeoffset(void)
{
int count;
unsigned long offset = 0;
/* timer count may underflow right here */
outb_p(0x00, 0x43); /* latch the count ASAP */
count = inb_p(0x40); /* read the latched count */
count |= inb(0x40) << 8;
/* we know probability of underflow is always MUCH less than 1% */
if (count > (LATCH - LATCH/100)) {
/* check for pending timer interrupt */
outb_p(0x0a, 0x20);
if (inb(0x20) & 1)
offset = TICK_SIZE;
}
count = ((LATCH-1) - count) * TICK_SIZE;
count = (count + LATCH/2) / LATCH;
return offset + count;
}
/*
* This version of gettimeofday has near microsecond resolution.
*/
void do_gettimeofday(struct timeval *tv)
{
unsigned long flags;
save_flags(flags);
cli();
*tv = xtime;
#if defined (__i386__) || defined (__mips__)
tv->tv_usec += do_gettimeoffset();
if (tv->tv_usec >= 1000000) {
tv->tv_usec -= 1000000;
tv->tv_sec++;
}
#endif /* !defined (__i386__) && !defined (__mips__) */
restore_flags(flags);
}
asmlinkage int sys_gettimeofday(struct timeval *tv, struct timezone *tz)
{
int error;
......@@ -312,27 +148,8 @@ asmlinkage int sys_settimeofday(struct timeval *tv, struct timezone *tz)
warp_clock();
}
}
if (tv) {
cli();
/* This is revolting. We need to set the xtime.tv_usec
* correctly. However, the value in this location is
* is value at the last tick.
* Discover what correction gettimeofday
* would have done, and then undo it!
*/
new_tv.tv_usec -= do_gettimeoffset();
if (new_tv.tv_usec < 0) {
new_tv.tv_usec += 1000000;
new_tv.tv_sec--;
}
xtime = new_tv;
time_state = TIME_BAD;
time_maxerror = 0x70000000;
time_esterror = 0x70000000;
sti();
}
if (tv)
do_settimeofday(&new_tv);
return 0;
}
......@@ -511,63 +328,3 @@ asmlinkage int sys_adjtimex(struct timex *txc_p)
memcpy_tofs(txc_p, &txc, sizeof(struct timex));
return time_state;
}
/*
* In order to set the CMOS clock precisely, set_rtc_mmss has to be
* called 500 ms after the second nowtime has started, because when
* nowtime is written into the registers of the CMOS clock, it will
* jump to the next second precisely 500 ms later. Check the Motorola
* MC146818A or Dallas DS12887 data sheet for details.
*/
int set_rtc_mmss(unsigned long nowtime)
{
int retval = 0;
int real_seconds, real_minutes, cmos_minutes;
unsigned char save_control, save_freq_select;
save_control = CMOS_READ(RTC_CONTROL); /* tell the clock it's being set */
CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL);
save_freq_select = CMOS_READ(RTC_FREQ_SELECT); /* stop and reset prescaler */
CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
cmos_minutes = CMOS_READ(RTC_MINUTES);
if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
BCD_TO_BIN(cmos_minutes);
/* since we're only adjusting minutes and seconds,
* don't interfere with hour overflow. This avoids
* messing with unknown time zones but requires your
* RTC not to be off by more than 15 minutes
*/
real_seconds = nowtime % 60;
real_minutes = nowtime / 60;
if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
real_minutes += 30; /* correct for half hour time zone */
real_minutes %= 60;
if (abs(real_minutes - cmos_minutes) < 30)
{
if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
{
BIN_TO_BCD(real_seconds);
BIN_TO_BCD(real_minutes);
}
CMOS_WRITE(real_seconds,RTC_SECONDS);
CMOS_WRITE(real_minutes,RTC_MINUTES);
}
else
retval = -1;
/* The following flags have to be released exactly in this order,
* otherwise the DS12887 (popular MC146818A clone with integrated
* battery and quartz) will not reset the oscillator and will not
* update precisely 500 ms later. You won't find this mentioned in
* the Dallas Semiconductor data sheets, but who believes data
* sheets anyway ... -- Markus Kuhn
*/
CMOS_WRITE(save_control, RTC_CONTROL);
CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
return retval;
}
......@@ -223,13 +223,19 @@ o Added ip_forward to ksyms for IPIP etc [IN]
o Appletalk TIOCINQ/TIOCOUTQ bug fix [IN]
o Rewrote the IFF_UP/IFF_DOWN handling code [IN]
-------->>>>> 1.3.29 <<<<<-------
o Major AX.25/NetROM fixes [John Naylor] [IN]
o Error in ip_mr ioctls fixed [Michael Chastain] [IN]
o TCP cache zap bugs hopefully fixed [IN]
o Length checks in udp/raw sending [Craig Metz] [IN]
---------- Things I thought Linus had for a while and not merged ----------------
o Paul Gortmakers 8390 Copy and checksum [PLEASE ADD 8)]
o Paul Gortmakers 8390 Copy and checksum [Pending]
---------- Things pending from other people to chase -------------
o Tom May's insw_and_checksum()
---------- Things pending for me to merge --------------
......@@ -237,8 +243,9 @@ o IPFW support for TOS changing (Al Longyear)
o /dev/skip /dev/ipah etc - Kernel/Usermode communications module (me)
o AF_UNIX garbage collect code
o Faster closedown option for heavy use sites (me)
o Tom May's insw_and_checksum()
o NEW NET TOOLS..... - wanted one net tools maintainer....
--------------- Tbings That Need Doing Before 1.4 ------------------
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -52,8 +52,8 @@ static void ax25_timer(unsigned long);
*/
void ax25_set_timer(ax25_cb *ax25)
{
unsigned long flags;
unsigned long flags;
save_flags(flags);
cli();
del_timer(&ax25->timer);
......@@ -96,7 +96,7 @@ static void ax25_timer(unsigned long param)
case AX25_STATE_0:
/* Magic here: If we listen() and a new link dies before it
is accepted() it isnt 'dead' so doesnt get removed. */
if ((ax25->sk != NULL && ax25->sk->dead) || ax25->sk == NULL) {
if (ax25->sk == NULL || ax25->sk->destroy || (ax25->sk->state == TCP_LISTEN && ax25->sk->dead)) {
del_timer(&ax25->timer);
ax25_destroy_socket(ax25);
return;
......
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