diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1994-12-01 08:00:00 +0000 |
---|---|---|
committer | <ralf@linux-mips.org> | 1994-12-01 08:00:00 +0000 |
commit | 90ecc248e200fee448001248dde0ca540dd3ef64 (patch) | |
tree | a3fe89494ce63b4835f0f9cf5c45e74cde88252b /include/linux | |
parent | 1513ff9b7899ab588401c89db0e99903dbf5f886 (diff) |
Import of Linux/MIPS 1.1.68
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/head.h | 19 | ||||
-rw-r--r-- | include/linux/in.h | 63 | ||||
-rw-r--r-- | include/linux/inet.h | 6 | ||||
-rw-r--r-- | include/linux/interrupt.h | 18 | ||||
-rw-r--r-- | include/linux/ip.h | 22 | ||||
-rw-r--r-- | include/linux/mm.h | 68 | ||||
-rw-r--r-- | include/linux/ncp.h | 106 | ||||
-rw-r--r-- | include/linux/ptrace.h | 56 | ||||
-rw-r--r-- | include/linux/sched.h | 417 | ||||
-rw-r--r-- | include/linux/signal.h | 32 | ||||
-rw-r--r-- | include/linux/tcp.h | 5 | ||||
-rw-r--r-- | include/linux/tqueue.h | 3 | ||||
-rw-r--r-- | include/linux/types.h | 28 |
13 files changed, 226 insertions, 617 deletions
diff --git a/include/linux/head.h b/include/linux/head.h index 8911a6819..ea79de8e9 100644 --- a/include/linux/head.h +++ b/include/linux/head.h @@ -1,20 +1,9 @@ #ifndef _LINUX_HEAD_H #define _LINUX_HEAD_H -typedef struct desc_struct { - unsigned long a,b; -} desc_table[256]; - -extern unsigned long swapper_pg_dir[1024]; -extern desc_table idt,gdt; - -#define GDT_NUL 0 -#define GDT_CODE 1 -#define GDT_DATA 2 -#define GDT_TMP 3 - -#define LDT_NUL 0 -#define LDT_CODE 1 -#define LDT_DATA 2 +/* + * Include machine dependend stuff + */ +#include <asm/head.h> #endif diff --git a/include/linux/in.h b/include/linux/in.h index 1c268f216..bb26749a9 100644 --- a/include/linux/in.h +++ b/include/linux/in.h @@ -121,64 +121,9 @@ extern unsigned short int ntohs(unsigned short int); extern unsigned long int htonl(unsigned long int); extern unsigned short int htons(unsigned short int); -static __inline__ unsigned long int -__ntohl(unsigned long int x) -{ - __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */ - "rorl $16,%0\n\t" /* swap words */ - "xchgb %b0,%h0" /* swap higher bytes */ - :"=q" (x) - : "0" (x)); - return x; -} - -static __inline__ unsigned long int -__constant_ntohl(unsigned long int x) -{ - return (((x & 0x000000ffU) << 24) | - ((x & 0x0000ff00U) << 8) | - ((x & 0x00ff0000U) >> 8) | - ((x & 0xff000000U) >> 24)); -} - -static __inline__ unsigned short int -__ntohs(unsigned short int x) -{ - __asm__("xchgb %b0,%h0" /* swap bytes */ - : "=q" (x) - : "0" (x)); - return x; -} - -static __inline__ unsigned short int -__constant_ntohs(unsigned short int x) -{ - return (((x & 0x00ff) << 8) | - ((x & 0xff00) >> 8)); -} - -#define __htonl(x) __ntohl(x) -#define __htons(x) __ntohs(x) -#define __constant_htonl(x) __constant_ntohl(x) -#define __constant_htons(x) __constant_ntohs(x) - -#ifdef __OPTIMIZE__ -# define ntohl(x) \ -(__builtin_constant_p((long)(x)) ? \ - __constant_ntohl((x)) : \ - __ntohl((x))) -# define ntohs(x) \ -(__builtin_constant_p((short)(x)) ? \ - __constant_ntohs((x)) : \ - __ntohs((x))) -# define htonl(x) \ -(__builtin_constant_p((long)(x)) ? \ - __constant_htonl((x)) : \ - __htonl((x))) -# define htons(x) \ -(__builtin_constant_p((short)(x)) ? \ - __constant_htons((x)) : \ - __htons((x))) -#endif +/* + * include machine dependencies + */ +#include <asm/in.h> #endif /* _LINUX_IN_H */ diff --git a/include/linux/inet.h b/include/linux/inet.h index d8511a7ce..fbddc4e1f 100644 --- a/include/linux/inet.h +++ b/include/linux/inet.h @@ -42,11 +42,11 @@ #ifndef _LINUX_INET_H #define _LINUX_INET_H -#if defined(__i386__) +#if defined (__i386__) || defined (__MIPSEL__) #define NET16(x) ((((x) >> 8) & 0x00FF) | (((x) << 8) & 0xFF00)) -#elif defined(__mc68000__) +#elif #if defined (__mc680x0__) || defined (__MIPSEB__) #define NET16(x) (x) -#elif defined(__alpha__) +#elif defined (__alpha__) #define NET16(x) ((((x) >> 8) & 0x00FF) | (((x) << 8) & 0xFF00)) #else #error change this to match your machine diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 2ccaec523..6ef2710e8 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -24,19 +24,9 @@ enum { KEYBOARD_BH }; -extern inline void mark_bh(int nr) -{ - __asm__ __volatile__("orl %1,%0":"=m" (bh_active):"ir" (1<<nr)); -} - -extern inline void disable_bh(int nr) -{ - __asm__ __volatile__("andl %1,%0":"=m" (bh_mask):"ir" (~(1<<nr))); -} - -extern inline void enable_bh(int nr) -{ - __asm__ __volatile__("orl %1,%0":"=m" (bh_mask):"ir" (1<<nr)); -} +/* + * Include machine depended stuff + */ +#include <asm/interrupt.h> #endif diff --git a/include/linux/ip.h b/include/linux/ip.h index 1d3789638..75a40a2c9 100644 --- a/include/linux/ip.h +++ b/include/linux/ip.h @@ -32,19 +32,19 @@ struct timestamp { u8 len; u8 ptr; union { -#if defined(__i386__) - u8 flags:4, - overflow:4; -#elif defined(__mc68000__) - u8 overflow:4, +#if defined(__i386__) || defined(__MIPSEL__) + u8 flags:4, + overflow:4; +#elif defined(__mc68000__) || defined(__MIPSEB__) + unsigned char overflow:4, flags:4; #elif defined(__alpha__) - u8 flags:4, - overflow:4; + u8 flags:4, + overflow:4; #else #error "Adjust this structure to match your CPU" #endif - u8 full_char; + u8 full_char; } x; u32 data[9]; }; @@ -73,13 +73,13 @@ struct options { struct iphdr { -#if defined(__i386__) +#if defined(__i386__) || defined(__MIPSEL__) u8 ihl:4, version:4; -#elif defined (__mc68000__) +#elif defined (__mc68000__) || defined(__MIPSEB__) u8 version:4, ihl:4; -#elif defined (__alpha__) +#elif defined(__alpha__) u8 ihl:4, version:4; #else diff --git a/include/linux/mm.h b/include/linux/mm.h index e2128f033..d1f1b3a98 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -6,6 +6,7 @@ #include <linux/sched.h> #include <linux/errno.h> #include <linux/kernel.h> +#include <linux/string.h> #define VERIFY_READ 0 #define VERIFY_WRITE 1 @@ -142,10 +143,8 @@ extern inline unsigned long get_free_page(int priority) page = __get_free_page(priority); if (page) - __asm__ __volatile__("rep ; stosl" - : /* no outputs */ \ - :"a" (0),"c" (1024),"D" (page) - :"di","cx"); + memset((void *)page, 0, 4096); + return page; } @@ -172,8 +171,6 @@ extern void do_no_page(struct vm_area_struct * vma, unsigned long address, unsigned long error_code); extern unsigned long paging_init(unsigned long start_mem, unsigned long end_mem); -extern void mem_init(unsigned long low_start_mem, - unsigned long start_mem, unsigned long end_mem); extern void show_mem(void); extern void oom(struct task_struct * task); extern void si_meminfo(struct sysinfo * val); @@ -212,21 +209,6 @@ extern unsigned long high_memory; extern unsigned short * mem_map; -#define PAGE_PRESENT 0x001 -#define PAGE_RW 0x002 -#define PAGE_USER 0x004 -#define PAGE_PWT 0x008 /* 486 only - not used currently */ -#define PAGE_PCD 0x010 /* 486 only - not used currently */ -#define PAGE_ACCESSED 0x020 -#define PAGE_DIRTY 0x040 -#define PAGE_COW 0x200 /* implemented in software (one of the AVL bits) */ - -#define PAGE_PRIVATE (PAGE_PRESENT | PAGE_RW | PAGE_USER | PAGE_ACCESSED | PAGE_COW) -#define PAGE_SHARED (PAGE_PRESENT | PAGE_RW | PAGE_USER | PAGE_ACCESSED) -#define PAGE_COPY (PAGE_PRESENT | PAGE_USER | PAGE_ACCESSED | PAGE_COW) -#define PAGE_READONLY (PAGE_PRESENT | PAGE_USER | PAGE_ACCESSED) -#define PAGE_TABLE (PAGE_PRESENT | PAGE_RW | PAGE_USER | PAGE_ACCESSED) - #define GFP_BUFFER 0x00 #define GFP_ATOMIC 0x01 #define GFP_USER 0x02 @@ -268,46 +250,10 @@ extern inline unsigned long in_swap_cache(unsigned long addr) return swap_cache[addr >> PAGE_SHIFT]; } -extern inline long find_in_swap_cache (unsigned long addr) -{ - unsigned long entry; - -#ifdef SWAP_CACHE_INFO - swap_cache_find_total++; -#endif - __asm__ __volatile__("xchgl %0,%1" - :"=m" (swap_cache[addr >> PAGE_SHIFT]), - "=r" (entry) - :"0" (swap_cache[addr >> PAGE_SHIFT]), - "1" (0)); -#ifdef SWAP_CACHE_INFO - if (entry) - swap_cache_find_success++; -#endif - return entry; -} - -extern inline int delete_from_swap_cache(unsigned long addr) -{ - unsigned long entry; - -#ifdef SWAP_CACHE_INFO - swap_cache_del_total++; -#endif - __asm__ __volatile__("xchgl %0,%1" - :"=m" (swap_cache[addr >> PAGE_SHIFT]), - "=r" (entry) - :"0" (swap_cache[addr >> PAGE_SHIFT]), - "1" (0)); - if (entry) { -#ifdef SWAP_CACHE_INFO - swap_cache_del_success++; -#endif - swap_free(entry); - return 1; - } - return 0; -} +/* + * Include machine dependend stuff + */ +#include <asm/mm.h> #endif /* __KERNEL__ */ diff --git a/include/linux/ncp.h b/include/linux/ncp.h new file mode 100644 index 000000000..bd6daf29d --- /dev/null +++ b/include/linux/ncp.h @@ -0,0 +1,106 @@ +#ifndef _LINUX_NCP_H_ +#define _LINUX_NCP_H_ + +#define NCP_OPEN 0x1111 +#define NCP_CLOSE 0x5555 +#define NCP_REQUEST 0x2222 +#define NCP_REPLY 0x3333 + +struct ncp_request +{ + unsigned short p_type __attribute__ ((packed)); + unsigned char seq __attribute__ ((packed)); + unsigned char c_low __attribute__ ((packed)); + unsigned char task __attribute__ ((packed)); + unsigned char c_high __attribute__ ((packed)); + unsigned char func __attribute__ ((packed)); +}; + +struct ncp_request_sf +{ + unsigned short p_type __attribute__ ((packed)); + unsigned char seq __attribute__ ((packed)); + unsigned char c_low __attribute__ ((packed)); + unsigned char task __attribute__ ((packed)); + unsigned char c_high __attribute__ ((packed)); + unsigned char func __attribute__ ((packed)); + unsigned short s_len __attribute__ ((packed)); + unsigned char s_func __attribute__ ((packed)); +}; + +struct ncp_reply +{ + unsigned short p_type __attribute__ ((packed)); + unsigned char seq __attribute__ ((packed)); + unsigned char c_low __attribute__ ((packed)); + unsigned char task __attribute__ ((packed)); + unsigned char c_high __attribute__ ((packed)); + unsigned char f_stat __attribute__ ((packed)); + unsigned char c_stat __attribute__ ((packed)); +}; + +#define OTYPE_USER 0x0001 +#define OTYPE_GROUP 0x0002 +#define OTYPE_PQUEUE 0x0003 +#define OTYPE_FSERVER 0x0004 +#define OTYPE_JSERVER 0x0005 +#define OTYPE_PSERVER 0x0007 +#define OTYPE_UNKNOWN_1 0x002E +#define OTYPE_ADV_PSERVER 0x0047 +#define OTYPE_AFSERVER 0x0107 +#define OTYPE_UNKNOWN_2 0x0143 +#define OTYPE_UNKNOWN_3 0x01F5 +#define OTYPE_UNKNOWN_4 0x023F + +#define LIMIT_OBJNAME 47 + +struct bind_obj +{ + unsigned long id __attribute__ ((packed)); + unsigned short type __attribute__ ((packed)); + char name[LIMIT_OBJNAME+1] __attribute__ ((packed)); +}; + +struct get_bind_obj +{ + unsigned short type __attribute__ ((packed)); + unsigned char n_len __attribute__ ((packed)); + char name[0] __attribute__ ((packed)); +}; + +struct scan_bind_obj +{ + unsigned long id __attribute__ ((packed)); + unsigned short type __attribute__ ((packed)); + unsigned char n_len __attribute__ ((packed)); + char name[0] __attribute__ ((packed)); +}; + +struct login_req +{ + unsigned char password[8] __attribute__ ((packed)); + unsigned short type __attribute__ ((packed)); + unsigned char n_len __attribute__ ((packed)); + char name[0] __attribute__ ((packed)); +}; + +struct ncp_time +{ + unsigned char year __attribute__ ((packed)); + unsigned char month __attribute__ ((packed)); + unsigned char day __attribute__ ((packed)); + unsigned char hours __attribute__ ((packed)); + unsigned char mins __attribute__ ((packed)); + unsigned char secs __attribute__ ((packed)); + unsigned char c_secs __attribute__ ((packed)); +}; + +struct login_info +{ + unsigned long id __attribute__ ((packed)); + unsigned short un1 __attribute__ ((packed)); + char name[LIMIT_OBJNAME+1] __attribute__ ((packed)); + struct ncp_time time __attribute__ ((packed)); +}; +#endif + diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 6718860e0..c98e66a68 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h @@ -1,9 +1,11 @@ #ifndef _LINUX_PTRACE_H #define _LINUX_PTRACE_H -/* ptrace.h */ -/* structs and defines to help the user use the ptrace system call. */ -/* has the defines to get at the registers. */ +/* + * linux/include/linux/ptrace.h + * + * structs and defines to help the user use the ptrace system call. + */ #define PTRACE_TRACEME 0 #define PTRACE_PEEKTEXT 1 @@ -21,49 +23,9 @@ #define PTRACE_SYSCALL 24 -/* use ptrace (3 or 6, pid, PT_EXCL, data); to read or write - the processes registers. */ - -#define EBX 0 -#define ECX 1 -#define EDX 2 -#define ESI 3 -#define EDI 4 -#define EBP 5 -#define EAX 6 -#define DS 7 -#define ES 8 -#define FS 9 -#define GS 10 -#define ORIG_EAX 11 -#define EIP 12 -#define CS 13 -#define EFL 14 -#define UESP 15 -#define SS 16 - - -/* this struct defines the way the registers are stored on the - stack during a system call. */ - -struct pt_regs { - long ebx; - long ecx; - long edx; - long esi; - long edi; - long ebp; - long eax; - unsigned short ds, __dsu; - unsigned short es, __esu; - unsigned short fs, __fsu; - unsigned short gs, __gsu; - long orig_eax; - long eip; - unsigned short cs, __csu; - long eflags; - long esp; - unsigned short ss, __ssu; -}; +/* + * include machine dependend stuff + */ +#include <asm/ptrace.h> #endif diff --git a/include/linux/sched.h b/include/linux/sched.h index 3a38d57eb..76519a8b9 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -15,26 +15,6 @@ * System setup and hardware bug flags.. */ extern int hard_math; -extern int x86; -extern int ignore_irq13; -extern int wp_works_ok; /* doesn't work on a 386 */ -extern int hlt_works_ok; /* problems on some 486Dx4's and old 386's */ - -extern unsigned long intr_count; -extern unsigned long event; - -#define start_bh_atomic() \ -__asm__ __volatile__("incl _intr_count") - -#define end_bh_atomic() \ -__asm__ __volatile__("decl _intr_count") - -/* - * Bus types (default is ISA, but people can check others with these..) - * MCA_bus hardcoded to 0 for now. - */ -extern int EISA_bus; -#define MCA_bus 0 #include <linux/binfmts.h> #include <linux/personality.h> @@ -42,17 +22,6 @@ extern int EISA_bus; #include <asm/system.h> /* - * User space process size: 3GB. This is hardcoded into a few places, - * so don't change it unless you know what you are doing. - */ -#define TASK_SIZE 0xc0000000 - -/* - * Size of io_bitmap in longwords: 32 is ports 0-0x3ff. - */ -#define IO_BITMAP_SIZE 32 - -/* * These are the constant used to fake the fixed-point load-average * counting. Some notes: * - 11 bit fractions expand to 22 bits by the multiplies: this gives @@ -62,22 +31,22 @@ extern int EISA_bus; * the EXP_n values would be 1981, 2034 and 2043 if still using only * 11 bit fractions. */ -extern unsigned long avenrun[]; /* Load averages */ +extern unsigned long avenrun[]; /* Load averages */ -#define FSHIFT 11 /* nr of bits of precision */ -#define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */ -#define LOAD_FREQ (5*HZ) /* 5 sec intervals */ -#define EXP_1 1884 /* 1/exp(5sec/1min) as fixed-point */ -#define EXP_5 2014 /* 1/exp(5sec/5min) */ -#define EXP_15 2037 /* 1/exp(5sec/15min) */ +#define FSHIFT 11 /* nr of bits of precision */ +#define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */ +#define LOAD_FREQ (5*HZ) /* 5 sec intervals */ +#define EXP_1 1884 /* 1/exp(5sec/1min) as fixed-point */ +#define EXP_5 2014 /* 1/exp(5sec/5min) */ +#define EXP_15 2037 /* 1/exp(5sec/15min) */ #define CALC_LOAD(load,exp,n) \ load *= exp; \ load += n*(FIXED_1-exp); \ load >>= FSHIFT; -#define CT_TO_SECS(x) ((x) / HZ) -#define CT_TO_USECS(x) (((x) % HZ) * 1000000/HZ) +#define CT_TO_SECS(x) ((x) / HZ) +#define CT_TO_USECS(x) (((x) % HZ) * 1000000/HZ) #define FIRST_TASK task[0] #define LAST_TASK task[NR_TASKS-1] @@ -89,16 +58,16 @@ extern unsigned long avenrun[]; /* Load averages */ #include <linux/time.h> #include <linux/param.h> #include <linux/resource.h> -#include <linux/vm86.h> +/* #include <linux/vm86.h> */ #include <linux/math_emu.h> #include <linux/ptrace.h> -#define TASK_RUNNING 0 -#define TASK_INTERRUPTIBLE 1 -#define TASK_UNINTERRUPTIBLE 2 -#define TASK_ZOMBIE 3 -#define TASK_STOPPED 4 -#define TASK_SWAPPING 5 +#define TASK_RUNNING 0 +#define TASK_INTERRUPTIBLE 1 +#define TASK_UNINTERRUPTIBLE 2 +#define TASK_ZOMBIE 3 +#define TASK_STOPPED 4 +#define TASK_SWAPPING 5 #ifndef NULL #define NULL ((void *) 0) @@ -114,82 +83,6 @@ asmlinkage void schedule(void); #endif /* __KERNEL__ */ -struct i387_hard_struct { - long cwd; - long swd; - long twd; - long fip; - long fcs; - long foo; - long fos; - long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */ -}; - -struct i387_soft_struct { - long cwd; - long swd; - long twd; - long fip; - long fcs; - long foo; - long fos; - long top; - struct fpu_reg regs[8]; /* 8*16 bytes for each FP-reg = 128 bytes */ - unsigned char lookahead; - struct info *info; - unsigned long entry_eip; -}; - -union i387_union { - struct i387_hard_struct hard; - struct i387_soft_struct soft; -}; - -struct tss_struct { - unsigned short back_link,__blh; - unsigned long esp0; - unsigned short ss0,__ss0h; - unsigned long esp1; - unsigned short ss1,__ss1h; - unsigned long esp2; - unsigned short ss2,__ss2h; - unsigned long cr3; - unsigned long eip; - unsigned long eflags; - unsigned long eax,ecx,edx,ebx; - unsigned long esp; - unsigned long ebp; - unsigned long esi; - unsigned long edi; - unsigned short es, __esh; - unsigned short cs, __csh; - unsigned short ss, __ssh; - unsigned short ds, __dsh; - unsigned short fs, __fsh; - unsigned short gs, __gsh; - unsigned short ldt, __ldth; - unsigned short trace, bitmap; - unsigned long io_bitmap[IO_BITMAP_SIZE+1]; - unsigned long tr; - unsigned long cr2, trap_no, error_code; - union i387_union i387; -}; - -#define INIT_TSS { \ - 0,0, \ - sizeof(init_kernel_stack) + (long) &init_kernel_stack, \ - KERNEL_DS, 0, \ - 0,0,0,0,0,0, \ - (long) &swapper_pg_dir, \ - 0,0,0,0,0,0,0,0,0,0, \ - USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0,USER_DS,0, \ - _LDT(0),0, \ - 0, 0x8000, \ - {~0, }, /* ioperm */ \ - _TSS(0), 0, 0,0, \ - { { 0, }, } /* 387 state */ \ -} - struct files_struct { int count; fd_set close_on_exec; @@ -223,9 +116,10 @@ struct mm_struct { unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; int swappable:1; unsigned long swap_address; - unsigned long old_maj_flt; /* old value of maj_flt */ - unsigned long dec_flt; /* page fault count of the last time */ - unsigned long swap_cnt; /* number of pages to swap on next pass */ + unsigned long old_maj_flt; /* old value of maj_flt */ + unsigned long dec_flt; /* page fault count of the last time */ + unsigned long swap_cnt; /* number of pages to swap on next pass +*/ struct vm_area_struct * mmap; }; @@ -242,113 +136,22 @@ struct mm_struct { /* swap */ 0, 0, 0, 0, \ &init_mmap } -struct task_struct { -/* these are hardcoded - don't touch */ - volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ - long counter; - long priority; - unsigned long signal; - unsigned long blocked; /* bitmap of masked signals */ - unsigned long flags; /* per process flags, defined below */ - int errno; - int debugreg[8]; /* Hardware debugging registers */ - struct exec_domain *exec_domain; -/* various fields */ - struct linux_binfmt *binfmt; - struct task_struct *next_task, *prev_task; - struct sigaction sigaction[32]; - unsigned long saved_kernel_stack; - unsigned long kernel_stack_page; - int exit_code, exit_signal; - unsigned long personality; - int dumpable:1; - int did_exec:1; - int pid,pgrp,session,leader; - int groups[NGROUPS]; - /* - * pointers to (original) parent process, youngest child, younger sibling, - * older sibling, respectively. (p->father can be replaced with - * p->p_pptr->pid) - */ - struct task_struct *p_opptr, *p_pptr, *p_cptr, *p_ysptr, *p_osptr; - struct wait_queue *wait_chldexit; /* for wait4() */ - unsigned short uid,euid,suid,fsuid; - unsigned short gid,egid,sgid,fsgid; - unsigned long timeout; - unsigned long it_real_value, it_prof_value, it_virt_value; - unsigned long it_real_incr, it_prof_incr, it_virt_incr; - long utime, stime, cutime, cstime, start_time; - struct rlimit rlim[RLIM_NLIMITS]; - unsigned short used_math; - char comm[16]; -/* virtual 86 mode stuff */ - struct vm86_struct * vm86_info; - unsigned long screen_bitmap; - unsigned long v86flags, v86mask, v86mode; -/* file system info */ - int link_count; - struct tty_struct *tty; /* NULL if no tty */ -/* ipc stuff */ - struct sem_undo *semundo; -/* ldt for this task - used by Wine. If NULL, default_ldt is used */ - struct desc_struct *ldt; -/* tss for this task */ - struct tss_struct tss; -/* filesystem information */ - struct fs_struct fs[1]; -/* open file information */ - struct files_struct files[1]; -/* memory management info */ - struct mm_struct mm[1]; -}; - /* * Per process flags */ -#define PF_ALIGNWARN 0x00000001 /* Print alignment warning msgs */ +#define PF_ALIGNWARN 0x00000001 /* Print alignment warning msgs */ /* Not implemented yet, only for 486*/ -#define PF_PTRACED 0x00000010 /* set if ptrace (0) has been called. */ -#define PF_TRACESYS 0x00000020 /* tracing system calls */ +#define PF_PTRACED 0x00000010 /* set if ptrace (0) has been called. */ +#define PF_TRACESYS 0x00000020 /* tracing system calls */ /* * cloning flags: */ #define CSIGNAL 0x000000ff /* signal mask to be sent at exit */ -#define COPYVM 0x00000100 /* set if VM copy desired (like normal fork()) */ -#define COPYFD 0x00000200 /* set if fd's should be copied, not shared (NI) */ - -/* - * INIT_TASK is used to set up the first task table, touch at - * your own risk!. Base=0, limit=0x1fffff (=2MB) - */ -#define INIT_TASK \ -/* state etc */ { 0,15,15,0,0,0,0, \ -/* debugregs */ { 0, }, \ -/* exec domain */&default_exec_domain, \ -/* binfmt */ NULL, \ -/* schedlink */ &init_task,&init_task, \ -/* signals */ {{ 0, },}, \ -/* stack */ 0,(unsigned long) &init_kernel_stack, \ -/* ec,brk... */ 0,0,0,0,0, \ -/* pid etc.. */ 0,0,0,0, \ -/* suppl grps*/ {NOGROUP,}, \ -/* proc links*/ &init_task,&init_task,NULL,NULL,NULL,NULL, \ -/* uid etc */ 0,0,0,0,0,0,0,0, \ -/* timeout */ 0,0,0,0,0,0,0,0,0,0,0,0, \ -/* rlimits */ { {LONG_MAX, LONG_MAX}, {LONG_MAX, LONG_MAX}, \ - {LONG_MAX, LONG_MAX}, {LONG_MAX, LONG_MAX}, \ - { 0, LONG_MAX}, {LONG_MAX, LONG_MAX}}, \ -/* math */ 0, \ -/* comm */ "swapper", \ -/* vm86_info */ NULL, 0, 0, 0, 0, \ -/* fs info */ 0,NULL, \ -/* ipc */ NULL, \ -/* ldt */ NULL, \ -/* tss */ INIT_TSS, \ -/* fs */ { INIT_FS }, \ -/* files */ { INIT_FILES }, \ -/* mm */ { INIT_MM } \ -} +#define COPYVM 0x00000100 /* set if VM copy desired (like normal f +ork()) */ +#define COPYFD 0x00000200 /* set if fd's should be copied, not sha +red (NI) */ #ifdef __KERNEL__ @@ -373,98 +176,31 @@ extern void notify_parent(struct task_struct * tsk); extern int send_sig(unsigned long sig,struct task_struct * p,int priv); extern int in_group_p(gid_t grp); -extern int request_irq(unsigned int irq,void (*handler)(int), unsigned long flags, const char *device); +extern int request_irq(unsigned int irq,void (*handler)(int), + unsigned long flags, const char *device); extern void free_irq(unsigned int irq); /* - * Entry into gdt where to find first TSS. GDT layout: - * 0 - nul - * 1 - kernel code segment - * 2 - kernel data segment - * 3 - user code segment - * 4 - user data segment - * ... - * 8 - TSS #0 - * 9 - LDT #0 - * 10 - TSS #1 - * 11 - LDT #1 - */ -#define FIRST_TSS_ENTRY 8 -#define FIRST_LDT_ENTRY (FIRST_TSS_ENTRY+1) -#define _TSS(n) ((((unsigned long) n)<<4)+(FIRST_TSS_ENTRY<<3)) -#define _LDT(n) ((((unsigned long) n)<<4)+(FIRST_LDT_ENTRY<<3)) -#define load_TR(n) __asm__("ltr %%ax": /* no output */ :"a" (_TSS(n))) -#define load_ldt(n) __asm__("lldt %%ax": /* no output */ :"a" (_LDT(n))) -#define store_TR(n) \ -__asm__("str %%ax\n\t" \ - "subl %2,%%eax\n\t" \ - "shrl $4,%%eax" \ - :"=a" (n) \ - :"0" (0),"i" (FIRST_TSS_ENTRY<<3)) -/* - * switch_to(n) should switch tasks to task nr n, first - * checking that n isn't the current task, in which case it does nothing. - * This also clears the TS-flag if the task we switched to has used - * tha math co-processor latest. - */ -#define switch_to(tsk) \ -__asm__("cli\n\t" \ - "xchgl %%ecx,_current\n\t" \ - "ljmp %0\n\t" \ - "sti\n\t" \ - "cmpl %%ecx,_last_task_used_math\n\t" \ - "jne 1f\n\t" \ - "clts\n" \ - "1:" \ - : /* no output */ \ - :"m" (*(((char *)&tsk->tss.tr)-4)), \ - "c" (tsk) \ - :"cx") - -#define _set_base(addr,base) \ -__asm__("movw %%dx,%0\n\t" \ - "rorl $16,%%edx\n\t" \ - "movb %%dl,%1\n\t" \ - "movb %%dh,%2" \ - : /* no output */ \ - :"m" (*((addr)+2)), \ - "m" (*((addr)+4)), \ - "m" (*((addr)+7)), \ - "d" (base) \ - :"dx") - -#define _set_limit(addr,limit) \ -__asm__("movw %%dx,%0\n\t" \ - "rorl $16,%%edx\n\t" \ - "movb %1,%%dh\n\t" \ - "andb $0xf0,%%dh\n\t" \ - "orb %%dh,%%dl\n\t" \ - "movb %%dl,%1" \ - : /* no output */ \ - :"m" (*(addr)), \ - "m" (*((addr)+6)), \ - "d" (limit) \ - :"dx") - -#define set_base(ldt,base) _set_base( ((char *)&(ldt)) , base ) -#define set_limit(ldt,limit) _set_limit( ((char *)&(ldt)) , (limit-1)>>12 ) - -/* * The wait-queues are circular lists, and you have to be *very* sure * to keep them correct. Use only these two functions to add/remove * entries in the queues. */ -extern inline void add_wait_queue(struct wait_queue ** p, struct wait_queue * wait) +extern inline void add_wait_queue(struct wait_queue ** p, + struct wait_queue * wait) { - unsigned long flags; + unsigned long flags; -#ifdef DEBUG +#if defined (DEBUG) && defined (__mips__) + /* + * FIXME: I don't work for MIPS yet + */ if (wait->next) { unsigned long pc; __asm__ __volatile__("call 1f\n" "1:\tpopl %0":"=r" (pc)); - printk("add_wait_queue (%08x): wait->next = %08x\n",pc,(unsigned long) wait->next); - } + printk("add_wait_queue (%08x): wait->next = %08x\n",pc, + (unsigned long) wait->next); + } #endif save_flags(flags); cli(); @@ -478,27 +214,37 @@ extern inline void add_wait_queue(struct wait_queue ** p, struct wait_queue * wa restore_flags(flags); } -extern inline void remove_wait_queue(struct wait_queue ** p, struct wait_queue * wait) +extern inline void remove_wait_queue(struct wait_queue ** p, + struct wait_queue *wait) { unsigned long flags; struct wait_queue * tmp; -#ifdef DEBUG +#if defined (DEBUG) && !defined(__mips__) + /* + * FIXME: I don't work for MIPS yet + */ unsigned long ok = 0; #endif save_flags(flags); cli(); if ((*p == wait) && -#ifdef DEBUG +#if defined (DEBUG) && !defined(__mips__) + /* + * FIXME: I don't work for MIPS yet + */ (ok = 1) && #endif ((*p = wait->next) == wait)) { *p = NULL; - } else { + } else { tmp = wait; while (tmp->next != wait) { tmp = tmp->next; -#ifdef DEBUG +#if defined (DEBUG) && !defined(__mips__) + /* + * FIXME: I don't work for MIPS yet + */ if (tmp == *p) ok = 1; #endif @@ -507,17 +253,22 @@ extern inline void remove_wait_queue(struct wait_queue ** p, struct wait_queue * } wait->next = NULL; restore_flags(flags); -#ifdef DEBUG +#if defined (DEBUG) && !defined(__mips__) + /* + * FIXME: I don't work for MIPS yet + */ if (!ok) { printk("removed wait_queue not on list.\n"); - printk("list = %08x, queue = %08x\n",(unsigned long) p, (unsigned long) wait); + printk("list = %08x, queue = %08x\n",(unsigned long) p, (unsigne +d long) wait); __asm__("call 1f\n1:\tpopl %0":"=r" (ok)); printk("eip = %08x\n",ok); } #endif } -extern inline void select_wait(struct wait_queue ** wait_address, select_table * p) +extern inline void select_wait(struct wait_queue ** wait_address, + select_table *p) { struct select_table_entry * entry; @@ -525,7 +276,7 @@ extern inline void select_wait(struct wait_queue ** wait_address, select_table * return; if (p->nr >= __MAX_SELECT_TABLE_ENTRIES) return; - entry = p->entry + p->nr; + entry = p->entry + p->nr; entry->wait_address = wait_address; entry->wait.task = current; entry->wait.next = NULL; @@ -549,30 +300,6 @@ extern inline void up(struct semaphore * sem) { sem->count++; wake_up(&sem->wait); -} - -static inline unsigned long _get_base(char * addr) -{ - unsigned long __base; - __asm__("movb %3,%%dh\n\t" - "movb %2,%%dl\n\t" - "shll $16,%%edx\n\t" - "movw %1,%%dx" - :"=&d" (__base) - :"m" (*((addr)+2)), - "m" (*((addr)+4)), - "m" (*((addr)+7))); - return __base; -} - -#define get_base(ldt) _get_base( ((char *)&(ldt)) ) - -static inline unsigned long get_limit(unsigned long segment) -{ - unsigned long __limit; - __asm__("lsll %1,%0" - :"=r" (__limit):"r" (segment)); - return __limit+1; } #define REMOVE_LINKS(p) do { unsigned long flags; \ @@ -604,21 +331,11 @@ static inline unsigned long get_limit(unsigned long segment) #define for_each_task(p) \ for (p = &init_task ; (p = p->next_task) != &init_task ; ) +#endif /* __KERNEL__ */ + /* - * This is the ldt that every process will get unless we need - * something other than this. + * Include machine dependent stuff */ -extern struct desc_struct default_ldt; - -/* This special macro can be used to load a debugging register */ - -#define loaddebug(register) \ - __asm__("movl %0,%%edx\n\t" \ - "movl %%edx,%%db" #register "\n\t" \ - : /* no output */ \ - :"m" (current->debugreg[register]) \ - :"dx"); - -#endif /* __KERNEL__ */ +#include <asm/sched.h> #endif diff --git a/include/linux/signal.h b/include/linux/signal.h index ed625098f..4527fae69 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -76,33 +76,9 @@ struct sigaction { void (*sa_restorer)(void); }; -#ifdef __KERNEL__ - -struct sigcontext_struct { - unsigned short gs, __gsh; - unsigned short fs, __fsh; - unsigned short es, __esh; - unsigned short ds, __dsh; - unsigned long edi; - unsigned long esi; - unsigned long ebp; - unsigned long esp; - unsigned long ebx; - unsigned long edx; - unsigned long ecx; - unsigned long eax; - unsigned long trapno; - unsigned long err; - unsigned long eip; - unsigned short cs, __csh; - unsigned long eflags; - unsigned long esp_at_signal; - unsigned short ss, __ssh; - unsigned long i387; - unsigned long oldmask; - unsigned long cr2; -}; - -#endif +/* + * Include machine dependencies + */ +#include <asm/signal.h> #endif diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 4acc22cae..36fe49b53 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -17,7 +17,6 @@ #ifndef _LINUX_TCP_H #define _LINUX_TCP_H -#include <asm/types.h> #define HEADER_SIZE 64 /* maximum header size */ @@ -27,7 +26,7 @@ struct tcphdr { u16 dest; u32 seq; u32 ack_seq; -#if defined(__i386__) +#if defined(__i386__) || defined(__MIPSEL__) u16 res1:4, doff:4, fin:1, @@ -37,7 +36,7 @@ struct tcphdr { ack:1, urg:1, res2:2; -#elif defined(__mc68000__) +#elif defined(__mc68000__) || defined(__MIPSEB__) u16 res2:2, urg:1, ack:1, diff --git a/include/linux/tqueue.h b/include/linux/tqueue.h index d264495e3..45b4403a0 100644 --- a/include/linux/tqueue.h +++ b/include/linux/tqueue.h @@ -144,8 +144,7 @@ _INLINE_ void run_task_queue(task_queue *list) while(1) { p = &tq_last; - __asm__ __volatile__("xchgl %0,%2" : "=r" (p) : - "0" (p), "m" (*list) : "memory"); + atomic_exchange(*list,p); if(p == &tq_last) break; diff --git a/include/linux/types.h b/include/linux/types.h index bc068f3b3..8d04cf810 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -94,30 +94,10 @@ typedef struct fd_set { #undef __FD_SETSIZE #define __FD_SETSIZE (__FDSET_LONGS*__NFDBITS) -#undef __FD_SET -#define __FD_SET(fd,fdsetp) \ - __asm__ __volatile__("btsl %1,%0": \ - "=m" (*(fd_set *) (fdsetp)):"r" ((int) (fd))) - -#undef __FD_CLR -#define __FD_CLR(fd,fdsetp) \ - __asm__ __volatile__("btrl %1,%0": \ - "=m" (*(fd_set *) (fdsetp)):"r" ((int) (fd))) - -#undef __FD_ISSET -#define __FD_ISSET(fd,fdsetp) (__extension__ ({ \ - unsigned char __result; \ - __asm__ __volatile__("btl %1,%2 ; setb %0" \ - :"=q" (__result) :"r" ((int) (fd)), \ - "m" (*(fd_set *) (fdsetp))); \ - __result; })) - -#undef __FD_ZERO -#define __FD_ZERO(fdsetp) \ - __asm__ __volatile__("cld ; rep ; stosl" \ - :"=m" (*(fd_set *) (fdsetp)) \ - :"a" (0), "c" (__FDSET_LONGS), \ - "D" ((fd_set *) (fdsetp)) :"cx","di") +/* + * Include machine dependent assembler stuff + */ +#include <asm/types.h> struct ustat { daddr_t f_tfree; |