Commit 564ea1ed authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.36

parent 9fbbbed3
......@@ -290,12 +290,13 @@ CONFIG_BLK_DEV_RZ1000
Intel 82371 PIIX (Triton I/II) DMA support
CONFIG_BLK_DEV_TRITON
If your PCI system uses an IDE harddrive (as opposed to SCSI, say)
and includes the Intel Triton I/II IDE interface chipset (i82371FB
or i82371SB), you will want to enable this option to allow use of
bus-mastering DMA data transfers. Read the comments at the beginning
of drivers/block/triton.c and Documentation/ide.txt. You can get
the latest version of the hdparm utility via ftp (user: anonymous)
from sunsite.unc.edu/pub/Linux/kernel/patches/diskdrives/; it is
and includes the Intel Triton I/II IDE interface chipset (i82371FB,
i82371SB or i82371AB), you will want to enable this option to allow
use of bus-mastering DMA data transfers. Read the comments at the
beginning of drivers/block/triton.c and Documentation/ide.txt.
You can get the latest version of the hdparm utility via
ftp (user: anonymous) from
sunsite.unc.edu/pub/Linux/kernel/patches/diskdrives/; it is
used to tune your harddisk. It is safe to say Y to this question.
Other IDE chipset support
......
......@@ -10,21 +10,8 @@
NM := nm -B
ifdef CONFIG_CROSSCOMPILE
# enable this for linking under OSF/1:
LINKFLAGS = -non_shared -T 0xfffffc0000310000 -N
else
elf=$(shell if $(LD) --help | grep elf64alpha >/dev/null; then echo yes; fi)
ifeq ($(elf),yes)
LINKFLAGS = -static -Ttext 0xfffffc0000310000 -N
else
LINKFLAGS = -static -T arch/alpha/vmlinux.lds -N
endif
# GNU gcc/cc1/as can use pipes instead of temporary files
CFLAGS := $(CFLAGS) -pipe
endif
CFLAGS := $(CFLAGS) -mno-fp-regs -ffixed-8
LINKFLAGS = -static -T arch/alpha/vmlinux.lds -N
CFLAGS := $(CFLAGS) -pipe -mno-fp-regs -ffixed-8
HEAD := arch/alpha/kernel/head.o
......
......@@ -759,6 +759,6 @@ sys_call_table:
.quad sys_setfsuid, sys_setfsgid, sys_ustat, sys_statfs, sys_fstatfs
.quad sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler, sys_sched_yield
.quad sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, do_entSys /* sys_afs_syscall */, sys_newuname
.quad sys_nanosleep, sys_mremap, do_entSys, sys_setresuid, sys_getresuid
.quad sys_nanosleep, sys_mremap, sys_nfsservctl, sys_setresuid, sys_getresuid
.quad sys_pciconfig_read, sys_pciconfig_write, sys_query_module
.quad do_entSys, do_entSys
......@@ -33,6 +33,7 @@
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/sysinfo.h>
extern int do_mount(kdev_t, const char *, const char *, char *, int, void *);
extern int do_pipe(int *);
......@@ -840,62 +841,91 @@ asmlinkage long osf_sysinfo(int command, char *buf, long count)
return err;
}
asmlinkage unsigned long osf_getsysinfo(unsigned long op, void *buffer, unsigned long nbytes,
asmlinkage unsigned long osf_getsysinfo(unsigned long op, void *buffer,
unsigned long nbytes,
int *start, void *arg)
{
extern unsigned long rdfpcr(void);
unsigned long fpcw;
unsigned long ret = -EOPNOTSUPP;
unsigned long w;
lock_kernel();
switch (op) {
case 45: /* GSI_IEEE_FP_CONTROL */
case GSI_IEEE_FP_CONTROL:
/* build and return current fp control word: */
fpcw = current->tss.flags & IEEE_TRAP_ENABLE_MASK;
fpcw |= ((rdfpcr() >> 52) << 17) & IEEE_STATUS_MASK;
put_user(fpcw, (unsigned long *) buffer);
ret = 0;
break;
case 46: /* GSI_IEEE_STATE_AT_SIGNAL */
w = current->tss.flags & IEEE_TRAP_ENABLE_MASK;
w |= ((rdfpcr() >> 52) << 17) & IEEE_STATUS_MASK;
if (put_user(w, (unsigned long *) buffer))
return -EFAULT;
return 0;
case GSI_IEEE_STATE_AT_SIGNAL:
/*
* Not sure anybody will ever use this weird stuff. These
* ops can be used (under OSF/1) to set the fpcr that should
* be used when a signal handler starts executing.
*/
break;
case GSI_UACPROC:
w = (current->tss.flags >> UAC_SHIFT) & UAC_BITMASK;
if (put_user(w, (unsigned int *)buffer))
return -EFAULT;
return 0;
default:
break;
}
unlock_kernel();
return ret;
return -EOPNOTSUPP;
}
asmlinkage unsigned long osf_setsysinfo(unsigned long op, void *buffer, unsigned long nbytes,
asmlinkage unsigned long osf_setsysinfo(unsigned long op, void *buffer,
unsigned long nbytes,
int *start, void *arg)
{
unsigned long fpcw;
unsigned long ret = -EOPNOTSUPP;
unsigned long v, w, i;
lock_kernel();
switch (op) {
case 14: /* SSI_IEEE_FP_CONTROL */
case SSI_IEEE_FP_CONTROL:
/* update trap enable bits: */
get_user(fpcw, (unsigned long *) buffer);
if (get_user(w, (unsigned long *) buffer))
return -EFAULT;
current->tss.flags &= ~IEEE_TRAP_ENABLE_MASK;
current->tss.flags |= (fpcw & IEEE_TRAP_ENABLE_MASK);
ret = 0;
break;
case 15: /* SSI_IEEE_STATE_AT_SIGNAL */
case 16: /* SSI_IEEE_IGNORE_STATE_AT_SIGNAL */
current->tss.flags |= (w & IEEE_TRAP_ENABLE_MASK);
return 0;
case SSI_IEEE_STATE_AT_SIGNAL:
case SSI_IEEE_IGNORE_STATE_AT_SIGNAL:
/*
* Not sure anybody will ever use this weird stuff. These
* ops can be used (under OSF/1) to set the fpcr that should
* be used when a signal handler starts executing.
*/
break;
case SSI_NVPAIRS:
for (i = 0; i < nbytes; ++i) {
if (get_user(v, 2*i + (unsigned int *)buffer))
return -EFAULT;
if (get_user(w, 2*i + 1 + (unsigned int *)buffer))
return -EFAULT;
switch (v) {
case SSIN_UACPROC:
current->tss.flags &=
~(UAC_BITMASK << UAC_SHIFT);
current->tss.flags |=
(w & UAC_BITMASK) << UAC_SHIFT;
break;
default:
return -EOPNOTSUPP;
}
}
return 0;
default:
break;
}
unlock_kernel();
return ret;
return -EOPNOTSUPP;
}
......@@ -80,18 +80,17 @@ asmlinkage int do_sigsuspend(unsigned long mask, struct pt_regs * regs, struct s
{
unsigned long oldmask;
lock_kernel();
spin_lock_irq(&current->sigmask_lock);
oldmask = current->blocked;
current->blocked = mask & _BLOCKABLE;
spin_unlock_irq(&current->sigmask_lock);
while (1) {
current->state = TASK_INTERRUPTIBLE;
schedule();
if (do_signal(oldmask,regs, sw, 0, 0))
goto out;
}
out:
unlock_kernel();
if (do_signal(oldmask, regs, sw, 0, 0))
return -EINTR;
}
}
/*
......@@ -104,60 +103,64 @@ asmlinkage void do_sigreturn(struct sigcontext * sc,
int i;
/* verify that it's a good sigcontext before using it */
lock_kernel();
if (verify_area(VERIFY_READ, sc, sizeof(*sc)))
do_exit(SIGSEGV);
get_user(ps, &sc->sc_ps);
if (ps != 8)
do_exit(SIGSEGV);
get_user(mask, &sc->sc_mask);
if (mask & ~_BLOCKABLE)
do_exit(SIGSEGV);
goto give_sigsegv;
if (__get_user(ps, &sc->sc_ps) || ps != 8)
goto give_sigsegv;
if (__get_user(mask, &sc->sc_mask) || (mask & ~_BLOCKABLE))
goto give_sigsegv;
/* ok, looks fine, start restoring */
get_user(usp, sc->sc_regs+30);
__get_user(usp, sc->sc_regs+30);
wrusp(usp);
get_user(regs->pc, &sc->sc_pc);
__get_user(regs->pc, &sc->sc_pc);
sw->r26 = (unsigned long) ret_from_sys_call;
current->blocked = mask;
get_user(regs->r0, sc->sc_regs+0);
get_user(regs->r1, sc->sc_regs+1);
get_user(regs->r2, sc->sc_regs+2);
get_user(regs->r3, sc->sc_regs+3);
get_user(regs->r4, sc->sc_regs+4);
get_user(regs->r5, sc->sc_regs+5);
get_user(regs->r6, sc->sc_regs+6);
get_user(regs->r7, sc->sc_regs+7);
get_user(regs->r8, sc->sc_regs+8);
get_user(sw->r9, sc->sc_regs+9);
get_user(sw->r10, sc->sc_regs+10);
get_user(sw->r11, sc->sc_regs+11);
get_user(sw->r12, sc->sc_regs+12);
get_user(sw->r13, sc->sc_regs+13);
get_user(sw->r14, sc->sc_regs+14);
get_user(sw->r15, sc->sc_regs+15);
get_user(regs->r16, sc->sc_regs+16);
get_user(regs->r17, sc->sc_regs+17);
get_user(regs->r18, sc->sc_regs+18);
get_user(regs->r19, sc->sc_regs+19);
get_user(regs->r20, sc->sc_regs+20);
get_user(regs->r21, sc->sc_regs+21);
get_user(regs->r22, sc->sc_regs+22);
get_user(regs->r23, sc->sc_regs+23);
get_user(regs->r24, sc->sc_regs+24);
get_user(regs->r25, sc->sc_regs+25);
get_user(regs->r26, sc->sc_regs+26);
get_user(regs->r27, sc->sc_regs+27);
get_user(regs->r28, sc->sc_regs+28);
get_user(regs->gp, sc->sc_regs+29);
__get_user(regs->r0, sc->sc_regs+0);
__get_user(regs->r1, sc->sc_regs+1);
__get_user(regs->r2, sc->sc_regs+2);
__get_user(regs->r3, sc->sc_regs+3);
__get_user(regs->r4, sc->sc_regs+4);
__get_user(regs->r5, sc->sc_regs+5);
__get_user(regs->r6, sc->sc_regs+6);
__get_user(regs->r7, sc->sc_regs+7);
__get_user(regs->r8, sc->sc_regs+8);
__get_user(sw->r9, sc->sc_regs+9);
__get_user(sw->r10, sc->sc_regs+10);
__get_user(sw->r11, sc->sc_regs+11);
__get_user(sw->r12, sc->sc_regs+12);
__get_user(sw->r13, sc->sc_regs+13);
__get_user(sw->r14, sc->sc_regs+14);
__get_user(sw->r15, sc->sc_regs+15);
__get_user(regs->r16, sc->sc_regs+16);
__get_user(regs->r17, sc->sc_regs+17);
__get_user(regs->r18, sc->sc_regs+18);
__get_user(regs->r19, sc->sc_regs+19);
__get_user(regs->r20, sc->sc_regs+20);
__get_user(regs->r21, sc->sc_regs+21);
__get_user(regs->r22, sc->sc_regs+22);
__get_user(regs->r23, sc->sc_regs+23);
__get_user(regs->r24, sc->sc_regs+24);
__get_user(regs->r25, sc->sc_regs+25);
__get_user(regs->r26, sc->sc_regs+26);
__get_user(regs->r27, sc->sc_regs+27);
__get_user(regs->r28, sc->sc_regs+28);
__get_user(regs->gp, sc->sc_regs+29);
for (i = 0; i < 31; i++)
get_user(sw->fp[i], sc->sc_fpregs+i);
__get_user(sw->fp[i], sc->sc_fpregs+i);
/* send SIGTRAP if we're single-stepping: */
lock_kernel();
if (ptrace_cancel_bpt (current))
send_sig(SIGTRAP, current, 1);
unlock_kernel();
return;
give_sigsegv:
lock_kernel();
do_exit(SIGSEGV);
unlock_kernel();
}
/*
......@@ -181,46 +184,46 @@ static void setup_frame(struct sigaction * sa,
wrusp((unsigned long) sc);
put_user(oldmask, &sc->sc_mask);
put_user(8, &sc->sc_ps);
put_user(regs->pc, &sc->sc_pc);
put_user(oldsp, sc->sc_regs+30);
put_user(regs->r0 , sc->sc_regs+0);
put_user(regs->r1 , sc->sc_regs+1);
put_user(regs->r2 , sc->sc_regs+2);
put_user(regs->r3 , sc->sc_regs+3);
put_user(regs->r4 , sc->sc_regs+4);
put_user(regs->r5 , sc->sc_regs+5);
put_user(regs->r6 , sc->sc_regs+6);
put_user(regs->r7 , sc->sc_regs+7);
put_user(regs->r8 , sc->sc_regs+8);
put_user(sw->r9 , sc->sc_regs+9);
put_user(sw->r10 , sc->sc_regs+10);
put_user(sw->r11 , sc->sc_regs+11);
put_user(sw->r12 , sc->sc_regs+12);
put_user(sw->r13 , sc->sc_regs+13);
put_user(sw->r14 , sc->sc_regs+14);
put_user(sw->r15 , sc->sc_regs+15);
put_user(regs->r16, sc->sc_regs+16);
put_user(regs->r17, sc->sc_regs+17);
put_user(regs->r18, sc->sc_regs+18);
put_user(regs->r19, sc->sc_regs+19);
put_user(regs->r20, sc->sc_regs+20);
put_user(regs->r21, sc->sc_regs+21);
put_user(regs->r22, sc->sc_regs+22);
put_user(regs->r23, sc->sc_regs+23);
put_user(regs->r24, sc->sc_regs+24);
put_user(regs->r25, sc->sc_regs+25);
put_user(regs->r26, sc->sc_regs+26);
put_user(regs->r27, sc->sc_regs+27);
put_user(regs->r28, sc->sc_regs+28);
put_user(regs->gp , sc->sc_regs+29);
__put_user(oldmask, &sc->sc_mask);
__put_user(8, &sc->sc_ps);
__put_user(regs->pc, &sc->sc_pc);
__put_user(oldsp, sc->sc_regs+30);
__put_user(regs->r0 , sc->sc_regs+0);
__put_user(regs->r1 , sc->sc_regs+1);
__put_user(regs->r2 , sc->sc_regs+2);
__put_user(regs->r3 , sc->sc_regs+3);
__put_user(regs->r4 , sc->sc_regs+4);
__put_user(regs->r5 , sc->sc_regs+5);
__put_user(regs->r6 , sc->sc_regs+6);
__put_user(regs->r7 , sc->sc_regs+7);
__put_user(regs->r8 , sc->sc_regs+8);
__put_user(sw->r9 , sc->sc_regs+9);
__put_user(sw->r10 , sc->sc_regs+10);
__put_user(sw->r11 , sc->sc_regs+11);
__put_user(sw->r12 , sc->sc_regs+12);
__put_user(sw->r13 , sc->sc_regs+13);
__put_user(sw->r14 , sc->sc_regs+14);
__put_user(sw->r15 , sc->sc_regs+15);
__put_user(regs->r16, sc->sc_regs+16);
__put_user(regs->r17, sc->sc_regs+17);
__put_user(regs->r18, sc->sc_regs+18);
__put_user(regs->r19, sc->sc_regs+19);
__put_user(regs->r20, sc->sc_regs+20);
__put_user(regs->r21, sc->sc_regs+21);
__put_user(regs->r22, sc->sc_regs+22);
__put_user(regs->r23, sc->sc_regs+23);
__put_user(regs->r24, sc->sc_regs+24);
__put_user(regs->r25, sc->sc_regs+25);
__put_user(regs->r26, sc->sc_regs+26);
__put_user(regs->r27, sc->sc_regs+27);
__put_user(regs->r28, sc->sc_regs+28);
__put_user(regs->gp , sc->sc_regs+29);
for (i = 0; i < 31; i++)
put_user(sw->fp[i], sc->sc_fpregs+i);
put_user(regs->trap_a0, &sc->sc_traparg_a0);
put_user(regs->trap_a1, &sc->sc_traparg_a1);
put_user(regs->trap_a2, &sc->sc_traparg_a2);
__put_user(sw->fp[i], sc->sc_fpregs+i);
__put_user(regs->trap_a0, &sc->sc_traparg_a0);
__put_user(regs->trap_a1, &sc->sc_traparg_a1);
__put_user(regs->trap_a2, &sc->sc_traparg_a2);
/*
* The following is:
......@@ -231,8 +234,8 @@ static void setup_frame(struct sigaction * sa,
*
* ie, "sigreturn(stack-pointer)"
*/
put_user(0x43ecf40047de0410, sc->sc_retcode+0);
put_user(0x0000000000000083, sc->sc_retcode+1);
__put_user(0x43ecf40047de0410, sc->sc_retcode+0);
__put_user(0x0000000000000083, sc->sc_retcode+1);
imb();
/* "return" to the handler */
......
This diff is collapsed.
......@@ -150,7 +150,7 @@ void mem_init(unsigned long start_mem, unsigned long end_mem)
start_mem = PAGE_ALIGN(start_mem);
/*
* Mark the pages used by the kernel as reserved..
* Mark the pages used by the kernel as reserved.
*/
tmp = KERNEL_START;
while (tmp < start_mem) {
......@@ -171,9 +171,19 @@ void mem_init(unsigned long start_mem, unsigned long end_mem)
return;
}
void free_initmem(void)
void free_initmem (void)
{
/* To be written */
extern char __init_begin, __init_end;
unsigned long addr;
addr = (unsigned long)(&__init_begin);
for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
mem_map[MAP_NR(addr)].flags &= ~(1 << PG_reserved);
atomic_set(&mem_map[MAP_NR(addr)].count, 1);
free_page(addr);
}
printk ("Freeing unused kernel memory: %dk freed\n",
(&__init_end - &__init_begin) >> 10);
}
void si_meminfo(struct sysinfo *val)
......
OUTPUT_FORMAT("ecoff-littlealpha")
OUTPUT_FORMAT("elf64-alpha")
ENTRY(__start)
SECTIONS
{
.text 0xfffffc0000310000: {
_ftext = . ;
__istart = . ;
eprol = .;
*(.text)
__fstart = . ;
. = 0xfffffc0000310000;
_text = .;
.text : { *(.text) }
_etext = .;
}
.rdata : {
*(.rdata)
}
.pdata : {
_fpdata = .;
*(.pdata)
}
.data : {
_fdata = .;
*(.data)
CONSTRUCTORS
}
.xdata : {
*(.xdata)
}
_gp = ALIGN (16) + 0x8000;
.lit8 : {
*(.lit8)
}
.lita : {
*(.lita)
}
.sdata : {
*(.sdata)
}
_EDATA = .;
_FBSS = .;
.sbss : {
*(.sbss)
*(.scommon)
/* Exception table */
. = ALIGN(16);
}
.bss : {
*(.bss)
*(COMMON)
}
__start___ex_table = .;
__ex_table : { *(__ex_table) }
__stop___ex_table = .;
/* Kernel symbol table */
. = ALIGN(8);
__start___ksymtab = .;
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
.kstrtab : { *(.kstrtab) }
/* Startup code */
. = ALIGN(8192);
__init_begin = .;
.text.init : { *(.text.init) }
.data.init : { *(.data.init) }
. = ALIGN(8192);
__init_end = .;
/* Global data */
_data = .;
.rodata : { *(.rodata) }
.data : { *(.data) CONSTRUCTORS }
.got : { *(.got) }
.sdata : { *(.sdata) }
_edata = .;
_bss = .;
.sbss : { *(.sbss) *(.scommon) }
.bss : { *(.bss) *(COMMON) }
_end = .;
.mdebug 0 : { *(.mdebug) }
.note 0 : { *(.note) }
.comment 0 : { *(.comment) }
}
......@@ -524,6 +524,7 @@ ENTRY(sys_call_table)
.long SYMBOL_NAME(sys_vm86)
.long SYMBOL_NAME(sys_query_module)
.long SYMBOL_NAME(sys_poll)
.rept NR_syscalls-168
.long SYMBOL_NAME(sys_nfsservctl)
.rept NR_syscalls-169
.long SYMBOL_NAME(sys_ni_syscall)
.endr
......@@ -38,15 +38,16 @@ startup_32:
orw %bx,%bx
jz 1f
/*
* New page tables may be in 4Mbyte page mode
* New page tables may be in 4Mbyte page mode and may
* be using the global pages.
*/
#ifdef GAS_KNOWS_CR4
movl %cr4,%eax # Turn on 4Mb pages
orl $16,%eax
orl $16+128,%eax
movl %eax,%cr4
#else
.byte 0x0f,0x20,0xe0
orl $16,%eax
orl $16+128,%eax
.byte 0x0f,0x22,0xe0
#endif
movl %eax,%cr3 /* flush TLB as per app note */
......
......@@ -27,6 +27,8 @@
#include <asm/pgtable.h>
#include <asm/dma.h>
const char bad_pmd_string[] = "Bad pmd in pte_alloc: %08lx\n";
extern void die_if_kernel(char *,struct pt_regs *,long);
extern void show_net_buffers(void);
......@@ -102,6 +104,48 @@ extern unsigned long free_area_init(unsigned long, unsigned long);
extern char _text, _etext, _edata, __bss_start, _end;
extern char __init_begin, __init_end;
#define X86_CR4_VME 0x0001 /* enable vm86 extensions */
#define X86_CR4_PVI 0x0002 /* virtual interrupts flag enable */
#define X86_CR4_TSD 0x0004 /* disable time stamp at ipl 3 */
#define X86_CR4_DE 0x0008 /* enable debugging extensions */
#define X86_CR4_PSE 0x0010 /* enable page size extensions */
#define X86_CR4_PAE 0x0020 /* enable physical address extensions */
#define X86_CR4_MCE 0x0040 /* Machine check enable */
#define X86_CR4_PGE 0x0080 /* enable global pages */
#define X86_CR4_PCE 0x0100 /* enable performance counters at ipl 3 */
#define X86_FEATURE_FPU 0x0001 /* internal FPU */
#define X86_FEATURE_VME 0x0002 /* vm86 extensions */
#define X86_FEATURE_DE 0x0004 /* debugging extensions */
#define X86_FEATURE_PSE 0x0008 /* Page size extensions */
#define X86_FEATURE_TSC 0x0010 /* Time stamp counter */
#define X86_FEATURE_MSR 0x0020 /* RDMSR/WRMSR */
#define X86_FEATURE_PAE 0x0040 /* Physical address extension */
#define X86_FEATURE_MCE 0x0080 /* Machine check exception */
#define X86_FEATURE_CXS 0x0100 /* cmpxchg8 available */
#define X86_FEATURE_APIC 0x0200 /* internal APIC */
#define X86_FEATURE_10 0x0400
#define X86_FEATURE_11 0x0800
#define X86_FEATURE_MTRR 0x1000 /* memory type registers */
#define X86_FEATURE_PGE 0x2000 /* Global page */
#define X86_FEATURE_MCA 0x4000 /* Machine Check Architecture */
#define X86_FEATURE_CMOV 0x8000 /* Cmov/fcomi */
#ifdef GAS_KNOWS_CR4
#define read_cr4 "movl %%cr4,%%eax"
#define write_cr4 "movl %%eax,%%cr4"
#else
#define read_cr4 ".byte 0x0f,0x20,0xe0"
#define write_cr4 ".byte 0x0f,0x22,0xe0"
#endif
#define set_in_cr4(x) \
__asm__(read_cr4 "\n\t" \
"orl %0,%%eax\n\t" \
write_cr4 \
: : "i" (x) \
:"ax");
/*
* paging_init() sets up the page tables - note that the first 4MB are
* already mapped by head.S.
......@@ -156,7 +200,6 @@ __initfunc(unsigned long paging_init(unsigned long start_mem, unsigned long end_
/* Map whole memory from 0xC0000000 */
while (address < end_mem) {
if (x86_capability & 8) {
/*
* If we're running on a Pentium CPU, we can use the 4MB
* page tables.
......@@ -165,18 +208,17 @@ __initfunc(unsigned long paging_init(unsigned long start_mem, unsigned long end_
* virtual memory boundary, but that's OK as we won't
* use that memory anyway.
*/
#ifdef GAS_KNOWS_CR4
__asm__("movl %%cr4,%%eax\n\t"
"orl $16,%%eax\n\t"
"movl %%eax,%%cr4"
: : :"ax");
#else
__asm__(".byte 0x0f,0x20,0xe0\n\t"
"orl $16,%%eax\n\t"
".byte 0x0f,0x22,0xe0"
: : :"ax");
#endif
if (x86_capability & X86_FEATURE_PSE) {
unsigned long __pe;
set_in_cr4(X86_CR4_PSE);
wp_works_ok = 1;
__pe = _PAGE_TABLE + _PAGE_4M + __pa(address);
/* Make it "global" too if supported */
if (x86_capability & X86_FEATURE_PGE) {
set_in_cr4(X86_CR4_PGE);
__pe += _PAGE_GLOBAL;
}
pgd_val(pg_dir[768]) = _PAGE_TABLE + _PAGE_4M + __pa(address);
pg_dir++;
address += 4*1024*1024;
......
This diff is collapsed.
This diff is collapsed.
......@@ -668,7 +668,7 @@ SYMBOL_NAME_LABEL(sys_call_table)
.long SYMBOL_NAME(sys_ni_syscall) /* for vm86 */
.long SYMBOL_NAME(sys_query_module)
.long SYMBOL_NAME(sys_poll)
.long SYMBOL_NAME(sys_ni_syscall) /* will be sys_nfsservctl */
.long SYMBOL_NAME(sys_nfsservctl)
.rept NR_syscalls-(.-SYMBOL_NAME(sys_call_table))/4
.long SYMBOL_NAME(sys_ni_syscall)
.endr
/* $Id: irq.c,v 1.68 1997/04/16 05:55:58 davem Exp $
/* $Id: irq.c,v 1.72 1997/04/20 11:41:26 ecd Exp $
* arch/sparc/kernel/irq.c: Interrupt request handling routines. On the
* Sparc the IRQ's are basically 'cast in stone'
* and you are supposed to probe the prom's device
......@@ -292,7 +292,11 @@ void free_irq(unsigned int irq, void *dev_id)
/* Per-processor IRQ locking depth, both SMP and non-SMP code use this. */
unsigned int local_irq_count[NR_CPUS];
#ifdef __SMP__
atomic_t __sparc_bh_counter = ATOMIC_INIT(0);
#else
int __sparc_bh_counter = 0;
#endif
#ifdef __SMP__
/* SMP interrupt locking on Sparc. */
......@@ -309,47 +313,8 @@ spinlock_t global_bh_lock = SPIN_LOCK_UNLOCKED;
/* Global IRQ locking depth. */
atomic_t global_irq_count = ATOMIC_INIT(0);
#define irq_active(cpu) \
(atomic_read(&global_irq_count) != local_irq_count[cpu])
static unsigned long previous_irqholder;
#define INIT_STUCK 10000000
#define STUCK \
if (!--stuck) { \
printk("wait_on_irq CPU#%d stuck at %08lx, waiting for [%08lx:%x] " \
"(local=[%d(%x:%x:%x:%x)], global=[%d:%x]) ", \
cpu, where, previous_irqholder, global_irq_holder, \
local_count, local_irq_count[0], local_irq_count[1], \
local_irq_count[2], local_irq_count[3], \
atomic_read(&global_irq_count), global_irq_lock); \
printk("g[%d:%x]\n", atomic_read(&global_irq_count), global_irq_lock); \
stuck = INIT_STUCK; \
}
static inline void wait_on_irq(int cpu, unsigned long where)
{
int stuck = INIT_STUCK;
int local_count = local_irq_count[cpu];
while(local_count != atomic_read(&global_irq_count)) {
atomic_sub(local_count, &global_irq_count);
spin_unlock(&global_irq_lock);
while(1) {
STUCK;
if(atomic_read(&global_irq_count))
continue;
if(global_irq_lock)
continue;
if(spin_trylock(&global_irq_lock))
break;
}
atomic_add(local_count, &global_irq_count);
}
}
/* There has to be a better way. */
/* XXX Must write faster version in irqlock.S -DaveM */
void synchronize_irq(void)
{
int cpu = smp_processor_id();
......@@ -366,127 +331,6 @@ void synchronize_irq(void)
}
}
#undef INIT_STUCK
#define INIT_STUCK 10000000
#undef STUCK
#define STUCK \
if (!--stuck) {printk("get_irqlock stuck at %08lx, waiting for %08lx\n", where, previous_irqholder); stuck = INIT_STUCK;}
static inline void get_irqlock(int cpu, unsigned long where)
{
int stuck = INIT_STUCK;
if(!spin_trylock(&global_irq_lock)) {
if((unsigned char) cpu == global_irq_holder)
return;
do {
do {
STUCK;
barrier();
} while(global_irq_lock);
} while(!spin_trylock(&global_irq_lock));
}
wait_on_irq(cpu, where);
global_irq_holder = cpu;
previous_irqholder = where;
}
void __global_cli(void)
{
int cpu = smp_processor_id();
unsigned long where;
__asm__ __volatile__("mov %%i7, %0\n\t" : "=r" (where));
__cli();
get_irqlock(cpu, where);
}
void __global_sti(void)
{
release_irqlock(smp_processor_id());
__sti();
}
/* Yes, I know this is broken, but for the time being...
*
* On Sparc we must differentiate between real local processor
* interrupts being disabled and global interrupt locking, this
* is so that interrupt handlers which call this stuff don't get
* interrupts turned back on when restore_flags() runs because
* our current drivers will be very surprised about this, yes I
* know they need to be fixed... -DaveM
*/
unsigned long __global_save_flags(void)
{
unsigned long flags, retval = 0;
__save_flags(flags);
if(global_irq_holder == (unsigned char) smp_processor_id())
retval |= 1;
if(flags & PSR_PIL)
retval |= 2;
return retval;
}
void __global_restore_flags(unsigned long flags)
{
if(flags & 1) {
__global_cli();
} else {
release_irqlock(smp_processor_id());
if(flags & 2)
__cli();
else
__sti();
}
}
#undef INIT_STUCK
#define INIT_STUCK 200000000
#undef STUCK
#define STUCK \
if (!--stuck) { \
printk("irq_enter stuck (irq=%d, cpu=%d, global=%d)\n", \
irq, cpu, global_irq_holder); \
stuck = INIT_STUCK; \
}
static void irq_enter(int cpu, int irq)
{
extern void smp_irq_rotate(int cpu);
int stuck = INIT_STUCK;
#ifdef __SMP_PROF__
int_count[cpu][irq]++;
#endif
smp_irq_rotate(cpu);
hardirq_enter(cpu);
while(global_irq_lock) {
if((unsigned char) cpu == global_irq_holder) {
printk("YEEEE Local interrupts enabled, global disabled\n");
break;
}
STUCK;
barrier();
}
}
static void irq_exit(int cpu, int irq)
{
__cli();
hardirq_exit(cpu);
release_irqlock(cpu);
}
#else /* !__SMP__ */
#define irq_enter(cpu, irq) (local_irq_count[cpu]++)
#define irq_exit(cpu, irq) (local_irq_count[cpu]--)
#endif /* __SMP__ */
void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs)
......@@ -517,8 +361,16 @@ void handler_irq(int irq, struct pt_regs * regs)
struct irqaction * action;
unsigned int cpu_irq = irq & NR_IRQS;
int cpu = smp_processor_id();
#ifdef __SMP__
extern void smp_irq_rotate(int cpu);
#endif
disable_pil_irq(cpu_irq);
#ifdef __SMP__
/* Only rotate on lower priority IRQ's (scsi, ethernet, etc.). */
if(irq < 10)
smp_irq_rotate(cpu);
#endif
irq_enter(cpu, cpu_irq);
action = *(cpu_irq + irq_action);
kstat.interrupts[cpu_irq]++;
......@@ -543,7 +395,7 @@ void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
irq_enter(cpu, irq);
floppy_interrupt(irq, dev_id, regs);
irq_exit(cpu, irq);
disable_pil_irq(irq);
enable_pil_irq(irq);
}
#endif
......
/* $Id: sparc_ksyms.c,v 1.55 1997/04/17 03:28:56 davem Exp $
/* $Id: sparc_ksyms.c,v 1.56 1997/04/18 05:44:35 davem Exp $
* arch/sparc/kernel/ksyms.c: Sparc specific ksyms support.
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
......@@ -91,6 +91,14 @@ EXPORT_SYMBOL_PRIVATE(_rw_read_enter);
EXPORT_SYMBOL_PRIVATE(_rw_read_exit);
EXPORT_SYMBOL_PRIVATE(_rw_write_enter);
EXPORT_SYMBOL(__sparc_bh_counter);
#ifdef __SMP__
EXPORT_SYMBOL_PRIVATE(_irq_enter);
EXPORT_SYMBOL_PRIVATE(_irq_exit);
EXPORT_SYMBOL_PRIVATE(_global_restore_flags);
EXPORT_SYMBOL_PRIVATE(_global_sti);
EXPORT_SYMBOL_PRIVATE(_global_cli);
#endif
EXPORT_SYMBOL(page_offset);
EXPORT_SYMBOL(stack_top);
......@@ -113,10 +121,6 @@ EXPORT_SYMBOL(global_irq_holder);
EXPORT_SYMBOL(global_irq_lock);
EXPORT_SYMBOL(global_bh_lock);
EXPORT_SYMBOL(global_irq_count);
EXPORT_SYMBOL(__global_cli);
EXPORT_SYMBOL(__global_sti);
EXPORT_SYMBOL(__global_save_flags);
EXPORT_SYMBOL(__global_restore_flags);
EXPORT_SYMBOL(synchronize_irq);
#endif
......
/* $Id: systbls.S,v 1.59 1997/02/14 03:12:54 davem Exp $
/* $Id: systbls.S,v 1.60 1997/04/19 08:52:15 jj Exp $
* systbls.S: System call entry point tables for OS compatibility.
* The native Linux system call table lives here also.
*
......@@ -113,7 +113,7 @@ C_LABEL(sys_call_table):
.long C_LABEL(sys_sched_rr_get_interval), C_LABEL(sys_nanosleep)
/*250*/ .long C_LABEL(sys_mremap)
.long C_LABEL(sys_sysctl)
.long C_LABEL(sys_getsid), C_LABEL(sys_fdatasync), C_LABEL(sys_nis_syscall)
.long C_LABEL(sys_getsid), C_LABEL(sys_fdatasync), C_LABEL(sys_nfsservctl)
.long C_LABEL(sys_aplib), C_LABEL(sys_nis_syscall)
/* Now the SunOS syscall table. */
......
/* $Id: time.c,v 1.28 1997/04/15 09:01:10 davem Exp $
/* $Id: time.c,v 1.29 1997/04/18 09:48:44 davem Exp $
* linux/arch/sparc/kernel/time.c
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
......@@ -308,11 +308,11 @@ void do_gettimeofday(struct timeval *tv)
xor %o5, %o3, %o3
orcc %o2, %o3, %g0
bne 1b
subcc %o1, 0x0, %g0
bpos 1f
cmp %o1, 0
bge 1f
srl %o1, 0xa, %o1
sethi %hi(0x2710), %o3
or %o3, %lo(0x2710), %o3
sethi %hi(tick), %o3
ld [%o3 + %lo(tick)], %o3
sethi %hi(0x1fffff), %o2
or %o2, %lo(0x1fffff), %o2
add %o5, %o3, %o5
......
# $Id: Makefile,v 1.22 1997/03/14 21:04:17 jj Exp $
# $Id: Makefile,v 1.23 1997/04/18 05:44:39 davem Exp $
# Makefile for Sparc library files..
#
......@@ -9,6 +9,10 @@ OBJS = mul.o rem.o sdiv.o udiv.o umul.o urem.o ashrdi3.o memcpy.o memset.o \
strncpy_from_user.o divdi3.o udivdi3.o strlen_user.o \
copy_user.o locks.o atomic.o bitops.o
ifdef SMP
OBJS += irqlock.o
endif
lib.a: $(OBJS)
$(AR) rcs lib.a $(OBJS)
sync
......@@ -54,6 +58,9 @@ atomic.o: atomic.S
bitops.o: bitops.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o bitops.o bitops.S
irqlock.o: irqlock.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c -o irqlock.o irqlock.S
else
locks.o: locks.S
......
......@@ -471,8 +471,6 @@ ccslow: cmp %g1, 0
addx %g0, %g7, %o0
C_LABEL(__csum_partial_copy_end):
.section .fixup,#alloc,#execinstr
.align 4
/* We do these strange calculations for the csum_*_from_user case only, ie.
* we only bother with faults on loads... */
......@@ -568,6 +566,7 @@ C_LABEL(__csum_partial_copy_end):
add %i1, %i2, %i1
2:
mov %i1, %o0
6:
call C_LABEL(__bzero)
mov %i3, %o1
1:
......@@ -579,3 +578,4 @@ C_LABEL(__csum_partial_copy_end):
.section __ex_table,#alloc
.align 4
.word 5b,2
.word 6b,2
This diff is collapsed.
/* $Id: locks.S,v 1.11 1997/04/17 03:29:03 davem Exp $
/* $Id: locks.S,v 1.12 1997/04/22 18:48:07 davem Exp $
* locks.S: SMP low-level lock primitives on Sparc.
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -50,6 +50,7 @@ TADPOLE_FB_WEITEK=y
CONFIG_NET=y
CONFIG_SYSVIPC=y
CONFIG_SYSCTL=y
CONFIG_SPARC32_COMPAT=y
CONFIG_BINFMT_AOUT=y
CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_ELF32=y
......
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.
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