You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(2) |
Oct
(43) |
Nov
(4) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(78) |
Feb
(97) |
Mar
(29) |
Apr
(2) |
May
(22) |
Jun
(38) |
Jul
(11) |
Aug
(27) |
Sep
(40) |
Oct
(2) |
Nov
(17) |
Dec
(8) |
2002 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
(480) |
May
(456) |
Jun
(12) |
Jul
|
Aug
(1) |
Sep
|
Oct
(18) |
Nov
(3) |
Dec
(6) |
2003 |
Jan
|
Feb
(18) |
Mar
(1) |
Apr
|
May
(6) |
Jun
(147) |
Jul
(7) |
Aug
(3) |
Sep
(235) |
Oct
(10) |
Nov
(2) |
Dec
(1) |
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Andy P. <at...@us...> - 2001-01-18 15:52:27
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax/junk In directory usw-pr-cvs1:/tmp/cvs-serv5429/include/asm-vax/junk Added Files: io.h.vax2.2 resource.h.vax2.2 shmparam.h.vax2.2 Log Message: Updates to adapt code base from 2.2 to 2.4 tree. Sync up to atp 2.4 tree. --- NEW FILE --- #ifndef _VAX_IO_H #define _VAX_IO_H /* FIXME: -- entire file. * need to decide on how to deal with device address space * within the context of UBA etc devices, Although the initial * port is targetted at 'busless' vaxes, we still need to * think about the best way of doing this to include the * bigger vaxen */ /* this taken from m68k port. represents the simple case */ #ifdef __KERNEL__ #include <linux/config.h> /* hardly likely to need this on a vax, - still looking for a * SPEED_UP_IO define... */ #define __SLOW_DOWN_IO "\n nop" /* * readX/writeX() are used to access memory mapped devices. On some * architectures the memory mapped IO stuff needs to be accessed * differently. On the m68k architecture, we just read/write the * memory location directly. */ #define inb_p(addr) readb(addr) #define inb(addr) readb(addr) #define outb(x,addr) ((void) writeb(x,addr)) #define outb_p(x,addr) outb(x,addr) /* virt_to_phys stuff lifted from asm-i386 */ #include <linux/vmalloc.h> #include <asm/page.h> #include <asm/mm/virt_trans.h> /* * readX/writeX() are used to access memory mapped devices. On some * architectures the memory mapped IO stuff needs to be accessed * differently. On the x86 architecture, we just read/write the * memory location directly. */ #define readb(addr) (*(volatile unsigned char *) __io_virt(addr)) #define readw(addr) (*(volatile unsigned short *) __io_virt(addr)) #define readl(addr) (*(volatile unsigned int *) __io_virt(addr)) #define writeb(b,addr) (*(volatile unsigned char *) __io_virt(addr) = (b)) #define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b)) #define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b)) #define memset_io(a,b,c) memset(__io_virt(a),(b),(c)) #define memcpy_fromio(a,b,c) memcpy((a),__io_virt(b),(c)) #define memcpy_toio(a,b,c) memcpy(__io_virt(a),(b),(c)) /* * Again, i386 does not require mem IO specific function. */ #define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),__io_virt(b),(c),(d)) static inline int check_signature(unsigned long io_addr, const unsigned char *signature, int length) { int retval = 0; do { if (readb(io_addr) != *signature) goto out; io_addr++; signature++; length--; } while (length); retval = 1; out: return retval; } #endif /* __KERNEL__ */ #endif /* _VAX_IO_H */ --- NEW FILE --- #ifndef _VAX_RESOURCE_H #define _VAX_RESOURCE_H /* * Resource limits * FIXME: taken from alpha port. check this. atp 1998 */ #define RLIMIT_CPU 0 /* CPU time in ms */ #define RLIMIT_FSIZE 1 /* Maximum filesize */ #define RLIMIT_DATA 2 /* max data size */ #define RLIMIT_STACK 3 /* max stack size */ #define RLIMIT_CORE 4 /* max core file size */ #define RLIMIT_RSS 5 /* max resident set size */ #define RLIMIT_NOFILE 6 /* max number of open files */ #define RLIMIT_AS 7 /* address space limit(?) */ #define RLIMIT_NPROC 8 /* max number of processes */ #define RLIMIT_MEMLOCK 9 /* max locked-in-memory address space */ #define RLIM_NLIMITS 10 #ifdef __KERNEL__ #define INIT_RLIMITS \ { \ {LONG_MAX, LONG_MAX}, /* RLIMIT_CPU */ \ {LONG_MAX, LONG_MAX}, /* RLIMIT_FSIZE */ \ {LONG_MAX, LONG_MAX}, /* RLIMIT_DATA */ \ {_STK_LIM, _STK_LIM}, /* RLIMIT_STACK */ \ { 0, LONG_MAX}, /* RLIMIT_CORE */ \ {LONG_MAX, LONG_MAX}, /* RLIMIT_RSS */ \ { NR_OPEN, NR_OPEN}, /* RLIMIT_NOFILE */ \ {LONG_MAX, LONG_MAX}, /* RLIMIT_AS */ \ {MAX_TASKS_PER_USER, MAX_TASKS_PER_USER}, /* RLIMIT_NPROC */ \ {LONG_MAX, LONG_MAX}, /* RLIMIT_MEMLOCK */ \ } #endif /* __KERNEL__ */ #endif /* _VAX_RESOURCE_H */ --- NEW FILE --- #ifndef _VAX_SHMPARAM_H #define _VAX_SHMPARAM_H /* address range for shared memory attaches if no address passed to shmat() */ #define SHM_RANGE_START 0x50000000 #define SHM_RANGE_END 0x60000000 /* * Format of a swap-entry for shared memory pages currently out in * swap space (see also mm/swap.c). * * SWP_TYPE = SHM_SWP_TYPE * SWP_OFFSET is used as follows: * * bits 0..6 : id of shared memory segment page belongs to (SHM_ID) * bits 7..21: index of page within shared memory segment (SHM_IDX) * (actually fewer bits get used since SHMMAX is so low) */ /* * Keep _SHM_ID_BITS as low as possible since SHMMNI depends on it and * there is a static array of size SHMMNI. */ #define _SHM_ID_BITS 7 #define SHM_ID_MASK ((1<<_SHM_ID_BITS)-1) #define SHM_IDX_SHIFT (_SHM_ID_BITS) #define _SHM_IDX_BITS 15 #define SHM_IDX_MASK ((1<<_SHM_IDX_BITS)-1) /* * _SHM_ID_BITS + _SHM_IDX_BITS must be <= 24 on the i386 and * SHMMAX <= (PAGE_SIZE << _SHM_IDX_BITS). */ #define SHMMAX 0x2000000 /* max shared seg size (bytes) */ /* Try not to change the default shipped SHMMAX - people rely on it */ #define SHMMIN 1 /* really PAGE_SIZE */ /* min shared seg size (bytes) */ #define SHMMNI (1<<_SHM_ID_BITS) /* max num of segs system wide */ #define SHMALL /* max shm system wide (pages) */ \ (1<<(_SHM_IDX_BITS+_SHM_ID_BITS)) #define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ #define SHMSEG SHMMNI /* max shared segs per process */ #endif /* _VAX_SHMPARAM_H */ |
From: Andy P. <at...@us...> - 2001-01-18 15:52:27
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax In directory usw-pr-cvs1:/tmp/cvs-serv5429/include/asm-vax Modified Files: dz11.h hardirq.h io.h mman.h mmu_context.h processor.h resource.h semaphore.h serial.h shmparam.h system.h termios.h Added Files: module.h shmbuf.h Log Message: Updates to adapt code base from 2.2 to 2.4 tree. Sync up to atp 2.4 tree. --- NEW FILE --- #ifndef _ASM_VAX_MODULE_H #define _ASM_VAX_MODULE_H /* * This file contains the vax architecture specific module code. */ #define module_map(x) vmalloc(x) #define module_unmap(x) vfree(x) #define module_arch_init(x) (0) #endif /* _ASM_VAX_MODULE_H */ --- NEW FILE --- #ifndef __VAX_SHMBUF_H #define __VAX_SHMBUF_H /* * The shmid64_ds structure for VAX architecture. * Note extra padding because this structure is passed back and forth * between kernel and user space. * * Pad space is left for: * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values */ struct shmid64_ds { struct ipc64_perm shm_perm; /* operation perms */ size_t shm_segsz; /* size of segment (bytes) */ __kernel_time_t shm_atime; /* last attach time */ unsigned long __unused1; __kernel_time_t shm_dtime; /* last detach time */ unsigned long __unused2; __kernel_time_t shm_ctime; /* last change time */ unsigned long __unused3; __kernel_pid_t shm_cpid; /* pid of creator */ __kernel_pid_t shm_lpid; /* pid of last operator */ unsigned long shm_nattch; /* no. of current attaches */ unsigned long __unused4; unsigned long __unused5; }; struct shminfo64 { unsigned long shmmax; unsigned long shmmin; unsigned long shmmni; unsigned long shmseg; unsigned long shmall; unsigned long __unused1; unsigned long __unused2; unsigned long __unused3; unsigned long __unused4; }; #endif /* __VAX_SHMBUF_H */ Index: dz11.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/dz11.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** dz11.h 2001/01/17 16:18:52 1.1 --- dz11.h 2001/01/18 15:52:28 1.2 *************** *** 9,12 **** --- 9,14 ---- * Definitions for DZ11-compatible RS232 I/O chips. If all this * works, this will obsolete all the DC7085 stuff. + * + * Jan 2001 atp - updated to 2.4. * * Reference: DZQ11 Asynchronous Multiplexer Users Guide *************** *** 17,20 **** --- 19,23 ---- #include <linux/types.h> + #include <linux/serialP.h> struct dz11_regs { Index: hardirq.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/hardirq.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** hardirq.h 2001/01/17 16:18:52 1.1 --- hardirq.h 2001/01/18 15:52:28 1.2 *************** *** 19,23 **** ! extern unsigned int local_irq_count[NR_CPUS]; /* --- 19,23 ---- ! /*extern unsigned int local_irq_count[NR_CPUS];*/ /* *************** *** 25,39 **** * or hardware interrupt processing? */ ! #define in_interrupt() (local_irq_count[smp_processor_id()] + local_bh_count[smp_processor_id()] != 0) ! #define in_irq() (local_irq_count(smp_processor_id()) != 0) #ifndef __SMP__ ! #define hardirq_trylock(cpu) (local_irq_count[cpu] == 0) #define hardirq_endlock(cpu) do { } while (0) ! #define hardirq_enter(cpu) (local_irq_count[cpu]++) ! #define hardirq_exit(cpu) (local_irq_count[cpu]--) #define synchronize_irq() do { } while (0) --- 25,38 ---- * or hardware interrupt processing? */ ! #define in_interrupt() (local_irq_count(smp_processor_id()) + local_bh_count(smp_processor_id()) != 0) #define in_irq() (local_irq_count(smp_processor_id()) != 0) #ifndef __SMP__ ! #define hardirq_trylock(cpu) (local_irq_count(cpu) == 0) #define hardirq_endlock(cpu) do { } while (0) ! #define hardirq_enter(cpu) (local_irq_count(cpu)++) ! #define hardirq_exit(cpu) (local_irq_count(cpu)--) #define synchronize_irq() do { } while (0) Index: io.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/io.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** io.h 2001/01/17 16:18:52 1.1 --- io.h 2001/01/18 15:52:28 1.2 *************** *** 1,43 **** ! #ifndef _VAX_IO_H ! #define _VAX_IO_H ! /* FIXME: -- entire file. ! * need to decide on how to deal with device address space ! * within the context of UBA etc devices, Although the initial ! * port is targetted at 'busless' vaxes, we still need to ! * think about the best way of doing this to include the ! * bigger vaxen */ ! /* this taken from m68k port. represents the simple case */ ! #ifdef __KERNEL__ ! ! #include <linux/config.h> ! ! /* hardly likely to need this on a vax, - still looking for a ! * SPEED_UP_IO define... */ - #define __SLOW_DOWN_IO "\n nop" - /* - * readX/writeX() are used to access memory mapped devices. On some - * architectures the memory mapped IO stuff needs to be accessed - * differently. On the m68k architecture, we just read/write the - * memory location directly. - */ ! #define inb_p(addr) readb(addr) ! #define inb(addr) readb(addr) ! ! #define outb(x,addr) ((void) writeb(x,addr)) ! #define outb_p(x,addr) outb(x,addr) - /* virt_to_phys stuff lifted from asm-i386 */ #include <linux/vmalloc.h> #include <asm/page.h> ! #include <asm/mm/virt_trans.h> /* * readX/writeX() are used to access memory mapped devices. On some * architectures the memory mapped IO stuff needs to be accessed ! * differently. On the x86 architecture, we just read/write the ! * memory location directly. */ --- 1,28 ---- ! #ifndef __VAX_IO_H ! #define __VAX_IO_H ! /* atp Jan 2001, junked old io.h. ! * wasnt sure about old one, so it was easiest to ! * start afresh. */ ! #ifdef __KERNEL__ #include <linux/vmalloc.h> #include <asm/page.h> ! #include <asm/mm/virt_trans.h> /* virt_to_phys stuff */ + + /* FIXME: What is the proper value for this ? */ + + #define IO_SPACE_LIMIT 0xffffffff + + #define __io_virt(x) ((void *)(PAGE_OFFSET | (unsigned long)(x))) + #define __io_phys(x) ((unsigned long)(x) & ~PAGE_OFFSET) + /* * readX/writeX() are used to access memory mapped devices. On some * architectures the memory mapped IO stuff needs to be accessed ! * differently. */ *************** *** 49,81 **** #define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b)) #define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b)) - - #define memset_io(a,b,c) memset(__io_virt(a),(b),(c)) - #define memcpy_fromio(a,b,c) memcpy((a),__io_virt(b),(c)) - #define memcpy_toio(a,b,c) memcpy(__io_virt(a),(b),(c)) - - /* - * Again, i386 does not require mem IO specific function. - */ ! #define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),__io_virt(b),(c),(d)) ! static inline int check_signature(unsigned long io_addr, ! const unsigned char *signature, int length) ! { ! int retval = 0; ! do { ! if (readb(io_addr) != *signature) ! goto out; ! io_addr++; ! signature++; ! length--; ! } while (length); ! retval = 1; ! out: ! return retval; ! } #endif /* __KERNEL__ */ ! #endif /* _VAX_IO_H */ --- 34,49 ---- #define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b)) #define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b)) ! #define memset_io(a,b,c) memset(__io_virt(a),(b),(c)) ! #define memcpy_fromio(a,b,c) memcpy((a),__io_virt(b),(c)) ! #define memcpy_toio(a,b,c) memcpy(__io_virt(a),(b),(c)) ! #define inb_p(addr) readb(addr) ! #define inb(addr) readb(addr) + #define outb(x,addr) ((void) writeb(x,addr)) + #define outb_p(x,addr) outb(x,addr) #endif /* __KERNEL__ */ ! #endif /* __VAX_IO_H */ Index: mman.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/mman.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** mman.h 2001/01/17 16:18:52 1.1 --- mman.h 2001/01/18 15:52:28 1.2 *************** *** 26,29 **** --- 26,35 ---- #define MCL_FUTURE 2 /* lock all future mappings */ + #define MADV_NORMAL 0x0 /* default page-in behavior */ + #define MADV_RANDOM 0x1 /* page-in minimum required */ + #define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */ + #define MADV_WILLNEED 0x3 /* pre-fault pages */ + #define MADV_DONTNEED 0x4 /* discard these pages */ + /* compatibility flags */ #define MAP_ANON MAP_ANONYMOUS Index: mmu_context.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/mmu_context.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** mmu_context.h 2001/01/17 16:18:52 1.1 --- mmu_context.h 2001/01/18 15:52:28 1.2 *************** *** 1,12 **** ! #ifndef _ASM_VAX_MMU_CONTEXT_H ! #define _ASM_VAX_MMU_CONTEXT_H ! /* FIXME: check this. dont think we need it. Looks like a mips/alpha thing */ ! #define get_mmu_context(x) do { } while (0) ! ! #define init_new_context(mm) do { } while(0) ! #define destroy_context(mm) do { } while(0) ! #define activate_context(tsk) do { } while(0) ! ! #endif --- 1,6 ---- ! #ifndef __VAX_TMP_MMUCONTEXT_H ! #define __VAX_TMP_MMUCONTEXT_H ! #include <asm/mm/mmu_context.h> ! #endif /* __VAX_TMP_MMUCONTEXT_H */ Index: processor.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/processor.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** processor.h 2001/01/17 16:18:52 1.1 --- processor.h 2001/01/18 15:52:28 1.2 *************** *** 74,84 **** /* This was what Andy had. I don't understand this stuff yet, ! but I'm going to replace it with something similar to the ! i386 version, just to get stuff to compile. We'll fix ! it later. KPH 2000-04-25 ! ! #define INIT_MMAP { &init_mm, PAGE_OFFSET, PAGE_OFFSET+0x10000000, \ ! PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap } */ ! #define INIT_MMAP { &init_mm, 0, 0, NULL, \ PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL } --- 74,84 ---- /* This was what Andy had. I don't understand this stuff yet, ! * but I'm going to replace it with something similar to the ! * i386 version, just to get stuff to compile. We'll fix ! * it later. KPH 2000-04-25 ! * ! * #define INIT_MMAP { &init_mm, PAGE_OFFSET, PAGE_OFFSET+0x10000000, \ ! * PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, NULL, &init_mm.mmap } ! */ #define INIT_MMAP { &init_mm, 0, 0, NULL, \ PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL } *************** *** 95,100 **** --- 95,111 ---- } + + #include <asm/ptrace.h> + /* go with the flow here. Everyone else defines + * THREAD_SIZE to be 8192 or similar. FIXME: */ + + #define THREAD_SIZE (8192) + + + + + /* * Do necessary setup to start up a newly executed thread. *************** *** 111,115 **** extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); ! #define copy_segments(nr, tsk, mm) do { } while (0) #define release_segments(mm) do { } while (0) #define forget_segments() do { } while (0) --- 122,126 ---- extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); ! #define copy_segments(tsk, mm) do { } while (0) #define release_segments(mm) do { } while (0) #define forget_segments() do { } while (0) Index: resource.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/resource.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** resource.h 2001/01/17 16:18:52 1.1 --- resource.h 2001/01/18 15:52:28 1.2 *************** *** 1,8 **** ! #ifndef _VAX_RESOURCE_H ! #define _VAX_RESOURCE_H /* * Resource limits - * FIXME: taken from alpha port. check this. atp 1998 */ --- 1,9 ---- ! #ifndef _ASM_VAX_RESOURCE_H ! #define _ASM_VAX_RESOURCE_H + /*atp jan 2001 - taken from pa-risc for 2.4 update */ + /* * Resource limits */ *************** *** 13,40 **** #define RLIMIT_CORE 4 /* max core file size */ #define RLIMIT_RSS 5 /* max resident set size */ ! #define RLIMIT_NOFILE 6 /* max number of open files */ ! #define RLIMIT_AS 7 /* address space limit(?) */ ! #define RLIMIT_NPROC 8 /* max number of processes */ ! #define RLIMIT_MEMLOCK 9 /* max locked-in-memory address space */ ! #define RLIM_NLIMITS 10 #ifdef __KERNEL__ ! #define INIT_RLIMITS \ ! { \ ! {LONG_MAX, LONG_MAX}, /* RLIMIT_CPU */ \ ! {LONG_MAX, LONG_MAX}, /* RLIMIT_FSIZE */ \ ! {LONG_MAX, LONG_MAX}, /* RLIMIT_DATA */ \ ! {_STK_LIM, _STK_LIM}, /* RLIMIT_STACK */ \ ! { 0, LONG_MAX}, /* RLIMIT_CORE */ \ ! {LONG_MAX, LONG_MAX}, /* RLIMIT_RSS */ \ ! { NR_OPEN, NR_OPEN}, /* RLIMIT_NOFILE */ \ ! {LONG_MAX, LONG_MAX}, /* RLIMIT_AS */ \ ! {MAX_TASKS_PER_USER, MAX_TASKS_PER_USER}, /* RLIMIT_NPROC */ \ ! {LONG_MAX, LONG_MAX}, /* RLIMIT_MEMLOCK */ \ } #endif /* __KERNEL__ */ ! #endif /* _VAX_RESOURCE_H */ --- 14,49 ---- #define RLIMIT_CORE 4 /* max core file size */ #define RLIMIT_RSS 5 /* max resident set size */ ! #define RLIMIT_NPROC 6 /* max number of processes */ ! #define RLIMIT_NOFILE 7 /* max number of open files */ ! #define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */ ! #define RLIMIT_AS 9 /* address space limit */ ! #define RLIMIT_LOCKS 10 /* maximum file locks held */ ! ! #define RLIM_NLIMITS 11 ! /* ! * SuS says limits have to be unsigned. ! * Which makes a ton more sense anyway. ! */ ! #define RLIM_INFINITY (~0UL) #ifdef __KERNEL__ ! #define INIT_RLIMITS \ ! { \ ! { RLIM_INFINITY, RLIM_INFINITY }, \ ! { RLIM_INFINITY, RLIM_INFINITY }, \ ! { RLIM_INFINITY, RLIM_INFINITY }, \ ! { _STK_LIM, 10 * _STK_LIM }, \ ! { 0, RLIM_INFINITY }, \ ! { RLIM_INFINITY, RLIM_INFINITY }, \ ! { 0, 0 }, \ ! { INR_OPEN, INR_OPEN }, \ ! { RLIM_INFINITY, RLIM_INFINITY }, \ ! { RLIM_INFINITY, RLIM_INFINITY }, \ ! { RLIM_INFINITY, RLIM_INFINITY }, \ } #endif /* __KERNEL__ */ ! #endif Index: semaphore.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/semaphore.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** semaphore.h 2001/01/17 16:18:52 1.1 --- semaphore.h 2001/01/18 15:52:28 1.2 *************** *** 2,5 **** --- 2,6 ---- #define _VAX_SEMAPHORE_H + /* * SMP- and interrupt-safe semaphores.. *************** *** 9,42 **** * VAX port atp Nov 1998. * - this makes my brain hurt. */ ! #include <asm/atomic.h> struct semaphore { atomic_t count; int waking; ! struct wait_queue * wait; }; ! #define MUTEX ((struct semaphore) { ATOMIC_INIT(1), 0, NULL }) ! #define MUTEX_LOCKED ((struct semaphore) { ATOMIC_INIT(0), 0, NULL }) ! extern void __down(struct semaphore * sem); ! extern int __down_interruptible(struct semaphore * sem); ! extern void __up(struct semaphore * sem); ! #define sema_init(sem, val) atomic_set(&((sem)->count), (val)) ! extern inline void down(struct semaphore * sem) { if (atomic_dec_return(&sem->count) < 0) __down(sem); } ! extern inline int down_interruptible(struct semaphore * sem) { int ret = 0; if (atomic_dec_return(&sem->count) < 0) ret = __down_interruptible(sem); --- 10,98 ---- * VAX port atp Nov 1998. * - this makes my brain hurt. + * - updated for 2.4 Jan 2001. New wait_queue_head_t plus misc software rot. + * Lifted from s390 and parisc */ ! #include <asm/system.h> #include <asm/atomic.h> + #include <linux/wait.h> /* wait_queue_head_t */ + #include <linux/linkage.h> struct semaphore { atomic_t count; int waking; ! wait_queue_head_t wait; ! #if WAITQUEUE_DEBUG ! long __magic; ! #endif }; + + #if WAITQUEUE_DEBUG + # define __SEM_DEBUG_INIT(name) \ + , (long)&(name).__magic + #else + # define __SEM_DEBUG_INIT(name) + #endif ! #define __SEMAPHORE_INITIALIZER(name,count) \ ! { ATOMIC_INIT(count), 0, __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ ! __SEM_DEBUG_INIT(name) } ! #define __MUTEX_INITIALIZER(name) \ ! __SEMAPHORE_INITIALIZER(name,1) ! #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ ! struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) + #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) + #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) + extern inline void sema_init (struct semaphore *sem, int val) + { + *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); + #if WAITQUEUE_DEBUG + sem->__magic = (long)&sem->__magic; + #endif + } ! static inline void init_MUTEX (struct semaphore *sem) { + sema_init(sem, 1); + } + + static inline void init_MUTEX_LOCKED (struct semaphore *sem) + { + sema_init(sem, 0); + } + + asmlinkage void __down_failed(void /* special register calling convention */); + asmlinkage int __down_failed_interruptible(void /* params in registers */); + asmlinkage int __down_failed_trylock(void /* params in registers */); + asmlinkage void __up_wakeup(void /* special register calling convention */); + + asmlinkage void __down(struct semaphore * sem); + asmlinkage int __down_interruptible(struct semaphore * sem); + asmlinkage int __down_trylock(struct semaphore * sem); + asmlinkage void __up(struct semaphore * sem); + + extern spinlock_t semaphore_wake_lock; + + + extern __inline__ void down(struct semaphore * sem) + { + #if WAITQUEUE_DEBUG + CHECK_MAGIC(sem->__magic); + #endif + if (atomic_dec_return(&sem->count) < 0) __down(sem); } ! extern __inline__ int down_interruptible(struct semaphore * sem) { int ret = 0; + #if WAITQUEUE_DEBUG + CHECK_MAGIC(sem->__magic); + #endif + if (atomic_dec_return(&sem->count) < 0) ret = __down_interruptible(sem); *************** *** 44,52 **** } ! extern inline void up(struct semaphore * sem) { if (atomic_inc_return(&sem->count) <= 0) __up(sem); ! } #endif /* !(_VAX_SEMAPHORE_H) */ --- 100,291 ---- } ! extern __inline__ int down_trylock(struct semaphore * sem) { + int ret = 0; + #if WAITQUEUE_DEBUG + CHECK_MAGIC(sem->__magic); + #endif + + if (atomic_dec_return(&sem->count) < 0) + ret = __down_trylock(sem); + return ret; + } + + /* + * Note! This is subtle. We jump to wake people up only if + * the semaphore was negative (== somebody was waiting on it). + */ + extern __inline__ void up(struct semaphore * sem) + { + #if WAITQUEUE_DEBUG + CHECK_MAGIC(sem->__magic); + #endif if (atomic_inc_return(&sem->count) <= 0) __up(sem); ! } ! ! /* rw mutexes (should that be mutices? =) -- throw rw ! * spinlocks and semaphores together, and this is what we ! * end up with... ! * ! * The lock is initialized to BIAS. This way, a writer ! * subtracts BIAS ands gets 0 for the case of an uncontended ! * lock. Readers decrement by 1 and see a positive value ! * when uncontended, negative if there are writers waiting ! * (in which case it goes to sleep). ! * ! * The value 0x01000000 supports up to 128 processors and ! * lots of processes. BIAS must be chosen such that subl'ing ! * BIAS once per CPU will result in the long remaining ! * negative. ! * ! * In terms of fairness, this should result in the lock ! * flopping back and forth between readers and writers ! * under heavy use. ! * ! * -ben ! */ ! struct rw_semaphore { ! atomic_t count; ! volatile unsigned char write_bias_granted; ! volatile unsigned char read_bias_granted; ! volatile unsigned char pad1; ! volatile unsigned char pad2; ! wait_queue_head_t wait; ! wait_queue_head_t write_bias_wait; ! #if WAITQUEUE_DEBUG ! long __magic; ! atomic_t readers; ! atomic_t writers; ! #endif ! }; ! ! #if WAITQUEUE_DEBUG ! #define __RWSEM_DEBUG_INIT , ATOMIC_INIT(0), ATOMIC_INIT(0) ! #else ! #define __RWSEM_DEBUG_INIT /* */ ! #endif ! ! #define RW_LOCK_BIAS 0x01000000 ! ! #define __RWSEM_INITIALIZER(name,count) \ ! { ATOMIC_INIT(count), 0, 0, 0, 0, __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \ ! __WAIT_QUEUE_HEAD_INITIALIZER((name).write_bias_wait) \ ! __SEM_DEBUG_INIT(name) __RWSEM_DEBUG_INIT } ! ! #define __DECLARE_RWSEM_GENERIC(name,count) \ ! struct rw_semaphore name = __RWSEM_INITIALIZER(name,count) ! ! #define DECLARE_RWSEM(name) __DECLARE_RWSEM_GENERIC(name,RW_LOCK_BIAS) ! #define DECLARE_RWSEM_READ_LOCKED(name) __DECLARE_RWSEM_GENERIC(name,RW_LOCK_BIAS-1) ! #define DECLARE_RWSEM_WRITE_LOCKED(name) __DECLARE_RWSEM_GENERIC(name,0) ! ! extern inline void init_rwsem(struct rw_semaphore *sem) ! { ! atomic_set(&sem->count, RW_LOCK_BIAS); ! sem->read_bias_granted = 0; ! sem->write_bias_granted = 0; ! init_waitqueue_head(&sem->wait); ! init_waitqueue_head(&sem->write_bias_wait); ! #if WAITQUEUE_DEBUG ! sem->__magic = (long)&sem->__magic; ! atomic_set(&sem->readers, 0); ! atomic_set(&sem->writers, 0); ! #endif ! } ! ! #ifdef FIXME_WILLY_FIXME_FOR_REAL_THIS_TIME ! extern struct rw_semaphore *__build_read_lock(struct rw_semaphore *sem, const char *what); ! extern struct rw_semaphore *__build_write_lock(struct rw_semaphore *sem, const char *what); ! #endif ! ! /* we use FASTCALL convention for the helpers */ ! extern struct rw_semaphore *FASTCALL(__down_read_failed(struct rw_semaphore *sem)); ! extern struct rw_semaphore *FASTCALL(__down_write_failed(struct rw_semaphore *sem)); ! extern struct rw_semaphore *FASTCALL(__rwsem_wake(struct rw_semaphore *sem)); ! ! extern inline void down_read(struct rw_semaphore *sem) ! { ! #if WAITQUEUE_DEBUG ! if (sem->__magic != (long)&sem->__magic) ! BUG(); ! #endif ! #ifdef FIXME_WILLY_FIXME_FOR_REAL_THIS_TIME ! __build_read_lock(sem, "__down_read_failed"); ! #endif ! #if WAITQUEUE_DEBUG ! if (sem->write_bias_granted) ! BUG(); ! if (atomic_read(&sem->writers)) ! BUG(); ! atomic_inc(&sem->readers); ! #endif ! } ! ! extern inline void down_write(struct rw_semaphore *sem) ! { ! #if WAITQUEUE_DEBUG ! if (sem->__magic != (long)&sem->__magic) ! BUG(); ! #endif ! #ifdef FIXME_WILLY_FIXME_FOR_REAL_THIS_TIME ! __build_write_lock(sem, "__down_write_failed"); ! #endif ! #if WAITQUEUE_DEBUG ! if (atomic_read(&sem->writers)) ! BUG(); ! if (atomic_read(&sem->readers)) ! BUG(); ! if (sem->read_bias_granted) ! BUG(); ! if (sem->write_bias_granted) ! BUG(); ! atomic_inc(&sem->writers); ! #endif ! } ! ! /* When a reader does a release, the only significant ! * case is when there was a writer waiting, and we've ! * bumped the count to 0: we must wake the writer up. ! */ ! extern inline void __up_read(struct rw_semaphore *sem) ! { ! } ! ! /* releasing the writer is easy -- just release it and ! * wake up any sleepers. ! */ ! extern inline void __up_write(struct rw_semaphore *sem) ! { ! } ! ! extern inline void up_read(struct rw_semaphore *sem) ! { ! #if WAITQUEUE_DEBUG ! if (sem->write_bias_granted) ! BUG(); ! if (atomic_read(&sem->writers)) ! BUG(); ! atomic_dec(&sem->readers); ! #endif ! __up_read(sem); ! } ! ! extern inline void up_write(struct rw_semaphore *sem) ! { ! #if WAITQUEUE_DEBUG ! if (sem->read_bias_granted) ! BUG(); ! if (sem->write_bias_granted) ! BUG(); ! if (atomic_read(&sem->readers)) ! BUG(); ! if (atomic_read(&sem->writers) != 1) ! BUG(); ! atomic_dec(&sem->writers); ! #endif ! __up_write(sem); ! } ! #endif /* !(_VAX_SEMAPHORE_H) */ Index: serial.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/serial.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** serial.h 2001/01/17 16:18:52 1.1 --- serial.h 2001/01/18 15:52:28 1.2 *************** *** 1,8 **** ! #ifndef _VAX_SERIAL_H ! #define _VAX_SERIAL_H ! /* We don't have any PC-style UARTs, so we don't want drivers/char/serial.c ! do do anything. So, we leave SERIAL_PORT_DFNS empty */ ! #define SERIAL_PORT_DFNS ! #endif _VAX_SERIAL_H --- 1,84 ---- ! #ifndef __VAX_SERIAL_H ! #define __VAX_SERIAL_H ! /* serial.h */ ! /* Jan 2001 atp. Added. Not sure what the base clock for VAX ! * serial boards is - so go with 1.8Mhz at present ! */ ! #include <linux/config.h> ! ! /* ! * This assumes you have a 1.8432 MHz clock for your UART. ! * ! * It'd be nice if someone built a serial card with a 24.576 MHz ! * clock, since the 16550A is capable of handling a top speed of 1.5 ! * megabits/second; but this requires the faster clock. ! */ ! #define BASE_BAUD ( 1843200 / 16 ) ! ! /* Standard COM flags (except for COM4, because of the 8514 problem) */ ! #ifdef CONFIG_SERIAL_DETECT_IRQ ! #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ) ! #define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ) ! #else ! #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST) ! #define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF ! #endif ! ! #ifdef CONFIG_SERIAL_MANY_PORTS ! #define FOURPORT_FLAGS ASYNC_FOURPORT ! #define ACCENT_FLAGS 0 ! #define BOCA_FLAGS 0 ! #define RS_TABLE_SIZE 64 ! #else ! #define RS_TABLE_SIZE 4 ! #endif ! ! #define STD_SERIAL_PORT_DEFNS \ ! /* UART CLK PORT IRQ FLAGS */ \ ! { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ ! { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \ ! { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ ! { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ ! ! ! #ifdef CONFIG_SERIAL_MANY_PORTS ! #define EXTRA_SERIAL_PORT_DEFNS \ ! { 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS }, /* ttyS4 */ \ ! { 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS }, /* ttyS5 */ \ ! { 0, BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS }, /* ttyS6 */ \ ! { 0, BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS }, /* ttyS7 */ \ ! { 0, BASE_BAUD, 0x2A0, 5, FOURPORT_FLAGS }, /* ttyS8 */ \ ! { 0, BASE_BAUD, 0x2A8, 5, FOURPORT_FLAGS }, /* ttyS9 */ \ ! { 0, BASE_BAUD, 0x2B0, 5, FOURPORT_FLAGS }, /* ttyS10 */ \ ! { 0, BASE_BAUD, 0x2B8, 5, FOURPORT_FLAGS }, /* ttyS11 */ \ ! { 0, BASE_BAUD, 0x330, 4, ACCENT_FLAGS }, /* ttyS12 */ \ ! { 0, BASE_BAUD, 0x338, 4, ACCENT_FLAGS }, /* ttyS13 */ \ ! { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS14 (spare) */ \ ! { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS15 (spare) */ \ ! { 0, BASE_BAUD, 0x100, 12, BOCA_FLAGS }, /* ttyS16 */ \ ! { 0, BASE_BAUD, 0x108, 12, BOCA_FLAGS }, /* ttyS17 */ \ ! { 0, BASE_BAUD, 0x110, 12, BOCA_FLAGS }, /* ttyS18 */ \ ! { 0, BASE_BAUD, 0x118, 12, BOCA_FLAGS }, /* ttyS19 */ \ ! { 0, BASE_BAUD, 0x120, 12, BOCA_FLAGS }, /* ttyS20 */ \ ! { 0, BASE_BAUD, 0x128, 12, BOCA_FLAGS }, /* ttyS21 */ \ ! { 0, BASE_BAUD, 0x130, 12, BOCA_FLAGS }, /* ttyS22 */ \ ! { 0, BASE_BAUD, 0x138, 12, BOCA_FLAGS }, /* ttyS23 */ \ ! { 0, BASE_BAUD, 0x140, 12, BOCA_FLAGS }, /* ttyS24 */ \ ! { 0, BASE_BAUD, 0x148, 12, BOCA_FLAGS }, /* ttyS25 */ \ ! { 0, BASE_BAUD, 0x150, 12, BOCA_FLAGS }, /* ttyS26 */ \ ! { 0, BASE_BAUD, 0x158, 12, BOCA_FLAGS }, /* ttyS27 */ \ ! { 0, BASE_BAUD, 0x160, 12, BOCA_FLAGS }, /* ttyS28 */ \ ! { 0, BASE_BAUD, 0x168, 12, BOCA_FLAGS }, /* ttyS29 */ \ ! { 0, BASE_BAUD, 0x170, 12, BOCA_FLAGS }, /* ttyS30 */ \ ! { 0, BASE_BAUD, 0x178, 12, BOCA_FLAGS }, /* ttyS31 */ ! #else ! #define EXTRA_SERIAL_PORT_DEFNS ! #endif ! ! #define SERIAL_PORT_DFNS \ ! STD_SERIAL_PORT_DEFNS \ ! EXTRA_SERIAL_PORT_DEFNS ! ! #endif /* __VAX_SERIAL_H */ Index: shmparam.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/shmparam.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** shmparam.h 2001/01/17 16:18:52 1.1 --- shmparam.h 2001/01/18 15:52:28 1.2 *************** *** 1,46 **** ! #ifndef _VAX_SHMPARAM_H ! #define _VAX_SHMPARAM_H ! /* address range for shared memory attaches if no address passed to shmat() */ ! #define SHM_RANGE_START 0x50000000 ! #define SHM_RANGE_END 0x60000000 ! /* ! * Format of a swap-entry for shared memory pages currently out in ! * swap space (see also mm/swap.c). ! * ! * SWP_TYPE = SHM_SWP_TYPE ! * SWP_OFFSET is used as follows: ! * ! * bits 0..6 : id of shared memory segment page belongs to (SHM_ID) ! * bits 7..21: index of page within shared memory segment (SHM_IDX) ! * (actually fewer bits get used since SHMMAX is so low) ! */ ! /* ! * Keep _SHM_ID_BITS as low as possible since SHMMNI depends on it and ! * there is a static array of size SHMMNI. ! */ ! #define _SHM_ID_BITS 7 ! #define SHM_ID_MASK ((1<<_SHM_ID_BITS)-1) ! ! #define SHM_IDX_SHIFT (_SHM_ID_BITS) ! #define _SHM_IDX_BITS 15 ! #define SHM_IDX_MASK ((1<<_SHM_IDX_BITS)-1) ! ! /* ! * _SHM_ID_BITS + _SHM_IDX_BITS must be <= 24 on the i386 and ! * SHMMAX <= (PAGE_SIZE << _SHM_IDX_BITS). ! */ ! ! #define SHMMAX 0x2000000 /* max shared seg size (bytes) */ ! /* Try not to change the default shipped SHMMAX - people rely on it */ ! ! #define SHMMIN 1 /* really PAGE_SIZE */ /* min shared seg size (bytes) */ ! #define SHMMNI (1<<_SHM_ID_BITS) /* max num of segs system wide */ ! #define SHMALL /* max shm system wide (pages) */ \ ! (1<<(_SHM_IDX_BITS+_SHM_ID_BITS)) ! #define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ ! #define SHMSEG SHMMNI /* max shared segs per process */ ! ! #endif /* _VAX_SHMPARAM_H */ --- 1,8 ---- ! #ifndef __ASM_VAX_SHMPARAM_H ! #define __ASM_VAX_SHMPARAM_H ! /* atp jan 2001 - 2.4 merge */ ! #define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ ! #endif /* _ASM_VAX_SHMPARAM_H */ Index: system.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/system.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** system.h 2001/01/17 16:18:52 1.1 --- system.h 2001/01/18 15:52:28 1.2 *************** *** 2,9 **** --- 2,16 ---- #define _VAX_SYSTEM_H + #include <linux/config.h> + #include <asm/page.h> #include <asm/mtpr.h> #include <linux/kernel.h> + + /* any preparation needed before a context switch ? */ + #define prepare_to_switch() do { } while(0) + + /* FIXME: process context switch */ Index: termios.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/termios.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** termios.h 2001/01/17 16:18:52 1.1 --- termios.h 2001/01/18 15:52:28 1.2 *************** *** 3,6 **** --- 3,8 ---- /* from asm-i386 */ + /* atp jan 2001. updated for 2.4 merge. */ + #include <asm/termbits.h> #include <asm/ioctls.h> *************** *** 37,40 **** --- 39,43 ---- #define TIOCM_OUT1 0x2000 #define TIOCM_OUT2 0x4000 + #define TIOCM_LOOP 0x8000 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ *************** *** 52,55 **** --- 55,61 ---- #define N_R3964 9 /* Reserved for Simatic R3964 module */ #define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Da...@mv...> */ + #define N_IRDA 11 /* Linux IR - http://www.cs.uit.no/~dagb/irda/irda.html */ + #define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */ + #define N_HDLC 13 /* synchronous HDLC */ #ifdef __KERNEL__ |
From: Andy P. <at...@us...> - 2001-01-18 15:52:26
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/char In directory usw-pr-cvs1:/tmp/cvs-serv5429/drivers/char Modified Files: dz.c Log Message: Updates to adapt code base from 2.2 to 2.4 tree. Sync up to atp 2.4 tree. Index: dz.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/dz.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** dz.c 2001/01/14 17:55:21 1.1.1.1 --- dz.c 2001/01/18 15:52:27 1.2 *************** *** 40,46 **** --- 40,51 ---- #include <linux/tqueue.h> #include <linux/interrupt.h> + + #ifdef CONFIG_VAX + #define SERIAL 0 /* FIXME: this is wrong */ + #else #include <asm-mips/wbflush.h> /* for definition of SERIAL */ #include <asm/dec/interrupts.h> + #endif /* for definition of struct console */ *************** *** 58,69 **** #include <asm/uaccess.h> #include <asm/irq.h> #include <asm/dec/machtype.h> #include <asm/dec/kn01.h> #include <asm/dec/kn02.h> #ifdef DEBUG_DZ #include <linux/ptrace.h> #include <linux/fs.h> - #include <asm/bootinfo.h> extern int (*prom_printf) (char *,...); --- 63,80 ---- #include <asm/uaccess.h> #include <asm/irq.h> + + #ifdef CONFIG_VAX + #include <asm/dz11.h> + volatile struct dz11_regs *dz11_addr; + #else #include <asm/dec/machtype.h> #include <asm/dec/kn01.h> #include <asm/dec/kn02.h> + #include <asm/bootinfo.h> + #endif #ifdef DEBUG_DZ #include <linux/ptrace.h> #include <linux/fs.h> extern int (*prom_printf) (char *,...); *************** *** 231,235 **** ch = UCHAR(status); /* grab the char */ ! #ifdef 0 if (info->is_console) { if (ch == 0) return; /* it's a break ... */ --- 242,246 ---- ch = UCHAR(status); /* grab the char */ ! #if 0 if (info->is_console) { if (ch == 0) return; /* it's a break ... */ *************** *** 1353,1361 **** info->magic = SERIAL_MAGIC; if ((mips_machtype == MACH_DS23100) || (mips_machtype == MACH_DS5100)) info->port = (unsigned long) KN01_DZ11_BASE; else info->port = (unsigned long) KN02_DZ11_BASE; ! info->line = i; info->tty = 0; --- 1364,1376 ---- info->magic = SERIAL_MAGIC; + #ifdef CONFIG_VAX + info->port = (unsigned long) 0x200A0000; + #else if ((mips_machtype == MACH_DS23100) || (mips_machtype == MACH_DS5100)) info->port = (unsigned long) KN01_DZ11_BASE; else info->port = (unsigned long) KN02_DZ11_BASE; ! #endif ! info->line = i; info->tty = 0; *************** *** 1522,1529 **** /* TOFIX: force to console line */ dz_console = &multi[CONSOLE_LINE]; ! if ((mips_machtype == MACH_DS23100) || (mips_machtype == MACH_DS5100)) dz_console->port = KN01_DZ11_BASE; else dz_console->port = KN02_DZ11_BASE; dz_console->line = CONSOLE_LINE; --- 1537,1548 ---- /* TOFIX: force to console line */ dz_console = &multi[CONSOLE_LINE]; ! #ifdef CONFIG_VAX ! dz_console->port = (unsigned long)dz11_addr; ! #else ! if ((mips_machtype == MACH_DS23100) || (mips_machtype == MACH_DS5100)) dz_console->port = KN01_DZ11_BASE; else dz_console->port = KN02_DZ11_BASE; + #endif dz_console->line = CONSOLE_LINE; |
From: Andy P. <at...@us...> - 2001-01-18 15:41:35
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax/junk In directory usw-pr-cvs1:/tmp/cvs-serv4826/junk Log Message: Directory /cvsroot/linux-vax/kernel-2.4/include/asm-vax/junk added to the repository |
Update of /cvsroot/linux-vax/kernel-2.4/Documentation/vax In directory usw-pr-cvs1:/tmp/cvs-serv32365 Added Files: README assembler.txt interrupts.txt ka43-interrupts.txt memory.txt syscall.txt xdelta.txt Log Message: Bringing in docs from kernel-2.2 tree --- NEW FILE --- Last updated Jul 10, 2000 GETTING STARTED To play with this port you need the following: 1. The cross-compiler and binutils 2. The kernel sources 3. A MOP server (mopd) 4. A VAX with an ethernet card or SCSI interface Unfortunately, there are a few large downloads involved to get up and running... 1. The cross-compiler and binutils First download the following: From ftp://linux-vax.sourceforge.net/pub/linux-vax/tools/sources/ binutils-2.9.1.0.25.tar.bz2 egcs-1.1.2.tar.bz2 From ftp://linux-vax.sourceforge.net/pub/linux-vax/tools/patches/ binutils-2.9.1.0.25-20000219.patch.bz2 egcs-1.1.2-20000219.patch.bz2 From ftp://linux-vax.sourceforge.net/pub/linux-vax/tools/ build-vax.sh one-tree-vax.sh Create a new directory to unpack all this stuff in and untar the egcs and binutils tarballs, apply the patches and copy in the shell scripts: $ mkdir vax-cross $ cd vax-cross $ tar xvf --use=bzip2 DOWNLOADS/binutils-2.9.1.0.25.tar.bz2 $ tar xvf --use=bzip2 DOWNLOADS/egcs-1.1.2.tar.bz2 $ cd binutils-2.9.1.0.25.current $ patch -p1 < DOWNLOADS/binutils-2.9.1.0.25-20000219.patch $ cd ../egcs-1.1.2.current $ patch -p1 < DOWNLOADS/egcs-1.1.2-20000219.patch $ cd .. $ cp DOWNLOADS/one-tree-vax.sh DOWNLOADS/build-vax.sh . Then create the combined binutils/egcs source tree and build it: $ ./one-tree-vax.sh $ ./build-vax.sh These should complete without errors. If you get errors, something is seriously wrong and you probably won't get a correctly-installed toolchain. All object files and binaries will be created in vax-cross/b-vax-dec-linux without touching the source trees. Then install them: $ su -c './build-vax.sh install' This will create programs in /usr/local/bin prefixed with vax-dec-linux- (for example /usr/local/bin/vax-dec-linux-gcc) and directories /usr/local/vax-dec-linux and /usr/local/lib/gcc-lib/vax-dec-linux. This will not touch your current GCC installation. 2. The kernel sources Grab the sources from CVS: $ cvs -d:pserver:ano...@cv...:/cvsroot/linux-vax login (hit return at the password prompt). $ cvs -z9 -d:pserver:ano...@cv...:/cvsroot/linux-vax co kernel cd into the kernel dir created by cvs and do $ make oldconfig to create a default .config. (Don't go playing with the config, please. It will probably just break the compile.) Compile a network-bootable image by doing $ make mopboot This will generate plenty of compiler and linker warnings, but you should end up with a vmlinux.SYS file sized about 280K. If you are hacking around in arch/vax, you can do a quicker re-compile by doing $ make mopbootx which just rebuilds stuff in arch/vax and re-links the kernel. If you have your VAX and Linux machine on the same SCSI chain and you've got a scratch disk handy, you can do $ make diskboot && dd if=vmlinux.dsk of=/dev/sdX and then tell your VAX to boot from this disk. This is faster than netbooting. NOTE THAT THIS WILL DESTROY ANY FILESYSTEM AREADY ON THE DISK. YOU HAVE BEEN WARNED. 3. A MOP server (mopd) Sources at http://www.mssl.ucl.ac.uk/~atp/linux-vax/download/mopd-linux.tar.gz Compile and install. Create the directory /tftpboot/mop. mopd looks here, and here only, when searching for boot images. Create a link from /tftpboot/mop/<ether>.SYS to the vmlinux.SYS file in your development tree. <ether> is the ethernet address of your VAX in _lowercase_ with no separators. For example, mine is 08002b0db20f.SYS. In can be useful to run mopd with the -d switch to see what it receives from the network. 4. A VAX with an ethernet card or SCSI interface. As we don't really have any hardware support in yet, hardware requirements are pretty minimal: CPU Serial console 8 MB ram Ethernet card So far we've had success reports from people with the following machines: VAXstation 2000 VAXstation 3100/m30 VAXstation 3100/m76 VAXstation 3500 VAXstation II/GPX First you'll want to get your VAX to stop at the >>> console prompt at power up. There is usually a switch on the CPU board, front panel or rear panel (depending on the model) to select this. Look for a circle with a dot inside. Hook your VAX up to a standalone terminal, such a VT-series terminal or a serial port on your PC. The VAX will probably have an MMJ serial connector. I can't find a URL with the pin-out info for this guy. If you have an OS installed (e.g. VMS, Ultrix, NetBSD), it would be a good idea to take your disks offline, if your VAX has a handy way to do this. For example, the VS3500 has front panel switches to take the internal disks offline. At the >>> prompt, try B <return>, B XQA0 or B ESA0 and see if one of them tries to netboot (watch the output of mopd -d). If it looks like mopd sent over a boot image, let us know what happens. Depending on your hardware, you might get a kernel version banner and some diagnostic output. However, if we don't support your serial console hardware, you'll probably just get an error message such as 'HLT INST' and return to the >>> prompt. If this happens, do the following: >>> E PC >>> E PSL >>> E SP >>> E/V @ >>> E >>> E >>> E >>> E >>> E >>> E And send us the output. This will hopefully give us clues as to how to get your serial console supported. If your VAX has a SCSI interface and you have an external SCSI connector on your Linux box, you can connect both of them to the same SCSI bus. (Make sure the host adapters in each machine have different SCSI IDs. VAXen usually ship with the host adapter set to ID 6, PCs are usually ID 7.) Then you can copy a kernel image onto a disk on the bus and boot from there. NOTE THAT THIS WILL DESTROY ANY FILESYSTEM AREADY ON THE DISK. YOU HAVE BEEN WARNED. --- NEW FILE --- The GNU assembler in Andy's cross compilation tool set is a little different from DEC's MACRO32 assembler. This file summarises the differences. 1. #, ^ and @ become $, ` and * In VAX MACRO you might write: movl #0, 8(r5) movl #0, @8(r5) movl #0, L^8(r5) In gas, these are written: movl $0, r0 movl $0, *8(r5) movl $0, L`8(r5) 2. ^X becomes 0x Hex constants are prefixed with 0x, rather than ^x Similarly, a leading zero not followed by an x implies octal. Therefore the following instructions are equivalent: VAX MACRO: movl #64, r0 movl #^x40, r0 movl #^o100, r0 gas: movl $64, r0 movl $0x40, r0 movl $0100, r0 --- NEW FILE --- 20000709 KPH Here's how I intend to deal with interrupt and exception dispatching. o During boot time, trap_init fills the whole SCB with stray handlers. Since the CPU might save some longwords of data on the stack after an exception, we can't just continue from one of these exceptions in the general case. (However, interrupts from devices that come through the second and subsequent pages of the SCB should be continuable.) The stray handlers might help out with autoprobing interrupts if we decide to implement probe_irq_on() and probe_irq_off(). Dammit, I hate using the term IRQ when talking about VAXen. It just seems so PC-centric... o When an interrupt (or exception) occurs and the CPU dispatches to the handler address in the SCB, the only clue we have as to the interrupt or exception number is the handler address. There is no other way to tell which interrupt happened. This implies that every interrupt or exception handler must have a unique address. o When a driver (or other code) calls request_irq(), we allocate a data structure (let's call it irqvector) that contains a struct irqaction and a little bit of in-line code. This code just pushes PC on the stack and jumps to the generic handler. (It does this by executing a JSB instruction.) This generic handler sees a stack that looks like: SP: handler_PC (inside the irqvector) (maybe) exception info saved PC saved PSL The generic handler builds the required pt_regs struct by duplicating the saved PC/PSL and saving all the other registers. This makes the stack look like: SP: saved R0 saved R1 ... saved R11 saved FP saved AP saved SP saved PC saved PSL saved R0 handler PC (inside the irqvector) (maybe) exception info saved PC saved PSL (The second saved R0 is because we need a working register in the handler code.) The generic handler then obtains the handler PC from back up the stack, then passes this PC, the addr of the pt_regs and exception info to a dispatcher function. This function is responsible for calculating the start address of the irqvector structure and calling irqaction.handler(). When control returns to the generic handler, it restores the registers, clears the stack down as far as the original saved PC and PSL and does an REI. Anyone playing around with this stuff really needs to read the Interrupts and Exceptions chapter in the VAX Architecture Reference Manual. --- NEW FILE --- $Id: ka43-interrupts.txt,v 1.1 2001/01/18 00:10:39 kenn Exp $ This info was obtained by trawling through a running VMS 7.2 on a VAXstation 3100/m76 (KA43 CPU) with the System Dump Analyzer (ANALYZE/SYSTEM). First off, this is the SCB (system control block): SDA> examine exe$gl_scb EXE$GL_SCB: 81258000 "..%." SDA> examine 81258000:81258000+3fc 80BD6E09 80002491 8000A801 80002119 .!.......$...n½. 81258000 800025F8 80B723A4 80002518 80E5CFC0 ..å..%...#o.Ø%.. 81258010 80B722C0 80B723AC 80BB35B8 80B7223C <"o..5».¬#o.."o. 81258020 80BB3479 80002118 800021D0 80002308 .#...!...!..y4». 81258030 80002300 800022F8 80B724D8 80B725E0 à%o.b$o.Ø"...#.. 81258040 8000A819 8000A811 8000A809 80002118 .!.............. 81258050 80002118 80002520 80002118 8000A821 !....!.. %...!.. 81258060 80002118 80002118 80002118 80002118 .!...!...!...!.. 81258070 80BE0C00 80BD04D0 80002118 80002118 .!...!....½..... 81258080 80C4E921 80C4E621 80002118 80BD3E91 .>½..!..!æÄ.!éÄ. 81258090 80C4E639 80C4E631 80C4E629 80C4E641 AæÄ.)æÄ.1æÄ.9æÄ. 812580A0 80002118 800027B1 80002118 80002471 q$...!..±'...!.. 812580B0 80E60A9C 80E60A00 80002118 80C4E739 9çÄ..!....æ...æ. 812580C0 80002118 80002118 80002118 80002118 .!...!...!...!.. 812580D0 80002118 80002118 80002118 80002118 .!...!...!...!.. 812580E0 80C50A5D 80C50A25 80002118 80002118 .!...!..%.Å.].Å. 812580F0 80002119 80002119 80002119 80002119 .!...!...!...!.. 81258100 80002119 80002119 80002119 80002119 .!...!...!...!.. 81258110 80002119 80002119 80002119 80002119 .!...!...!...!.. 81258120 80002119 80002119 80002119 80002119 .!...!...!...!.. 81258130 80002119 80002119 80002119 80002119 .!...!...!...!.. 81258140 80002119 80002119 80002119 80002119 .!...!...!...!.. 81258150 80002119 80002119 80002119 80002119 .!...!...!...!.. 81258160 80002119 80002119 80002119 80002119 .!...!...!...!.. 81258170 80002119 80002119 80002119 80002119 .!...!...!...!.. 81258180 80002119 80002119 80002119 80002119 .!...!...!...!.. 81258190 80002119 80002119 80002119 80002119 .!...!...!...!.. 812581A0 80002119 80002119 80002119 80002119 .!...!...!...!.. 812581B0 80002119 80002119 80002119 80002119 .!...!...!...!.. 812581C0 80002119 80002119 80002119 80002119 .!...!...!...!.. 812581D0 80002119 80002119 80002119 80002119 .!...!...!...!.. 812581E0 80002119 80002119 80002119 80002119 .!...!...!...!.. 812581F0 8000A829 8000A829 8000A829 80E642D9 .Bæ.)...)...)... 81258200 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 81258210 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 81258220 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 81258230 8000A829 80DBB389 80DBB351 8000A829 )...Q.......)... 81258240 8000A829 8000A829 8000A829 80D875D1 Ñub.)...)...)... 81258250 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 81258260 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 81258270 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 81258280 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 81258290 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 812582A0 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 812582B0 8000A829 8000A829 80DC33C9 80DC3391 .3Ü.É3Ü.)...)... 812582C0 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 812582D0 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 812582E0 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 812582F0 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 81258300 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 81258310 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 81258320 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 81258330 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 81258340 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 81258350 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 81258360 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 81258370 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 81258380 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 81258390 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 812583A0 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 812583B0 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 812583C0 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 812583D0 8000A829 8000A829 8000A829 8000A829 )...)...)...)... 812583E0 80D9CF11 80DB9BD1 8000A829 8000A829 )...)...Ñ....... 812583F0 (The hex data reads right-to-left and the ASCII reads left-to-right, i.e. VMS DUMP format.) The part we're interested in here is the second page (containing the device vectors). Most of these vectors are set to 8000a829 (which corresponds to address 8000a828, and the CPU should switch to the interrupt stack): SDA> examine/instr 8000a828 UBA$UNEXINT: JMP @#MCHK+00700 UBA$UNEXINT+00006: HALT So, these are unexpected interrupts and will lead to code near the machine check handling code. The other (used) vectors are: vector addr vector number handler addr 81258200 80 80e642d8 81258244 91 80dbb350 81258248 92 80dbb388 81258250 94 80d875d0 812582c0 b0 80dc3390 812582c4 b1 80dc33c8 812583f8 fe 80db9bd0 812583fc ff 80d9cf10 These interrupt handler addresses are containing within the CRB (Channel Request Block) for the relevant device or controller. Let's chase these down. First vector 0x80: SDA> examine/instr 80e642d8:80e642d8+10 MCHK+006F8: INCL @#IO$GL_UBA_INT0 MCHK+006FE: BRB MCHK+00700 MCHK+00700: REI This just increments an interrupt counter and dismisses the interrupt. (So the unexpected interrupt handler above effectively just dismisses the interrupt.) Next vector 0x91: SDA> examine/instr/noskip 80DBB350;2 80DBB350: PUSHR #3F 80DBB352: JSB @#GABDRIVER+00942 So, this interrupt is probably handled by GABDRIVER. Let's verify this by looking at GABDRIVER's data structures: SDA> show device ga ... --- Primary Channel Request Block (CRB) 80DBB300 --- Reference count 1 Wait queue empty IDB address 80DB5640 Unit init. 80E0D589 Int. service 80E0DCC2 ADP address 80D87300 Ctrl. init. 80E0D4ED ... SDA> format 80DBB300 80DBB300 CRB$L_FQFL 00000000 ... 80DBB350 CRB$L_INTD 9F163FBB 80DBB354 80E0DCC2 GABDRIVER+00942 ... 80DBB388 CRB$L_INTD2 9F163FBB SDA> So the interrupt handler is 0x50 bytes into the CRB. Interestingly, there's another interrupt handler 0x88 bytes into the CRB as well. This corresponds to vector 0x92 in the table above. SDA> examine/instr 80DBB388;2 80DBB388: PUSHR #3F 80DBB38A: JSB @#GABDRIVER+0145C So this device uses two interrupt vectors. This means that the CRBs for the other vectors are: vector addr num handler addr CRB address driver 81258200 80 80e642d8 (no driver) 81258244 91 80dbb350 80dbb300 GABDRIVER 81258248 92 80dbb388 80dbb300 GABDRIVER 81258250 94 80d875d0 80d87580 ESDRIVER 812582c0 b0 80dc3390 80dc3340 YEDRIVER 812582c4 b1 80dc33c8 80dc3340 YEDRIVER 812583f8 fe 80db9bd0 80db9b80 PKNDRIVER (PKA) 812583fc ff 80d9cf10 80d9cec0 PKNDRIVER (PKB) GABDRIVER is the framebuffer driver, ESDRIVER is ethernet, YEDRIVER is a terminal port driver (I think) and PKNDRIVER is a SCSI port driver. So, to summarize, the KA43 device interrupts are: Framebuffer 0x91, 0x92 LANCE ethernet 0x94 DZ11 serial 0xb0, 0xb1 NCR5380 SCSI: internal 0xfe external 0xff --- NEW FILE --- $Id: memory.txt,v 1.1 2001/01/18 00:10:39 kenn Exp $ KPH 20000416 We need to decide on what the overall memory map in S0 space will look like. Here's what I think: Start Length 80000000 1MB Spare space left over from kernel load time. Will be put on the kernel's free list. 80100000 kern_size Kernel code, data and bss sections pg0 spt_size System page table. Length will be dependent on physical memory size plus some extra space for mapping I/O pages mem_map memsize*40 The mem_map array contains one entry for each physical page of ram. remainder Remaining pages are put on free list ====================================================================== KPH 20000107 (2.2.10-991101-kh5) After a little discussion with Andy, it looks like we'll create a full-size system page table (SPT) in the asm code in head.S. This SPT needs to have one entry for each physical page of memory and additional entries to do any I/O space and ROM mapping required. This page table needs to be physically contiguous. We also need to define a region for the interrupt stack. 4KB should be plenty. (Might be a good idea to put canary values at the bottom and check them periodically.) We need an SCB (system control block, contains the interrupt and exception dispatch vectors). ====================================================================== KPH 19991118 (2.2.10-991101-kh2) Here's what happens with memory management during boot time: o VMB locates a region of good memory and leaves a little space for a small stack. On my VAXstation 3500, this is always physical address 0x00005000 The initial SP is 0x00005200, leaving 1 page for a stack. (If your memory has no faults, then you could grow the stack below 0x00005000, but VMB makes no guarantees about those pages.) o VMB loads the kernel image via MOP. On my machine, this is always 00005800 o VMB calls the entry point (512 bytes into the image - that's why there is a page of zeroes tagged onto the front of the MOP image) Again, on my machine, that means that 'start' in head.S gets called at 00005A00. o head.S then copies the whole loaded image up to 00100000 (1 MB). Once VM is enabled, virtual address 80100000 will be mapped to this physical address. The kernel image is linked with a base address of 80100000 (see arch/vax/vmlinux.lds). o The BSS section is filled with zeroes. o At this point, head.S jumps from somewhere near 00005A00 to the corresponding point above 00100000 (that's the jump to 'reloc' in head.S). Note that SP is still down at 00005200. o A system page table is built at physical address 00200000 (2MB). 16384 (0x4000) page table entries (PTEs) are created. Each is marked as valid and protection is set to user write. The page frame numbers (PFNs) in these PTEs are set to map the lower 8MB of physical memory. The System Base Register (SBR) and System Length Register (SLR) are loaded with 00200000 and 4000 to point to this page table. Once VM is turned on, the addresses 80000000 to 807fffff will map to the first 8MB of physical memory. But, we haven't turned on VM yet... o To enable VM and start running the kernel code in S0-space above 80100000, we need to do two things: 1. Set the MAPEN processor register to 1 2. Jump to an address in (the now valid) S0 space. However, immediately after we've set MAPEN, the PC still contains an address somewhere above 00100000. The CPU now interprets this as a virtual address in P0-space. We have to arrange for this address to be valid, otherwise we'll crash and burn... To make this address valid, we need to make a P0 page table that will be active when MAPEN is set. First we work out how many pages from the start of memory to the _VAX_start_mm code (i.e. _VAX_start_mm's page frame number, or PFN). We have a small, 8-page P0 page table that we fill with this PFN (and the 7 following PFNs). Then we load the P0 Base Register with a value that points to the correct distance _before_ our little P0 page table such that the first entry in the table maps _VAX_start_mm. For example: o _VAX_start_mm gets loaded at 00005C00 o head.S relocates it to 00100200, which is PFN 801 o Assume p0_table is at 00100280. This will be mapped by virtual address 80100280 once MAPEN is set. o We fill our little P0 page table to map PFNs 801 to 808 o We set P0BR to 80100280 - (801*4). The *4 is because a PTE is 4 bytes. P0LR is set to 809. Note that we're counting on the fact that nothing is going to refer to any address between 00000000 and 001001ff. If something does refer to an address in this range, we're in trouble because the PTEs for these addresses are not initialized correctly. o We load P1BR and P1LR with 'sensible' values to prevent the CPU from freaking out. o Next we have to fix up the addresses on the stack. Note that SP still points to somewhere below 00005200 (on my machine, anyway...). _VAX_start_mm is called via a CALLS from head.S, so there is exactly one full stack frame that needs fixing up: o The saved AP, FP and PC are incremented by 0x80000000 to point to the corresponding addresses in S0 space once VM gets turned on (remember that physical addresses 00000000 to 007fffff will be mapped by 80000000 to 807fffff). o The current SP and FP are incremented by 80000000. o R6 is loaded with the physical address of 'vreloc' in mmstart.S and incremented by 80000000 to give vreloc's soon-to-be-valid virtual address. o MAPEN is set to 1. At mentioned above, PC still contains a virtual address that is something above 00100200, but our fake P0 page table maps that to the same physical address. o We jump to vreloc's virtual address held in R6. o Job is done... return to head.S which then calls start_kernel. Some thoughts on the above: 1. On older VAXen (780-era), VMB only tries to find 64Kb of good memory. If this is still true on newer VAXen, then this won't be enough to hold the full Linux kernel. Instead, what we'll probably have to do to boot on machines with some bad memory is: o VMB loads a small boot loader which creates a system page table that maps all good memory pages (or maybe maps all pages and marks bad ones as invalid). o This boot loader then enables VM and loads the kernel proper. This isn't so nice because pulling the whole kernel across MOP means we don't have to write boot-time device drivers. 2. What happens if the kernel image is too big to fit between 00005A00 and 00100000 (i.e. is 1MB or bigger)? Well, first we'll have to relocate the kernel by starting the copy at the top and working down. Secondly, we'll have to make sure that all code that runs before the jump to 001xxxxx is at the start of the image. (Not a problem, actually... The linker script will take care of that.) 3. What about machines with more than 8MB? Or less than 8MB? What's the best place to pull the memory size and good/bad info from the RPB? Perhaps in head.S when we're building the system page table? --- NEW FILE --- $Id: syscall.txt,v 1.1 2001/01/18 00:10:39 kenn Exp $ This file describes how syscalls work on the VAX. When userland wants to do a system call, calls a wrapper function in the standard way (so we get a standard call frame built on the stack). This wrapper then simply does a CHMK (change mode to kernel) instruction, specifying the number of the syscall: In file user-app.c: fd = creat(filename, mode); In libc: #define CHMK(x) __asm__("chmk %0" : : "g" (x) : ) int creat(const char *filename, mode_t mode) { CHMK(__NR_creat); } In the kernel, the exception handler for change-mode-to-kernel exceptions will get control. At this point, the stack looks like: SP: <local stack frame> struct pt_regs * (points to pt_regs further up on stack) void *excep_info (points to info pushed by hardware further up on stack ) ... struct pt_regs saved_regs ... syscall_number (pointed to by excep_info pointer above) saved PC saved PSL The saved PSL, saved PC and syscall number are pushed by the hardware when executing the CHMK instruction. The saved_regs are pushed by the common exception handler code and eventually we end up calling chmk_handler(): void chmk_handler(struct pt_regs *regs, void *excep_info) { int syscall = *(int *)excep_info; ... The next step is to collect the arguments from user-space. We cannot assume that they will be on the user stack since the app may have called creat() via a CALLG instruction. However, we do know that the AP (argument pointer register) inside creat() in libc will point to the argument list. So we pull AP out of the pt_regs structure. This will point to a standard VAX argument list, which starts with the number of arguments: AP: arg_count (should be less than 256, if not return error because userland is breaking the rules) AP+4: arg1 AP+8: arg2 ... Of course, this is all completely untrusted so we have to be careful to check all user-land accesses. We also need to copy the complete argument list to kernel space before passing them to the actual syscall function (which will do final validation). (Otherwise another user-land task could modify a pointer argument after we've verified that it points to accessible memory, but before we actually dereference it.) We try to copy the whole argument list to the kernel stack and then do a CALLS to the actual syscall handler. --- NEW FILE --- KPH - 20000206 Here's how to use XDELTA as a kernel debugger on a VS3500 with VMB 5.3. 1. Edit arch/vax/boot/head.S and add a HALT instruction somewhere near the beginning and recompile. (Replacing one of the initial 4 NOPs might be useful, since that won't change the layout of the linked image.) Insert a BPT instruction where you want a breakpoint 2. Boot with a boot parameter of 20 (hex). This tells VMB to load XDELTA and trigger a breakpoint. What this actually does is make the initial SCB vectors for machine check, reserved operand, access violation, page fault, trace and breakpoint point into code in XDELTA. (XDELTA is copied to RAM along with the rest of VMB when you enter the BOOT command.) 3. Before trying to locate a boot device and load an image, VMB will stop at a breakpoint: >>>e\e\b/20 (BOOT/R5:20 XQA0) 1 brk at 000004EB 4. Type '4000/'. This will 'open' the address 4000 (which is the base of VMB's SCB). Hit Ctrl-J repeatedly to examine up as far as address 402C: 1 brk at 000004EB 4000/00000D0D 00004004/0000313C 00004008/00000D0D 0000400C/00000D0D 00004010/00000D0D 00004014/00000D0D 00004018/0000313C 0000401C/00000D0D 00004020/0000313C 00004024/0000313C 00004028/00003251 0000402C/000031F1 5. Note the values at addresses 4004 (machine check), 4018 (res opr), 4020 (accvio), 4024 (page fault), 4028 (trace) and 402C (bpt). Unfortunately, VMB clobbers these before passing control to the loaded kernel image. 6. Type ';P' and hit RETURN to continue from the breakpoint. VMB will load the kernel as normal, transfer control to it and hit the HALT you inserted in step 1. 7. Now, use the console's DEPOSIT command to set the SCB vectors recorded above to point into XDELTA again and CONTINUE: >>> D/P 4004 313C >>> D 4018 313C >>> D 4020 313C >>> D 4024 313C >>> D 4028 3251 >>> D 402C 31F1 >>> C 8. When your BPT instruction is reached, XDELTA will gain control again. Some additional notes: o There seems to be a problem with the above method. The S command (single step) causes the machine to lock up when used after step 8. Front-panel halt switch, or a BREAK from the console is required to restore life. o You can find the manual for XDELTA at the Compaq OpenVMS web site: http://www.openvms.digital.com:8000/72final/4540/4540pro.html Warning! It's pretty primitive... o The version of XDELTA in VMB 5.3 doesn't include 'instruction' mode, so you can't disassemble instructions. Since there is an EXAMINE/INSTRUCTION console command, there is code somewhere in the ROM to decode instructions. It shouldn't be too difficult to hack XDELTA to use this code. The XDELTA code itself is very simple. o The ROM-based XDELTA won't work once VM has been enabled. This limits its usefulness at present. However, the XDELTA code looks to be 100% position-independent, so the kernel should be able to copy it (either from ROM or from RAM) at boot, and hook the relevant SCB vectors up to it. (The kernel could also patch XDELTA to add support for instruction mode at this point.) |
From: Kenn H. <ke...@us...> - 2001-01-18 00:09:31
|
Update of /cvsroot/linux-vax/kernel-2.4/Documentation/vax In directory usw-pr-cvs1:/tmp/cvs-serv32279/vax Log Message: Directory /cvsroot/linux-vax/kernel-2.4/Documentation/vax added to the repository |
From: Dave A. <ai...@us...> - 2000-12-11 22:23:15
|
Update of /cvsroot/linux-vax/kernel/drivers/net In directory slayer.i.sourceforge.net:/tmp/cvs-serv26679/drivers/net Modified Files: vaxlance.c Log Message: minor fixes |
From: Dave A. <ai...@us...> - 2000-12-11 00:24:03
|
Update of /cvsroot/linux-vax/kernel/include/asm-vax In directory slayer.i.sourceforge.net:/tmp/cvs-serv17857/include/asm-vax Added Files: vsa.h Log Message: woops .. forgot includes |
From: Dave A. <ai...@us...> - 2000-12-10 21:36:33
|
Update of /cvsroot/linux-vax/kernel/arch/vax/boot In directory slayer.i.sourceforge.net:/tmp/cvs-serv417/boot Modified Files: tmp_init.c Log Message: added net_dev_init + sock_init |
From: Dave A. <ai...@us...> - 2000-12-10 21:34:37
|
Update of /cvsroot/linux-vax/kernel In directory slayer.i.sourceforge.net:/tmp/cvs-serv32597 Modified Files: Makefile Log Message: added vsbus |
From: Dave A. <ai...@us...> - 2000-12-10 21:32:54
|
Update of /cvsroot/linux-vax/kernel/arch/vax In directory slayer.i.sourceforge.net:/tmp/cvs-serv32346/arch/vax Modified Files: config.in Log Message: added vsbus ... or vsabus or whatever we decide to call it |
From: Dave A. <ai...@us...> - 2000-12-10 21:30:30
|
Update of /cvsroot/linux-vax/kernel/drivers In directory slayer.i.sourceforge.net:/tmp/cvs-serv32164/drivers Modified Files: Makefile Log Message: added vsbus |
From: Dave A. <ai...@us...> - 2000-12-10 21:27:41
|
Update of /cvsroot/linux-vax/kernel/drivers/vsbus In directory slayer.i.sourceforge.net:/tmp/cvs-serv31843/drivers/vsbus Added Files: Makefile vsbus.c Log Message: initial import of a structure for a vsbus dir.. following on from tc dir |
From: Dave A. <ai...@us...> - 2000-12-10 21:18:25
|
Update of /cvsroot/linux-vax/kernel/drivers/vsbus In directory slayer.i.sourceforge.net:/tmp/cvs-serv30497/drivers/vsbus Log Message: Directory /cvsroot/linux-vax/kernel/drivers/vsbus added to the repository |
From: Dave A. <ai...@us...> - 2000-12-10 21:02:18
|
Update of /cvsroot/linux-vax/kernel/arch/vax/kernel In directory slayer.i.sourceforge.net:/tmp/cvs-serv28390/arch/vax/kernel Modified Files: cpu_ka42.c Log Message: removed vax_Lance_probe now done by net_dev |
From: Dave A. <ai...@us...> - 2000-12-04 21:09:37
|
Update of /cvsroot/linux-vax/kernel/drivers/net In directory slayer.i.sourceforge.net:/tmp/cvs-serv18577 Modified Files: vaxlance.c Log Message: fix a bug in set_multicast (fix taken from other drivers), no longer goes to crap after an bootp fails, still no rx interrupt |
From: Dave A. <ai...@us...> - 2000-12-03 18:43:17
|
Update of /cvsroot/linux-vax/kernel/arch/vax/lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv31598/arch/vax/lib Modified Files: checksum.c Log Message: moved ip_fast_csum to assembly checksum based on NetBSD.. ip_fast_csum works .. nothing else does.. all the C ones are crap :-) |
From: Dave A. <ai...@us...> - 2000-12-03 18:43:17
|
Update of /cvsroot/linux-vax/kernel/include/asm-vax In directory slayer.i.sourceforge.net:/tmp/cvs-serv31598/include/asm-vax Modified Files: checksum.h Log Message: moved ip_fast_csum to assembly checksum based on NetBSD.. ip_fast_csum works .. nothing else does.. all the C ones are crap :-) |
From: Dave A. <ai...@us...> - 2000-11-29 23:00:38
|
Update of /cvsroot/linux-vax/kernel/arch/vax/lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv8657 Added Files: checksum.c Log Message: first C style checksums.. really crappy... and I mean really crappy .. not even optimised in C ! |
From: Kenn H. <ke...@us...> - 2000-11-19 22:43:01
|
Update of /cvsroot/linux-vax/kernel/arch/vax/kernel In directory slayer.i.sourceforge.net:/tmp/cvs-serv4047/arch/vax/kernel Modified Files: interrupt.c Log Message: Allow for up to 384 vectors in the SCB (i.e. a 3-page SCB) |
From: Kenn H. <ke...@us...> - 2000-11-19 22:43:00
|
Update of /cvsroot/linux-vax/kernel/include/asm-vax In directory slayer.i.sourceforge.net:/tmp/cvs-serv4047/include/asm Modified Files: irq.h scb.h Log Message: Allow for up to 384 vectors in the SCB (i.e. a 3-page SCB) |
From: Dave A. <ai...@us...> - 2000-11-19 18:56:29
|
Update of /cvsroot/linux-vax/kernel/drivers/net In directory slayer.i.sourceforge.net:/tmp/cvs-serv1814 Modified Files: vaxlance.c Log Message: vax lance now transmits a packet .... problems with 16MB memory of course |
From: Kenn H. <ke...@us...> - 2000-10-31 00:45:48
|
Update of /cvsroot/linux-vax/kernel In directory slayer.i.sourceforge.net:/tmp/cvs-serv5178 Modified Files: Makefile Log Message: Upped EXTRAVERSION to -20001031 |
From: Kenn H. <ke...@us...> - 2000-10-31 00:43:29
|
Update of /cvsroot/linux-vax/kernel/arch/vax/mm In directory slayer.i.sourceforge.net:/tmp/cvs-serv4881/arch/vax/mm Modified Files: init.c ioremap.c pgtable.c Log Message: Substantial and wide-ranging changes to support creation of kernel threads and scheduling. Also has a first stab at a PGD implementation (page global directory). Hopefully Andy won't get too vengeful :-) |
From: Kenn H. <ke...@us...> - 2000-10-31 00:43:28
|
Update of /cvsroot/linux-vax/kernel/include/asm-vax In directory slayer.i.sourceforge.net:/tmp/cvs-serv4881/include/asm-vax Modified Files: irq.h pcb.h pgcompat.h pgtable.h processor.h psl.h system.h unistd.h Log Message: Substantial and wide-ranging changes to support creation of kernel threads and scheduling. Also has a first stab at a PGD implementation (page global directory). Hopefully Andy won't get too vengeful :-) |