Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax In directory usw-pr-cvs1:/tmp/cvs-serv28108/include/asm-vax Modified Files: fcntl.h namei.h processor.h siginfo.h smplock.h spinlock.h stat.h Added Files: div64.h msgbuf.h Log Message: updates to include/asm-vax and arch/vax for 2.4 compatibility. --- NEW FILE --- #ifndef __VAX_DIV64 #define __VAX_DIV64 /* atp jan 2001. Take from asm-s390. * FIXME: replace by quadword divide */ #define do_div(n,base) ({ \ int __res; \ __res = ((unsigned long) n) % (unsigned) base; \ n = ((unsigned long) n) / (unsigned) base; \ __res; }) #endif /* __ASM_VAX_DIV64_H */ --- NEW FILE --- #ifndef __VAX_MSGBUF_H #define __VAX_MSGBUF_H /* * The msqid64_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 msqid64_ds { struct ipc64_perm msg_perm; __kernel_time_t msg_stime; /* last msgsnd time */ unsigned long __unused1; __kernel_time_t msg_rtime; /* last msgrcv time */ unsigned long __unused2; __kernel_time_t msg_ctime; /* last change time */ unsigned long __unused3; unsigned long msg_cbytes; /* current number of bytes on queue */ unsigned long msg_qnum; /* number of messages in queue */ unsigned long msg_qbytes; /* max number of bytes on queue */ __kernel_pid_t msg_lspid; /* pid of last msgsnd */ __kernel_pid_t msg_lrpid; /* last receive pid */ unsigned long __unused4; unsigned long __unused5; }; #endif /* _VAX_MSGBUF_H */ Index: fcntl.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/fcntl.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** fcntl.h 2001/01/17 16:18:52 1.1 --- fcntl.h 2001/01/18 18:49:49 1.2 *************** *** 38,41 **** --- 38,45 ---- #define F_GETSIG 11 /* for sockets. */ + #define F_GETLK64 12 /* using 'struct flock64' */ + #define F_SETLK64 13 + #define F_SETLKW64 14 + /* for F_[GET|SET]FL */ #define FD_CLOEXEC 1 /* actually anything with low bit set goes */ *************** *** 50,53 **** --- 54,60 ---- #define F_SHLCK 8 /* or 4 */ + /* for leases */ + #define F_INPROGRESS 16 + /* operations for bsd flock(), also used by the kernel implementation */ #define LOCK_SH 1 /* shared lock */ *************** *** 56,59 **** --- 63,71 ---- blocking */ #define LOCK_UN 8 /* remove lock */ + + #define LOCK_MAND 32 /* This is a mandatory flock */ + #define LOCK_READ 64 /* ... Which allows concurrent read operations */ + #define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ + #define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ struct flock { Index: namei.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/namei.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** namei.h 2001/01/17 16:18:52 1.1 --- namei.h 2001/01/18 18:49:49 1.2 *************** *** 3,6 **** --- 3,8 ---- * * Included from linux/fs/namei.c + * atp jan 2000 - updated for 2.4 + * */ *************** *** 13,18 **** */ ! #define __prefix_lookup_dentry(name, lookup_flags) \ ! do {} while (0) #endif /* __VAX_NAMEI_H */ --- 15,19 ---- */ ! #define __emul_prefix() NULL #endif /* __VAX_NAMEI_H */ Index: processor.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/processor.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** processor.h 2001/01/18 15:52:28 1.2 --- processor.h 2001/01/18 18:49:49 1.3 *************** *** 144,147 **** --- 144,156 ---- unsigned long get_wchan(struct task_struct *p); + /* temporary - FIXME: */ + + extern inline unsigned long get_wchan(struct task_struct *p) + { + return 0xdeadbeef; /* XXX */ + } + + #define KSTK_EIP(tsk) (0xdeadbeef) + #define KSTK_ESP(tsk) (0xdeadbeef) Index: siginfo.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/siginfo.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** siginfo.h 2001/01/17 16:18:52 1.1 --- siginfo.h 2001/01/18 18:49:49 1.2 *************** *** 1,8 **** ! #ifndef _VAX_SIGINFO_H ! #define _VAX_SIGINFO_H #include <linux/types.h> ! /* This structure was copied from the Alpha. */ typedef union sigval { --- 1,10 ---- ! #ifndef __VAX_SIGINFO_H ! #define __VAX_SIGINFO_H + /* atp jan 2001 - taken from i386 from alpha */ + #include <linux/types.h> ! /* XXX: This structure was copied from the Alpha; is there an iBCS version? */ typedef union sigval { *************** *** 78,92 **** #define si_fd _sifields._sigpoll._fd /* * si_code values * Digital reserves positive values for kernel-generated signals. */ ! #define SI_USER 0 /* sent by kill, sigsend, raise */ ! #define SI_KERNEL 0x80 /* sent by the kernel from somewhere */ ! #define SI_QUEUE -1 /* sent by sigqueue */ ! #define SI_TIMER -2 /* sent by timer expiration */ ! #define SI_MESGQ -3 /* sent by real time mesq state change */ ! #define SI_ASYNCIO -4 /* sent by AIO completion */ ! #define SI_SIGIO -5 /* sent by queued SIGIO */ #define SI_FROMUSER(siptr) ((siptr)->si_code <= 0) --- 80,113 ---- #define si_fd _sifields._sigpoll._fd + #ifdef __KERNEL__ + #define __SI_MASK 0xffff0000 + #define __SI_KILL (0 << 16) + #define __SI_TIMER (1 << 16) + #define __SI_POLL (2 << 16) + #define __SI_FAULT (3 << 16) + #define __SI_CHLD (4 << 16) + #define __SI_RT (5 << 16) + #define __SI_CODE(T,N) ((T) << 16 | ((N) & 0xffff)) + #else + #define __SI_KILL 0 + #define __SI_TIMER 0 + #define __SI_POLL 0 + #define __SI_FAULT 0 + #define __SI_CHLD 0 + #define __SI_RT 0 + #define __SI_CODE(T,N) (N) + #endif + /* * si_code values * Digital reserves positive values for kernel-generated signals. */ ! #define SI_USER 0 /* sent by kill, sigsend, raise */ ! #define SI_KERNEL 0x80 /* sent by the kernel from somewhere */ ! #define SI_QUEUE -1 /* sent by sigqueue */ ! #define SI_TIMER __SI_CODE(__SI_TIMER,-2) /* sent by timer expiration */ ! #define SI_MESGQ -3 /* sent by real time mesq state change */ ! #define SI_ASYNCIO -4 /* sent by AIO completion */ ! #define SI_SIGIO -5 /* sent by queued SIGIO */ #define SI_FROMUSER(siptr) ((siptr)->si_code <= 0) *************** *** 96,107 **** * SIGILL si_codes */ ! #define ILL_ILLOPC 1 /* illegal opcode */ ! #define ILL_ILLOPN 2 /* illegal operand */ ! #define ILL_ILLADR 3 /* illegal addressing mode */ ! #define ILL_ILLTRP 4 /* illegal trap */ ! #define ILL_PRVOPC 5 /* privileged opcode */ ! #define ILL_PRVREG 6 /* privileged register */ ! #define ILL_COPROC 7 /* coprocessor error */ ! #define ILL_BADSTK 8 /* internal stack error */ #define NSIGILL 8 --- 117,128 ---- * SIGILL si_codes */ ! #define ILL_ILLOPC (__SI_FAULT|1) /* illegal opcode */ ! #define ILL_ILLOPN (__SI_FAULT|2) /* illegal operand */ ! #define ILL_ILLADR (__SI_FAULT|3) /* illegal addressing mode */ ! #define ILL_ILLTRP (__SI_FAULT|4) /* illegal trap */ ! #define ILL_PRVOPC (__SI_FAULT|5) /* privileged opcode */ ! #define ILL_PRVREG (__SI_FAULT|6) /* privileged register */ ! #define ILL_COPROC (__SI_FAULT|7) /* coprocessor error */ ! #define ILL_BADSTK (__SI_FAULT|8) /* internal stack error */ #define NSIGILL 8 *************** *** 109,120 **** * SIGFPE si_codes */ ! #define FPE_INTDIV 1 /* integer divide by zero */ ! #define FPE_INTOVF 2 /* integer overflow */ ! #define FPE_FLTDIV 3 /* floating point divide by zero */ ! #define FPE_FLTOVF 4 /* floating point overflow */ ! #define FPE_FLTUND 5 /* floating point underflow */ ! #define FPE_FLTRES 6 /* floating point inexact result */ ! #define FPE_FLTINV 7 /* floating point invalid operation */ ! #define FPE_FLTSUB 8 /* subscript out of range */ #define NSIGFPE 8 --- 130,141 ---- * SIGFPE si_codes */ ! #define FPE_INTDIV (__SI_FAULT|1) /* integer divide by zero */ ! #define FPE_INTOVF (__SI_FAULT|2) /* integer overflow */ ! #define FPE_FLTDIV (__SI_FAULT|3) /* floating point divide by zero */ ! #define FPE_FLTOVF (__SI_FAULT|4) /* floating point overflow */ ! #define FPE_FLTUND (__SI_FAULT|5) /* floating point underflow */ ! #define FPE_FLTRES (__SI_FAULT|6) /* floating point inexact result */ ! #define FPE_FLTINV (__SI_FAULT|7) /* floating point invalid operation */ ! #define FPE_FLTSUB (__SI_FAULT|8) /* subscript out of range */ #define NSIGFPE 8 *************** *** 122,127 **** * SIGSEGV si_codes */ ! #define SEGV_MAPERR 1 /* address not mapped to object */ ! #define SEGV_ACCERR 2 /* invalid permissions for mapped object */ #define NSIGSEGV 2 --- 143,148 ---- * SIGSEGV si_codes */ ! #define SEGV_MAPERR (__SI_FAULT|1) /* address not mapped to object */ ! #define SEGV_ACCERR (__SI_FAULT|2) /* invalid permissions for mapped object */ #define NSIGSEGV 2 *************** *** 129,135 **** * SIGBUS si_codes */ ! #define BUS_ADRALN 1 /* invalid address alignment */ ! #define BUS_ADRERR 2 /* non-existant physical address */ ! #define BUS_OBJERR 3 /* object specific hardware error */ #define NSIGBUS 3 --- 150,156 ---- * SIGBUS si_codes */ ! #define BUS_ADRALN (__SI_FAULT|1) /* invalid address alignment */ ! #define BUS_ADRERR (__SI_FAULT|2) /* non-existant physical address */ ! #define BUS_OBJERR (__SI_FAULT|3) /* object specific hardware error */ #define NSIGBUS 3 *************** *** 137,164 **** * SIGTRAP si_codes */ ! #define TRAP_BRKPT 1 /* process breakpoint */ ! #define TRAP_TRACE 2 /* process trace trap */ ! #define NSIGTRAP /* * SIGCHLD si_codes */ ! #define CLD_EXITED 1 /* child has exited */ ! #define CLD_KILLED 2 /* child was killed */ ! #define CLD_DUMPED 3 /* child terminated abnormally */ ! #define CLD_TRAPPED 4 /* traced child has trapped */ ! #define CLD_STOPPED 5 /* child has stopped */ ! #define CLD_CONTINUED 6 /* stopped child has continued */ ! #define NSIGCHLD /* * SIGPOLL si_codes */ ! #define POLL_IN 1 /* data input available */ ! #define POLL_OUT 2 /* output buffers available */ ! #define POLL_MSG 3 /* input message available */ ! #define POLL_ERR 4 /* i/o error */ ! #define POLL_PRI 5 /* high priority input available */ ! #define POLL_HUP 6 /* device disconnected */ #define NSIGPOLL 6 --- 158,185 ---- * SIGTRAP si_codes */ ! #define TRAP_BRKPT (__SI_FAULT|1) /* process breakpoint */ ! #define TRAP_TRACE (__SI_FAULT|2) /* process trace trap */ ! #define NSIGTRAP 2 /* * SIGCHLD si_codes */ ! #define CLD_EXITED (__SI_CHLD|1) /* child has exited */ ! #define CLD_KILLED (__SI_CHLD|2) /* child was killed */ ! #define CLD_DUMPED (__SI_CHLD|3) /* child terminated abnormally */ ! #define CLD_TRAPPED (__SI_CHLD|4) /* traced child has trapped */ ! #define CLD_STOPPED (__SI_CHLD|5) /* child has stopped */ ! #define CLD_CONTINUED (__SI_CHLD|6) /* stopped child has continued */ ! #define NSIGCHLD 6 /* * SIGPOLL si_codes */ ! #define POLL_IN (__SI_POLL|1) /* data input available */ ! #define POLL_OUT (__SI_POLL|2) /* output buffers available */ ! #define POLL_MSG (__SI_POLL|3) /* input message available */ ! #define POLL_ERR (__SI_POLL|4) /* i/o error */ ! #define POLL_PRI (__SI_POLL|5) /* high priority input available */ ! #define POLL_HUP (__SI_POLL|6) /* device disconnected */ #define NSIGPOLL 6 *************** *** 194,197 **** #define sigev_notify_function _sigev_un._sigev_thread._function #define sigev_notify_attributes _sigev_un._sigev_thread._attribute - #endif /* _VAX_SIGINFO_H */ --- 215,235 ---- #define sigev_notify_function _sigev_un._sigev_thread._function #define sigev_notify_attributes _sigev_un._sigev_thread._attribute + + #ifdef __KERNEL__ + #include <linux/string.h> + + extern inline void copy_siginfo(siginfo_t *to, siginfo_t *from) + { + if (from->si_code < 0) + memcpy(to, from, sizeof(siginfo_t)); + else + /* _sigchld is currently the largest know union member */ + memcpy(to, from, 3*sizeof(int) + sizeof(from->_sifields._sigchld)); + } + + extern int copy_siginfo_to_user(siginfo_t *to, siginfo_t *from); + + #endif /* __KERNEL__ */ + + #endif /* __ASM_VAX_SIGINFO_H */ Index: smplock.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/smplock.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** smplock.h 2001/01/17 16:18:52 1.1 --- smplock.h 2001/01/18 18:49:49 1.2 *************** *** 5,11 **** */ #include <linux/interrupt.h> ! #include <asm/spinlock.h> extern spinlock_t kernel_flag; /* --- 5,13 ---- */ #include <linux/interrupt.h> ! #include <linux/spinlock.h> extern spinlock_t kernel_flag; + + #define kernel_locked() spin_is_locked(&kernel_flag) /* Index: spinlock.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/spinlock.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** spinlock.h 2001/01/17 16:18:52 1.1 --- spinlock.h 2001/01/18 18:49:49 1.2 *************** *** 1,55 **** ! #ifndef _ASM_VAX_SPINLOCK_H ! #define _ASM_VAX_SPINLOCK_H ! /* from the mips port. Deal with SMP later. much later.. */ ! #ifndef __SMP__ ! /* gcc 2.7.2 can crash initializing an empty structure. For now we ! try to do though ... */ ! typedef struct { } spinlock_t; ! #define SPIN_LOCK_UNLOCKED { } ! ! #define spin_lock_init(lock) do { } while(0) ! #define spin_lock(lock) do { } while(0) ! #define spin_trylock(lock) do { } while(0) ! #define spin_unlock_wait(lock) do { } while(0) ! #define spin_unlock(lock) do { } while(0) ! #define spin_lock_irq(lock) cli() ! #define spin_unlock_irq(lock) sti() ! ! #define spin_lock_irqsave(lock, flags) save_and_cli(flags) ! #define spin_unlock_irqrestore(lock, flags) restore_flags(flags) ! ! /* ! * Read-write spinlocks, allowing multiple readers ! * but only one writer. ! * ! * NOTE! it is quite common to have readers in interrupts ! * but no interrupt writers. For those circumstances we ! * can "mix" irq-safe locks - any writer needs to get a ! * irq-safe write-lock, but readers can get non-irqsafe ! * read-locks. ! */ ! typedef struct { } rwlock_t; ! #define RW_LOCK_UNLOCKED { } ! ! #define read_lock(lock) do { } while(0) ! #define read_unlock(lock) do { } while(0) ! #define write_lock(lock) do { } while(0) ! #define write_unlock(lock) do { } while(0) ! #define read_lock_irq(lock) cli() ! #define read_unlock_irq(lock) sti() ! #define write_lock_irq(lock) cli() ! #define write_unlock_irq(lock) sti() ! ! #define read_lock_irqsave(lock, flags) save_and_cli(flags) ! #define read_unlock_irqrestore(lock, flags) restore_flags(flags) ! #define write_lock_irqsave(lock, flags) save_and_cli(flags) ! #define write_unlock_irqrestore(lock, flags) restore_flags(flags) ! ! #else ! ! #error "Dont set SMP .eq. 1 for the VAX architecture yet" ! ! #endif /* SMP */ ! #endif /* _ASM_VAX_SPINLOCK_H */ --- 1,6 ---- ! #ifndef __ASM_VAX_SPINLOCK_H ! #define __ASM_VAX_SPINLOCK_H ! #error "No SMP on VAX yet, please set CONFIG_SMP to n" ! #endif /* __ASM_VAX_SPINLOCK_H */ Index: stat.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/stat.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** stat.h 2001/01/17 16:18:52 1.1 --- stat.h 2001/01/18 18:49:49 1.2 *************** *** 41,43 **** --- 41,79 ---- }; + /* This matches struct stat64 in glibc2.1, hence the absolutely + * insane amounts of padding around dev_t's. + */ + struct stat64 { + unsigned short st_dev; + unsigned char __pad0[6]; + + unsigned long long st_ino; + unsigned int st_mode; + unsigned int st_nlink; + + unsigned long st_uid; + unsigned long st_gid; + + unsigned short st_rdev; + unsigned char __pad3[10]; + + long long st_size; + unsigned long st_blksize; + + unsigned long st_blocks; /* Number 512-byte blocks allocated. */ + unsigned long __pad4; /* future possible st_blocks high bits */ + + unsigned long st_atime; + unsigned long __pad5; + + unsigned long st_mtime; + unsigned long __pad6; + + unsigned long st_ctime; + unsigned long __pad7; /* will be high 32 bits of ctime someday */ + + unsigned long __unused1; + unsigned long __unused2; + }; + #endif /* _VAX_STAT_H */ |