diff options
| author | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 20:11:40 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 20:11:40 -0800 |
| commit | 87f504e5c78b910b0c1d6ffb89bc95e492322c84 (patch) | |
| tree | 09ce73c1ce5fa5beb1a8c99858ef0bc5428e7f2a /include | |
| parent | f7bad91dac8ba67fbffb094f662f7444a0891314 (diff) | |
v2.4.9.1 -> v2.4.9.2
- Al Viro: block device cleanups
- Marcelo Tosatti: make bounce buffer allocations more robust (it's ok
for them to do IO, just not cause recursive bounce IO. So allow them)
- Anton Altaparmakov: NTFS update (1.1.17)
- Paul Mackerras: PPC update (big re-org)
- Petko Manolov: USB pegasus driver fixes
- David Miller: networking and sparc updates
- Trond Myklebust: Export atomic_dec_and_lock
- OGAWA Hirofumi: find and fix umsdos "filldir" users that were broken
by the 64-bit-cleanups. Fix msdos warnings.
- Al Viro: superblock handling cleanups and race fixes
- Johannes Erdfelt++: USB updates
Diffstat (limited to 'include')
48 files changed, 655 insertions, 321 deletions
diff --git a/include/asm-alpha/keyboard.h b/include/asm-alpha/keyboard.h index cb2f36d54239..eb0047023d48 100644 --- a/include/asm-alpha/keyboard.h +++ b/include/asm-alpha/keyboard.h @@ -13,8 +13,6 @@ #ifdef __KERNEL__ -#include <linux/kd.h> - #define KEYBOARD_IRQ 1 #define DISABLE_KBD_DURING_INTERRUPTS 0 @@ -24,7 +22,6 @@ extern int pckbd_translate(unsigned char scancode, unsigned char *keycode, char raw_mode); extern char pckbd_unexpected_up(unsigned char keycode); extern void pckbd_leds(unsigned char leds); -extern int pckbd_rate(struct kbd_repeat *rep); extern void pckbd_init_hw(void); extern unsigned char pckbd_sysrq_xlate[128]; @@ -33,7 +30,6 @@ extern unsigned char pckbd_sysrq_xlate[128]; #define kbd_translate pckbd_translate #define kbd_unexpected_up pckbd_unexpected_up #define kbd_leds pckbd_leds -#define kbd_rate pckbd_rate #define kbd_init_hw pckbd_init_hw #define kbd_sysrq_xlate pckbd_sysrq_xlate diff --git a/include/asm-i386/keyboard.h b/include/asm-i386/keyboard.h index c3062c3de049..0922ecaa023c 100644 --- a/include/asm-i386/keyboard.h +++ b/include/asm-i386/keyboard.h @@ -27,7 +27,6 @@ extern int pckbd_translate(unsigned char scancode, unsigned char *keycode, char raw_mode); extern char pckbd_unexpected_up(unsigned char keycode); extern void pckbd_leds(unsigned char leds); -extern int pckbd_rate(struct kbd_repeat *rep); extern void pckbd_init_hw(void); extern void pckbd_pm_resume(void); extern unsigned char pckbd_sysrq_xlate[128]; @@ -37,7 +36,6 @@ extern unsigned char pckbd_sysrq_xlate[128]; #define kbd_translate pckbd_translate #define kbd_unexpected_up pckbd_unexpected_up #define kbd_leds pckbd_leds -#define kbd_rate pckbd_rate #define kbd_init_hw pckbd_init_hw #define kbd_sysrq_xlate pckbd_sysrq_xlate diff --git a/include/asm-ppc/atomic.h b/include/asm-ppc/atomic.h index a0fa988a5029..3f9233305320 100644 --- a/include/asm-ppc/atomic.h +++ b/include/asm-ppc/atomic.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.atomic.h 1.8 05/17/01 18:14:24 cort + * BK Id: SCCS/s.atomic.h 1.13 08/21/01 16:07:48 trini */ /* * PowerPC atomic operations @@ -7,6 +7,7 @@ #ifndef _ASM_PPC_ATOMIC_H_ #define _ASM_PPC_ATOMIC_H_ +#ifdef __KERNEL__ typedef struct { volatile int counter; } atomic_t; @@ -18,75 +19,137 @@ typedef struct { volatile int counter; } atomic_t; extern void atomic_clear_mask(unsigned long mask, unsigned long *addr); extern void atomic_set_mask(unsigned long mask, unsigned long *addr); -static __inline__ int atomic_add_return(int a, atomic_t *v) +#ifdef CONFIG_SMP +#define SMP_ISYNC "\n\tisync" +#else +#define SMP_ISYNC +#endif + +static __inline__ void atomic_add(int a, atomic_t *v) { int t; - __asm__ __volatile__("\n\ -1: lwarx %0,0,%3\n\ + __asm__ __volatile__( +"1: lwarx %0,0,%3 # atomic_add\n\ add %0,%2,%0\n\ stwcx. %0,0,%3\n\ bne- 1b" : "=&r" (t), "=m" (v->counter) - : "r" (a), "r" (v), "m" (v->counter) + : "r" (a), "r" (&v->counter), "m" (v->counter) : "cc"); +} + +static __inline__ int atomic_add_return(int a, atomic_t *v) +{ + int t; + + __asm__ __volatile__( +"1: lwarx %0,0,%2 # atomic_add_return\n\ + add %0,%1,%0\n\ + stwcx. %0,0,%2\n\ + bne- 1b" + SMP_ISYNC + : "=&r" (t) + : "r" (a), "r" (&v->counter) + : "cc", "memory"); return t; } -static __inline__ int atomic_sub_return(int a, atomic_t *v) +static __inline__ void atomic_sub(int a, atomic_t *v) { int t; - __asm__ __volatile__("\n\ -1: lwarx %0,0,%3\n\ + __asm__ __volatile__( +"1: lwarx %0,0,%3 # atomic_sub\n\ subf %0,%2,%0\n\ stwcx. %0,0,%3\n\ bne- 1b" : "=&r" (t), "=m" (v->counter) - : "r" (a), "r" (v), "m" (v->counter) + : "r" (a), "r" (&v->counter), "m" (v->counter) : "cc"); +} + +static __inline__ int atomic_sub_return(int a, atomic_t *v) +{ + int t; + + __asm__ __volatile__( +"1: lwarx %0,0,%2 # atomic_sub_return\n\ + subf %0,%1,%0\n\ + stwcx. %0,0,%2\n\ + bne- 1b" + SMP_ISYNC + : "=&r" (t) + : "r" (a), "r" (&v->counter) + : "cc", "memory"); return t; } -static __inline__ int atomic_inc_return(atomic_t *v) +static __inline__ void atomic_inc(atomic_t *v) { int t; - __asm__ __volatile__("\n\ -1: lwarx %0,0,%2\n\ + __asm__ __volatile__( +"1: lwarx %0,0,%2 # atomic_inc\n\ addic %0,%0,1\n\ stwcx. %0,0,%2\n\ bne- 1b" : "=&r" (t), "=m" (v->counter) - : "r" (v), "m" (v->counter) + : "r" (&v->counter), "m" (v->counter) : "cc"); +} + +static __inline__ int atomic_inc_return(atomic_t *v) +{ + int t; + + __asm__ __volatile__( +"1: lwarx %0,0,%1 # atomic_inc_return\n\ + addic %0,%0,1\n\ + stwcx. %0,0,%1\n\ + bne- 1b" + SMP_ISYNC + : "=&r" (t) + : "r" (&v->counter) + : "cc", "memory"); return t; } -static __inline__ int atomic_dec_return(atomic_t *v) +static __inline__ void atomic_dec(atomic_t *v) { int t; - __asm__ __volatile__("\n\ -1: lwarx %0,0,%2\n\ + __asm__ __volatile__( +"1: lwarx %0,0,%2 # atomic_dec\n\ addic %0,%0,-1\n\ stwcx. %0,0,%2\n\ - bne 1b" + bne- 1b" : "=&r" (t), "=m" (v->counter) - : "r" (v), "m" (v->counter) + : "r" (&v->counter), "m" (v->counter) : "cc"); +} + +static __inline__ int atomic_dec_return(atomic_t *v) +{ + int t; + + __asm__ __volatile__( +"1: lwarx %0,0,%1 # atomic_dec_return\n\ + addic %0,%0,-1\n\ + stwcx. %0,0,%1\n\ + bne- 1b" + SMP_ISYNC + : "=&r" (t) + : "r" (&v->counter) + : "cc", "memory"); return t; } -#define atomic_add(a, v) ((void) atomic_add_return((a), (v))) -#define atomic_sub(a, v) ((void) atomic_sub_return((a), (v))) #define atomic_sub_and_test(a, v) (atomic_sub_return((a), (v)) == 0) -#define atomic_inc(v) ((void) atomic_inc_return((v))) -#define atomic_dec(v) ((void) atomic_dec_return((v))) #define atomic_dec_and_test(v) (atomic_dec_return((v)) == 0) /* @@ -97,16 +160,17 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v) { int t; - __asm__ __volatile__("\n" -"1: lwarx %0,0,%2\n" -" addic. %0,%0,-1\n" -" blt 2f\n" -" stwcx. %0,0,%2\n" -" bne 1b\n" -"2:" - : "=&r" (t), "=m" (v->counter) - : "r" (&v->counter), "m" (v->counter) - : "cc"); + __asm__ __volatile__( +"1: lwarx %0,0,%1 # atomic_dec_if_positive\n\ + addic. %0,%0,-1\n\ + blt- 2f\n\ + stwcx. %0,0,%1\n\ + bne- 1b" + SMP_ISYNC + "\n\ +2:" : "=&r" (t) + : "r" (&v->counter) + : "cc", "memory"); return t; } @@ -116,4 +180,5 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v) #define smp_mb__before_atomic_inc() smp_mb() #define smp_mb__after_atomic_inc() smp_mb() +#endif /* __KERNEL__ */ #endif /* _ASM_PPC_ATOMIC_H_ */ diff --git a/include/asm-ppc/bootinfo.h b/include/asm-ppc/bootinfo.h index 2e0841f966f2..1eaf18c87c5c 100644 --- a/include/asm-ppc/bootinfo.h +++ b/include/asm-ppc/bootinfo.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.bootinfo.h 1.9 06/13/01 15:28:43 paulus + * BK Id: SCCS/s.bootinfo.h 1.11 08/17/01 15:23:17 paulus */ /* * Non-machine dependent bootinfo structure. Basic idea @@ -31,6 +31,7 @@ struct bi_record { #define BI_INITRD 0x1014 #define BI_SYSMAP 0x1015 #define BI_MACHTYPE 0x1016 +#define BI_MEMSIZE 0x1017 #endif /* CONFIG_APUS */ diff --git a/include/asm-ppc/bseip.h b/include/asm-ppc/bseip.h index d956c761baa2..89ade107cae0 100644 --- a/include/asm-ppc/bseip.h +++ b/include/asm-ppc/bseip.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.bseip.h 1.7 05/17/01 18:14:24 cort + * BK Id: SCCS/s.bseip.h 1.10 08/17/01 15:23:17 paulus */ /* @@ -39,8 +39,4 @@ extern bd_t m8xx_board_info; */ #define NR_8259_INTS 0 -/* Machine type -*/ -#define _MACH_8xx (_MACH_bseip) - #endif diff --git a/include/asm-ppc/btext.h b/include/asm-ppc/btext.h new file mode 100644 index 000000000000..efdea49d509c --- /dev/null +++ b/include/asm-ppc/btext.h @@ -0,0 +1,37 @@ +/* + * BK Id: %F% %I% %G% %U% %#% + */ +/* + * Definitions for using the procedures in btext.c. + * + * Benjamin Herrenschmidt <benh@kernel.crashing.org> + */ +#ifndef __PPC_BTEXT_H +#define __PPC_BTEXT_H +#ifdef __KERNEL__ + +#include <asm/bootx.h> + +extern void btext_clearscreen(void); +extern void btext_flushscreen(void); + +extern unsigned long disp_BAT[2]; + +extern boot_infos_t *disp_bi; +extern int boot_text_mapped; + +void btext_init(boot_infos_t *bi); +void btext_welcome(boot_infos_t* bi); +void btext_prepare_BAT(void); +void btext_setup_display(int width, int height, int depth, int pitch, + unsigned long address); +void map_boot_text(void); +void btext_update_display(unsigned long phys, int width, int height, + int depth, int pitch); + +void btext_drawchar(char c); +void btext_drawstring(const char *str); +void btext_drawhex(unsigned long v); + +#endif /* __KERNEL__ */ +#endif /* __PPC_BTEXT_H */ diff --git a/include/asm-ppc/cputable.h b/include/asm-ppc/cputable.h new file mode 100644 index 000000000000..e8861a61f88f --- /dev/null +++ b/include/asm-ppc/cputable.h @@ -0,0 +1,92 @@ +/* + * BK Id: SCCS/s.cputable.h 1.3 08/19/01 22:31:46 paulus + */ +/* + * include/asm-ppc/cputable.h + * + * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#ifndef __ASM_PPC_CPUTABLE_H +#define __ASM_PPC_CPUTABLE_H + +/* Exposed to userland CPU features */ +#define PPC_FEATURE_32 0x80000000 +#define PPC_FEATURE_64 0x40000000 +#define PPC_FEATURE_601_INSTR 0x20000000 +#define PPC_FEATURE_HAS_ALTIVEC 0x10000000 +#define PPC_FEATURE_HAS_FPU 0x08000000 +#define PPC_FEATURE_HAS_MMU 0x04000000 +#define PPC_FEATURE_HAS_4xxMAC 0x02000000 +#define PPC_FEATURE_UNIFIED_CACHE 0x01000000 + +#ifdef __KERNEL__ + +#ifndef __ASSEMBLY__ + +/* This structure can grow, it's real size is used by head.S code + * via the mkdefs mecanism. + */ +struct cpu_spec { + /* CPU is matched via (PVR & pvr_mask) == pvr_value */ + unsigned int pvr_mask; + unsigned int pvr_value; + + char *cpu_name; + unsigned int cpu_features; /* Kernel features */ + unsigned int cpu_user_features; /* Userland features */ + + /* cache line sizes */ + unsigned int icache_bsize; + unsigned int dcache_bsize; + + /* this is called to initialize various CPU bits like L1 cache, + * BHT, SPD, etc... from head.S before branching to identify_machine + */ + void (*cpu_setup)(int cpu_nr); +}; + +extern struct cpu_spec cpu_specs[]; +extern struct cpu_spec *cur_cpu_spec[]; + +#endif /* __ASSEMBLY__ */ + +/* CPU kernel features */ +#define CPU_FTR_SPLIT_ID_CACHE 0x00000001 +#define CPU_FTR_L2CR 0x00000002 +#define CPU_FTR_SPEC7450 0x00000004 +#define CPU_FTR_ALTIVEC 0x00000008 +#define CPU_FTR_TAU 0x00000010 +#define CPU_FTR_CAN_DOZE 0x00000020 +#define CPU_FTR_USE_TB 0x00000040 +#define CPU_FTR_604_PERF_MON 0x00000080 +#define CPU_FTR_601 0x00000100 +#define CPU_FTR_HPTE_TABLE 0x00000200 + +#ifdef __ASSEMBLY__ + +#define BEGIN_FTR_SECTION 98: + +#define END_FTR_SECTION(msk, val) \ +99: \ + .section __ftr_fixup,"a"; \ + .align 2; \ + .long msk; \ + .long val; \ + .long 98b; \ + .long 99b; \ + .previous + +#define END_FTR_SECTION_IFSET(msk) END_FTR_SECTION((msk), (msk)) +#define END_FTR_SECTION_IFCLR(msk) END_FTR_SECTION((msk), 0) + +#endif /* __ASSEMBLY__ */ + +#endif /* __ASM_PPC_CPUTABLE_H */ +#endif /* __KERNEL__ */ + diff --git a/include/asm-ppc/elf.h b/include/asm-ppc/elf.h index e36559e84d45..1f7703728fa2 100644 --- a/include/asm-ppc/elf.h +++ b/include/asm-ppc/elf.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.elf.h 1.10 05/17/01 18:14:24 cort + * BK Id: SCCS/s.elf.h 1.14 08/21/01 16:07:48 trini */ #ifndef __PPC_ELF_H #define __PPC_ELF_H @@ -7,7 +7,9 @@ /* * ELF register definitions.. */ +#include <asm/types.h> #include <asm/ptrace.h> +#include <asm/cputable.h> #define ELF_NGREG 48 /* includes nip, msr, lr, etc. */ #define ELF_NFPREG 33 /* includes fpscr */ @@ -60,7 +62,7 @@ typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG]; instruction set this cpu supports. This could be done in userspace, but it's not easy, and we've already done it here. */ -#define ELF_HWCAP (0) +#define ELF_HWCAP (cur_cpu_spec[0]->cpu_user_features) /* This yields a string that ld.so will use to load implementation specific libraries for optimization. This is more specific in diff --git a/include/asm-ppc/fads.h b/include/asm-ppc/fads.h index 292936d99514..0151a2f33f58 100644 --- a/include/asm-ppc/fads.h +++ b/include/asm-ppc/fads.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.fads.h 1.8 05/17/01 18:14:24 cort + * BK Id: SCCS/s.fads.h 1.11 08/17/01 15:23:17 paulus */ /* @@ -66,8 +66,4 @@ extern bd_t m8xx_board_info; */ #define NR_8259_INTS 0 -/* Machine type - */ -#define _MACH_8xx (_MACH_fads) - #endif diff --git a/include/asm-ppc/feature.h b/include/asm-ppc/feature.h index 55af19439b66..3e7007bce88c 100644 --- a/include/asm-ppc/feature.h +++ b/include/asm-ppc/feature.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.feature.h 1.9 05/17/01 18:14:24 cort + * BK Id: SCCS/s.feature.h 1.13 08/19/01 22:23:04 paulus */ /* * Definitions for accessing the Feature Control Register (FCR) @@ -92,6 +92,8 @@ extern void feature_set_usb_power(struct device_node* device, int power); extern void feature_set_firewire_power(struct device_node* device, int power); extern void feature_set_firewire_cable_power(struct device_node* device, int power); +extern void feature_set_modem_power(struct device_node* device, int power); + extern void feature_set_airport_power(struct device_node* device, int power); extern void feature_core99_kick_cpu(int cpu_nr); diff --git a/include/asm-ppc/ide.h b/include/asm-ppc/ide.h index 4a96d3307be1..c211ba0387b1 100644 --- a/include/asm-ppc/ide.h +++ b/include/asm-ppc/ide.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ide.h 1.10 05/17/01 18:14:24 cort + * BK Id: SCCS/s.ide.h 1.13 08/20/01 15:25:16 paulus */ /* * linux/include/asm-ppc/ide.h @@ -29,22 +29,9 @@ #include <linux/ioport.h> #include <asm/io.h> -extern int pmac_ide_ports_known; -extern ide_ioreg_t pmac_ide_regbase[MAX_HWIFS]; -extern int pmac_ide_irq[MAX_HWIFS]; -extern void pmac_ide_probe(void); - -extern int chrp_ide_ports_known; -extern ide_ioreg_t chrp_ide_regbase[MAX_HWIFS]; -extern ide_ioreg_t chrp_idedma_regbase; /* one for both channels */ -extern unsigned int chrp_ide_irq; -extern void chrp_ide_probe(void); - extern void ppc_generic_ide_fix_driveid(struct hd_driveid *id); struct ide_machdep_calls { - void (*insw)(ide_ioreg_t port, void *buf, int ns); - void (*outsw)(ide_ioreg_t port, void *buf, int ns); int (*default_irq)(ide_ioreg_t base); ide_ioreg_t (*default_io_base)(int index); int (*ide_check_region)(ide_ioreg_t from, unsigned int extent); @@ -53,30 +40,16 @@ struct ide_machdep_calls { const char *name); void (*ide_release_region)(ide_ioreg_t from, unsigned int extent); - void (*fix_driveid)(struct hd_driveid *id); void (*ide_init_hwif)(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq); - - int io_base; }; extern struct ide_machdep_calls ppc_ide_md; -void ide_insw(ide_ioreg_t port, void *buf, int ns); -void ide_outsw(ide_ioreg_t port, void *buf, int ns); void ppc_generic_ide_fix_driveid(struct hd_driveid *id); - -#undef insw -#define insw(port, buf, ns) do { \ - ppc_ide_md.insw((port), (buf), (ns)); \ -} while (0) - -#undef outsw -#define outsw(port, buf, ns) do { \ - ppc_ide_md.outsw((port), (buf), (ns)); \ -} while (0) +#define ide_fix_driveid(id) ppc_generic_ide_fix_driveid((id)) #undef SUPPORT_SLOW_DATA_PORTS #define SUPPORT_SLOW_DATA_PORTS 0 @@ -87,10 +60,9 @@ void ppc_generic_ide_fix_driveid(struct hd_driveid *id); static __inline__ int ide_default_irq(ide_ioreg_t base) { - if ( ppc_ide_md.default_irq ) + if (ppc_ide_md.default_irq) return ppc_ide_md.default_irq(base); - else - return -1; + return 0; } static __inline__ ide_ioreg_t ide_default_io_base(int index) @@ -100,7 +72,7 @@ static __inline__ ide_ioreg_t ide_default_io_base(int index) return 0; } -static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, +static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq) { @@ -135,22 +107,16 @@ static __inline__ int ide_check_region (ide_ioreg_t from, unsigned int extent) static __inline__ void ide_request_region (ide_ioreg_t from, unsigned int extent, const char *name) { - if ( ppc_ide_md.ide_request_region ) + if (ppc_ide_md.ide_request_region) ppc_ide_md.ide_request_region(from, extent, name); } static __inline__ void ide_release_region (ide_ioreg_t from, unsigned int extent) { - if ( ppc_ide_md.ide_release_region ) + if (ppc_ide_md.ide_release_region) ppc_ide_md.ide_release_region(from, extent); } -static __inline__ void ide_fix_driveid (struct hd_driveid *id) -{ - if ( ppc_ide_md.fix_driveid ) - ppc_ide_md.fix_driveid(id); -} - typedef union { unsigned all : 8; /* all of the bits together */ struct { diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h index 9ad2e0efcef3..af5bfadc57f8 100644 --- a/include/asm-ppc/io.h +++ b/include/asm-ppc/io.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.io.h 1.7 05/17/01 18:14:24 cort + * BK Id: SCCS/s.io.h 1.11 08/28/01 15:48:26 paulus */ #ifdef __KERNEL__ #ifndef _PPC_IO_H @@ -24,7 +24,7 @@ #define PREP_PCI_DRAM_OFFSET 0x80000000 #if defined(CONFIG_4xx) -#include <asm/board.h> +#include <asm/ppc4xx.h> #elif defined(CONFIG_8xx) #include <asm/mpc8xx.h> #elif defined(CONFIG_8260) @@ -185,15 +185,13 @@ extern void _outsl_ns(volatile u32 *port, const void *buf, int nl); */ extern void *__ioremap(unsigned long address, unsigned long size, unsigned long flags); -extern void *__ioremap_at(unsigned long phys, unsigned long size, - unsigned long flags); extern void *ioremap(unsigned long address, unsigned long size); #define ioremap_nocache(addr, size) ioremap((addr), (size)) extern void iounmap(void *addr); extern unsigned long iopa(unsigned long addr); -#ifdef CONFIG_APUS extern unsigned long mm_ptov(unsigned long addr) __attribute__ ((const)); -#endif +extern void io_block_mapping(unsigned long virt, unsigned long phys, + unsigned int size, int flags); /* * The PCI bus is inherently Little-Endian. The PowerPC is being @@ -246,6 +244,12 @@ extern inline void * phys_to_virt(unsigned long address) #endif } +/* + * Change "struct page" to physical address. + */ +#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) +#define page_to_bus(page) (page_to_phys(page) + PCI_DRAM_OFFSET) + #endif /* __KERNEL__ */ /* diff --git a/include/asm-ppc/ivms8.h b/include/asm-ppc/ivms8.h index 53018a0a11c0..b5142e4cbd23 100644 --- a/include/asm-ppc/ivms8.h +++ b/include/asm-ppc/ivms8.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.ivms8.h 1.5 05/17/01 18:14:24 cort + * BK Id: SCCS/s.ivms8.h 1.6 08/17/01 15:23:17 paulus */ /* * A collection of structures, addresses, and values associated with @@ -87,9 +87,4 @@ typedef struct bd_info { */ #define NR_8259_INTS 0 -/* Generic 8xx type -*/ -#define _MACH_8xx (_MACH_ivms8) - #endif /* __MACH_IVMS8_DEFS */ - diff --git a/include/asm-ppc/keyboard.h b/include/asm-ppc/keyboard.h index 28bcb275e139..4cc11f04d47e 100644 --- a/include/asm-ppc/keyboard.h +++ b/include/asm-ppc/keyboard.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.keyboard.h 1.5 05/17/01 18:14:24 cort + * BK Id: %F% %I% %G% %U% %#% */ /* * linux/include/asm-ppc/keyboard.h @@ -23,6 +23,7 @@ #include <linux/kernel.h> #include <linux/ioport.h> +#include <linux/kd.h> #include <asm/io.h> #define KEYBOARD_IRQ 1 @@ -67,13 +68,14 @@ static inline void kbd_leds(unsigned char leds) if ( ppc_md.kbd_leds ) ppc_md.kbd_leds(leds); } - + static inline void kbd_init_hw(void) { if ( ppc_md.kbd_init_hw ) ppc_md.kbd_init_hw(); } +#define kbd_rate (ppc_md.kbd_rate_fn) #define kbd_sysrq_xlate (ppc_md.ppc_kbd_sysrq_xlate) extern unsigned long SYSRQ_KEY; diff --git a/include/asm-ppc/keylargo.h b/include/asm-ppc/keylargo.h index e1f455c4630d..c07b525f5a98 100644 --- a/include/asm-ppc/keylargo.h +++ b/include/asm-ppc/keylargo.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.keylargo.h 1.9 05/17/01 18:14:24 cort + * BK Id: SCCS/s.keylargo.h 1.13 08/19/01 22:23:04 paulus */ /* * keylargo.h: definitions for using the "KeyLargo" I/O controller chip. @@ -35,7 +35,12 @@ #define KL_GPIO_MODEM_RESET (KEYLARGO_GPIO_0+0x03) /* Pangea */ #define KL_GPIO_MODEM_POWER (KEYLARGO_GPIO_0+0x02) /* Pangea */ +/* Hrm... this one is only to be used on Pismo. It seeem to also + * control the timebase enable on other machines. Still to be + * experimented... --BenH. + */ #define KL_GPIO_FW_CABLE_POWER (KEYLARGO_GPIO_0+0x09) +#define KL_GPIO_TB_ENABLE (KEYLARGO_GPIO_0+0x09) #define KL_GPIO_ETH_PHY_RESET (KEYLARGO_GPIO_0+0x10) diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h index c3a0a44412d6..2862d8c89c7b 100644 --- a/include/asm-ppc/machdep.h +++ b/include/asm-ppc/machdep.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.machdep.h 1.14 06/28/01 16:13:50 paulus + * BK Id: SCCS/s.machdep.h 1.19 08/18/01 18:16:33 paulus */ #ifdef __KERNEL__ #ifndef _PPC_MACHDEP_H @@ -14,6 +14,7 @@ struct pt_regs; struct pci_bus; struct pci_dev; +struct kbd_repeat; struct machdep_calls { void (*setup_arch)(void); @@ -44,6 +45,8 @@ struct machdep_calls { unsigned long heartbeat_count; unsigned long (*find_end_of_memory)(void); + void (*setup_io_mappings)(void); + void (*progress)(char *, unsigned short); unsigned char (*nvram_read_val)(int addr); @@ -58,6 +61,7 @@ struct machdep_calls { char raw_mode); char (*kbd_unexpected_up)(unsigned char keycode); void (*kbd_leds)(unsigned char leds); + int (*kbd_rate_fn)(struct kbd_repeat *rep); void (*kbd_init_hw)(void); #ifdef CONFIG_MAGIC_SYSRQ unsigned char *ppc_kbd_sysrq_xlate; @@ -83,6 +87,11 @@ struct machdep_calls { /* this is for modules, since _machine can be a define -- Cort */ int ppc_machine; + +#ifdef CONFIG_SMP + /* functions for dealing with other cpus */ + struct smp_ops_t *smp_ops; +#endif /* CONFIG_SMP */ }; extern struct machdep_calls ppc_md; @@ -102,5 +111,14 @@ typedef enum sys_ctrler_kind { extern sys_ctrler_t sys_ctrler; +#ifdef CONFIG_SMP +struct smp_ops_t { + void (*message_pass)(int target, int msg, unsigned long data, int wait); + int (*probe)(void); + void (*kick_cpu)(int nr); + void (*setup_cpu)(int nr); +}; +#endif /* CONFIG_SMP */ + #endif /* _PPC_MACHDEP_H */ #endif /* __KERNEL__ */ diff --git a/include/asm-ppc/mbx.h b/include/asm-ppc/mbx.h index 4f9f89b5be5a..e4896dd357f3 100644 --- a/include/asm-ppc/mbx.h +++ b/include/asm-ppc/mbx.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.mbx.h 1.8 05/17/01 18:14:25 cort + * BK Id: SCCS/s.mbx.h 1.11 08/17/01 15:23:17 paulus */ /* * A collection of structures, addresses, and values associated with @@ -94,8 +94,5 @@ typedef struct bd_info { */ #define NR_8259_INTS 16 -/* Generic 8xx type -*/ -#define _MACH_8xx (_MACH_mbx) #endif #endif /* __KERNEL__ */ diff --git a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h index ce8f81fd4708..7624088c38d5 100644 --- a/include/asm-ppc/mmu_context.h +++ b/include/asm-ppc/mmu_context.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.mmu_context.h 1.12 06/28/01 15:50:17 paulus + * BK Id: SCCS/s.mmu_context.h 1.15 08/16/01 23:00:17 paulus */ #ifdef __KERNEL__ #ifndef __PPC_MMU_CONTEXT_H @@ -58,16 +58,19 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, #ifdef CONFIG_8xx #define NO_CONTEXT 16 #define LAST_CONTEXT 15 +#define FIRST_CONTEXT 0 #elif CONFIG_4xx #define NO_CONTEXT 256 #define LAST_CONTEXT 255 +#define FIRST_CONTEXT 1 #else /* PPC 6xx, 7xx CPUs */ #define NO_CONTEXT ((mm_context_t) -1) #define LAST_CONTEXT 32767 +#define FIRST_CONTEXT 1 #endif /* @@ -75,11 +78,12 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, * On 32-bit PowerPCs (other than the 8xx embedded chips), this is done by * loading up the segment registers for the user part of the address space. * - * On the 8xx parts, the context currently includes the page directory, - * and once I implement a real TLB context manager this will disappear. - * The PGD is ignored on other processors. - Dan + * Since the PGD is immediately available, it is much faster to simply + * pass this along as a second parameter, which is required for 8xx and + * can be used for debugging on all processors (if you happen to have + * an Abatron). */ -extern void set_context(mm_context_t context); +extern void set_context(mm_context_t context, pgd_t *pgd); /* * Bitmap of contexts in use. @@ -156,7 +160,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, { tsk->thread.pgdir = next->pgd; get_mmu_context(next); - set_context(next->context); + set_context(next->context, next->pgd); } /* @@ -167,8 +171,10 @@ static inline void activate_mm(struct mm_struct *active_mm, struct mm_struct *mm { current->thread.pgdir = mm->pgd; get_mmu_context(mm); - set_context(mm->context); + set_context(mm->context, mm->pgd); } +extern void mmu_context_init(void); + #endif /* __PPC_MMU_CONTEXT_H */ #endif /* __KERNEL__ */ diff --git a/include/asm-ppc/page.h b/include/asm-ppc/page.h index 674f96e674a9..3da22a960ce0 100644 --- a/include/asm-ppc/page.h +++ b/include/asm-ppc/page.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.page.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.page.h 1.8 08/19/01 20:06:47 paulus */ #ifndef _PPC_PAGE_H #define _PPC_PAGE_H @@ -12,6 +12,7 @@ #ifdef __KERNEL__ #include <linux/config.h> +/* Be sure to change arch/ppc/Makefile to match */ #define PAGE_OFFSET 0xc0000000 #define KERNELBASE PAGE_OFFSET diff --git a/include/asm-ppc/param.h b/include/asm-ppc/param.h index 87083797b485..259af01bbe8d 100644 --- a/include/asm-ppc/param.h +++ b/include/asm-ppc/param.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.param.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.param.h 1.8 08/20/01 22:50:29 paulus */ #ifndef _ASM_PPC_PARAM_H #define _ASM_PPC_PARAM_H @@ -21,7 +21,7 @@ #define MAXHOSTNAMELEN 64 /* max length of hostname */ #ifdef __KERNEL__ -# define CLOCKS_PER_SEC 100 /* frequency at which times() counts */ +# define CLOCKS_PER_SEC HZ /* frequency at which times() counts */ #endif #endif diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h index 03603fa82351..39c6f6483743 100644 --- a/include/asm-ppc/processor.h +++ b/include/asm-ppc/processor.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.processor.h 1.24 06/15/01 13:56:56 paulus + * BK Id: SCCS/s.processor.h 1.28 08/17/01 15:23:17 paulus */ #ifdef __KERNEL__ #ifndef __ASM_PPC_PROCESSOR_H @@ -475,33 +475,13 @@ #define PVR_8240 0x00810100 #define PVR_8260 PVR_8240 - -/* I am just adding a single entry for 8260 boards. I think we may be - * able to combine mbx, fads, rpxlite, bseip, and classic into a single - * generic 8xx as well. The boards containing these processors are either - * identical at the processor level (due to the high integration) or so - * wildly different that testing _machine at run time is best replaced by - * conditional compilation by board type (found in their respective .h file). - * -- Dan +/* We only need to define a new _MACH_xxx for machines which are part of + * a configuration which supports more than one type of different machine. + * This is currently limited to CONFIG_ALL_PPC and CHRP/PReP/PMac. -- Tom */ #define _MACH_prep 0x00000001 #define _MACH_Pmac 0x00000002 /* pmac or pmac clone (non-chrp) */ #define _MACH_chrp 0x00000004 /* chrp machine */ -#define _MACH_mbx 0x00000008 /* Motorola MBX board */ -#define _MACH_apus 0x00000010 /* amiga with phase5 powerup */ -#define _MACH_fads 0x00000020 /* Motorola FADS board */ -#define _MACH_rpxlite 0x00000040 /* RPCG RPX-Lite 8xx board */ -#define _MACH_bseip 0x00000080 /* Bright Star Engineering ip-Engine */ -#define _MACH_unused0 0x00000100 /* Now free to be used */ -#define _MACH_gemini 0x00000200 /* Synergy Microsystems gemini board */ -#define _MACH_classic 0x00000400 /* RPCG RPX-Classic 8xx board */ -#define _MACH_oak 0x00000800 /* IBM "Oak" 403 eval. board */ -#define _MACH_walnut 0x00001000 /* IBM "Walnut" 405GP eval. board */ -#define _MACH_8260 0x00002000 /* Generic 8260 */ -#define _MACH_tqm860 0x00004000 /* TQM860/L */ -#define _MACH_tqm8xxL 0x00008000 /* TQM8xxL */ -#define _MACH_spd8xx 0x00010000 /* SPD8xx */ -#define _MACH_ivms8 0x00020000 /* IVMS8 */ /* see residual.h for these */ #define _PREP_Motorola 0x01 /* motorola prep */ @@ -558,11 +538,10 @@ n: #ifndef __ASSEMBLY__ #if defined(CONFIG_ALL_PPC) extern int _machine; -extern int have_of; -#endif /* CONFIG_ALL_PPC */ /* what kind of prep workstation we are */ extern int _prep_type; + /* * This is used to identify the board type from a given PReP board * vendor. Board revision is also made available. @@ -570,6 +549,9 @@ extern int _prep_type; extern unsigned char ucSystemType; extern unsigned char ucBoardRev; extern unsigned char ucBoardRevMaj, ucBoardRevMin; +#else +#define _machine 0 +#endif /* CONFIG_ALL_PPC */ struct task_struct; void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp); @@ -681,26 +663,9 @@ void ll_puts(const char *); /* In misc.c */ void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val); -#endif /* ndef ASSEMBLY*/ - -#ifndef CONFIG_ALL_PPC -#if defined(CONFIG_APUS) -#define _machine _MACH_apus -#elif defined(CONFIG_GEMINI) -#define _machine _MACH_gemini -#elif defined(CONFIG_OAK) -#define _machine _MACH_oak -#elif defined(CONFIG_WALNUT) -#define _machine _MACH_walnut -#elif defined(CONFIG_8xx) -#define _machine _MACH_8xx -#elif defined(CONFIG_8260) -#define _machine _MACH_8260 -#else -#error "Machine not defined correctly" -#endif -#define have_of 0 -#endif /* !CONFIG_ALL_PPC */ +#endif /* !__ASSEMBLY__ */ + +#define have_of (_machine == _MACH_chrp || _machine == _MACH_Pmac) #endif /* __ASM_PPC_PROCESSOR_H */ #endif /* __KERNEL__ */ diff --git a/include/asm-ppc/prom.h b/include/asm-ppc/prom.h index c501b2c8cac2..c27ff56c059a 100644 --- a/include/asm-ppc/prom.h +++ b/include/asm-ppc/prom.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.prom.h 1.16 07/25/01 14:11:37 trini + * BK Id: SCCS/s.prom.h 1.19 08/17/01 15:23:17 paulus */ /* * Definitions for talking to the Open Firmware PROM on @@ -18,9 +18,6 @@ typedef void *ihandle; extern char *prom_display_paths[]; extern unsigned int prom_num_displays; -#ifdef CONFIG_ALL_PPC -extern int have_of; -#endif struct address_range { unsigned int space; @@ -92,13 +89,6 @@ extern int prom_n_size_cells(struct device_node* np); extern void print_properties(struct device_node *node); extern int call_rtas(const char *service, int nargs, int nret, unsigned long *outputs, ...); -extern void prom_drawstring(const char *c); -extern void prom_drawhex(unsigned long v); -extern void prom_drawchar(char c); - -extern void map_bootx_text(void); -extern void bootx_update_display(unsigned long phys, int width, int height, - int depth, int pitch); /* * When we call back to the Open Firmware client interface, we usually diff --git a/include/asm-ppc/residual.h b/include/asm-ppc/residual.h index 7e2154e086df..1e5f165e19ab 100644 --- a/include/asm-ppc/residual.h +++ b/include/asm-ppc/residual.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.residual.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.residual.h 1.8 08/09/01 09:11:24 trini */ /* 7/18/95 */ /*----------------------------------------------------------------------------*/ @@ -29,7 +29,7 @@ /* Public structures... */ /*----------------------------------------------------------------------------*/ -#include "pnp.h" +#include <asm/pnp.h> typedef enum _L1CACHE_TYPE { NoneCAC = 0, diff --git a/include/asm-ppc/rpxclassic.h b/include/asm-ppc/rpxclassic.h index 021dc18a0b8d..ec65383b1c43 100644 --- a/include/asm-ppc/rpxclassic.h +++ b/include/asm-ppc/rpxclassic.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.rpxclassic.h 1.8 05/17/01 18:14:25 cort + * BK Id: SCCS/s.rpxclassic.h 1.11 08/17/01 15:23:17 paulus */ /* @@ -100,9 +100,5 @@ extern bd_t m8xx_board_info; */ #define NR_8259_INTS 0 -/* Machine type -*/ -#define _MACH_8xx (_MACH_classic) - #endif #endif /* __KERNEL__ */ diff --git a/include/asm-ppc/rpxlite.h b/include/asm-ppc/rpxlite.h index 4d04d31cd424..2f24dcc74ab2 100644 --- a/include/asm-ppc/rpxlite.h +++ b/include/asm-ppc/rpxlite.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.rpxlite.h 1.8 05/17/01 18:14:25 cort + * BK Id: SCCS/s.rpxlite.h 1.11 08/17/01 15:23:17 paulus */ /* @@ -80,9 +80,5 @@ extern bd_t m8xx_board_info; */ #define NR_8259_INTS 0 -/* Machine type -*/ -#define _MACH_8xx (_MACH_rpxlite) - #endif #endif /* __KERNEL__ */ diff --git a/include/asm-ppc/smp.h b/include/asm-ppc/smp.h index 1a818d536615..2454352aba27 100644 --- a/include/asm-ppc/smp.h +++ b/include/asm-ppc/smp.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.smp.h 1.9 05/17/01 18:14:25 cort + * BK Id: SCCS/s.smp.h 1.12 08/16/01 07:49:31 paulus */ /* smp.h: PPC specific SMP stuff. * @@ -32,12 +32,14 @@ extern struct cpuinfo_PPC cpu_data[NR_CPUS]; extern unsigned long cpu_online_map; extern unsigned long smp_proc_in_lock[NR_CPUS]; extern volatile unsigned long cpu_callin_map[NR_CPUS]; +extern int smp_tb_synchronized; extern void smp_store_cpu_info(int id); extern void smp_send_tlb_invalidate(int); extern void smp_send_xmon_break(int cpu); struct pt_regs; extern void smp_message_recv(int, struct pt_regs *); +extern void smp_local_timer_interrupt(struct pt_regs *); #define NO_PROC_ID 0xFF /* No processor magic marker */ #define PROC_CHANGE_PENALTY 20 diff --git a/include/asm-ppc/spinlock.h b/include/asm-ppc/spinlock.h index df2f406e26d9..10d82555a428 100644 --- a/include/asm-ppc/spinlock.h +++ b/include/asm-ppc/spinlock.h @@ -1,33 +1,79 @@ /* - * BK Id: SCCS/s.spinlock.h 1.5 05/17/01 18:14:25 cort + * BK Id: SCCS/s.spinlock.h 1.9 08/21/01 16:07:48 trini */ -#ifdef __KERNEL__ #ifndef __ASM_SPINLOCK_H #define __ASM_SPINLOCK_H +#include <asm/system.h> + +#undef SPINLOCK_DEBUG + /* * Simple spin lock operations. */ typedef struct { volatile unsigned long lock; +#ifdef SPINLOCK_DEBUG volatile unsigned long owner_pc; volatile unsigned long owner_cpu; +#endif } spinlock_t; -#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0, 0, 0 } -#define spin_lock_init(lp) do { (lp)->lock = 0; } while(0) -#define spin_unlock_wait(lp) do { barrier(); } while((lp)->lock) +#ifdef __KERNEL__ +#if SPINLOCK_DEBUG +#define SPINLOCK_DEBUG_INIT , 0, 0 +#else +#define SPINLOCK_DEBUG_INIT /* */ +#endif + +#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 SPINLOCK_DEBUG_INIT } + +#define spin_lock_init(x) do { *(x) = SPIN_LOCK_UNLOCKED; } while(0) #define spin_is_locked(x) ((x)->lock != 0) +#define spin_unlock_wait(x) do { barrier(); } while(spin_is_locked(x)) + +#ifndef SPINLOCK_DEBUG + +static inline void spin_lock(spinlock_t *lock) +{ + unsigned long tmp; + + __asm__ __volatile__( + "b 1f # spin_lock\n\ +2: lwzx %0,0,%1\n\ + cmpwi 0,%0,0\n\ + bne+ 2b\n\ +1: lwarx %0,0,%1\n\ + cmpwi 0,%0,0\n\ + bne- 2b\n\ + stwcx. %2,0,%1\n\ + bne- 2b\n\ + isync" + : "=&r"(tmp) + : "r"(&lock->lock), "r"(1) + : "cr0", "memory"); +} + +static inline void spin_unlock(spinlock_t *lock) +{ + __asm__ __volatile__("eieio # spin_unlock": : :"memory"); + lock->lock = 0; +} + +#define spin_trylock(lock) (!test_and_set_bit(0,(lock))) + +#else extern void _spin_lock(spinlock_t *lock); extern void _spin_unlock(spinlock_t *lock); extern int spin_trylock(spinlock_t *lock); +extern unsigned long __spin_trylock(volatile unsigned long *lock); #define spin_lock(lp) _spin_lock(lp) #define spin_unlock(lp) _spin_unlock(lp) -extern unsigned long __spin_trylock(volatile unsigned long *lock); +#endif /* * Read-write spinlocks, allowing multiple readers @@ -41,12 +87,85 @@ extern unsigned long __spin_trylock(volatile unsigned long *lock); */ typedef struct { volatile unsigned long lock; +#ifdef SPINLOCK_DEBUG volatile unsigned long owner_pc; +#endif } rwlock_t; -#define RW_LOCK_UNLOCKED (rwlock_t) { 0, 0 } +#if SPINLOCK_DEBUG +#define RWLOCK_DEBUG_INIT , 0 +#else +#define RWLOCK_DEBUG_INIT /* */ +#endif + +#define RW_LOCK_UNLOCKED (rwlock_t) { 0 RWLOCK_DEBUG_INIT } #define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while(0) +#ifndef SPINLOCK_DEBUG + +static __inline__ void read_lock(rwlock_t *rw) +{ + unsigned int tmp; + + __asm__ __volatile__( + "b 2f # read_lock\n\ +1: lwzx %0,0,%1\n\ + cmpwi 0,%0,0\n\ + blt+ 1b\n\ +2: lwarx %0,0,%1\n\ + addic. %0,%0,1\n\ + ble- 1b\n\ + stwcx. %0,0,%1\n\ + bne- 2b\n\ + isync" + : "=&r"(tmp) + : "r"(&rw->lock) + : "cr0", "memory"); +} + +static __inline__ void read_unlock(rwlock_t *rw) +{ + unsigned int tmp; + + __asm__ __volatile__( + "eieio # read_unlock\n\ +1: lwarx %0,0,%1\n\ + addic %0,%0,-1\n\ + stwcx. %0,0,%1\n\ + bne- 1b" + : "=&r"(tmp) + : "r"(&rw->lock) + : "cr0", "memory"); +} + +static __inline__ void write_lock(rwlock_t *rw) +{ + unsigned int tmp; + + __asm__ __volatile__( + "b 2f # write_lock\n\ +1: lwzx %0,0,%1\n\ + cmpwi 0,%0,0\n\ + bne+ 1b\n\ +2: lwarx %0,0,%1\n\ + cmpwi 0,%0,0\n\ + bne- 1b\n\ + stwcx. %2,0,%1\n\ + bne- 2b\n\ + isync" + : "=&r"(tmp) + : "r"(&rw->lock), "r"(-1) + : "cr0", "memory"); +} + +static __inline__ void write_unlock(rwlock_t *rw) +{ + __asm__ __volatile__("eieio # write_unlock": : :"memory"); + rw->lock = 0; +} + +#else + extern void _read_lock(rwlock_t *rw); extern void _read_unlock(rwlock_t *rw); extern void _write_lock(rwlock_t *rw); @@ -57,5 +176,7 @@ extern void _write_unlock(rwlock_t *rw); #define write_unlock(rw) _write_unlock(rw) #define read_unlock(rw) _read_unlock(rw) +#endif + #endif /* __ASM_SPINLOCK_H */ #endif /* __KERNEL__ */ diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h index 86817662676e..95f2d4ede8af 100644 --- a/include/asm-ppc/system.h +++ b/include/asm-ppc/system.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.system.h 1.10 05/17/01 18:14:26 cort + * BK Id: SCCS/s.system.h 1.14 08/20/01 14:34:41 paulus */ /* * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu> @@ -55,9 +55,13 @@ extern void show_regs(struct pt_regs * regs); extern void flush_instruction_cache(void); extern void hard_reset_now(void); extern void poweroff_now(void); -extern int _get_PVR(void); +#ifdef CONFIG_6xx extern long _get_L2CR(void); extern void _set_L2CR(unsigned long); +#else +#define _get_L2CR() 0 +#define _set_L2CR(val) do { } while(0) +#endif extern void via_cuda_init(void); extern void pmac_nvram_init(void); extern void read_rtc_time(void); diff --git a/include/asm-ppc/time.h b/include/asm-ppc/time.h index 2a774bc50428..3bbbdbf41c68 100644 --- a/include/asm-ppc/time.h +++ b/include/asm-ppc/time.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.time.h 1.13 06/27/01 14:49:58 trini + * BK Id: SCCS/s.time.h 1.15 08/16/01 07:49:31 paulus */ /* * Common time prototypes and such for all ppc machines. @@ -76,6 +76,13 @@ extern __inline__ unsigned long get_tbu(void) { return tbl; } +extern __inline__ void set_tb(unsigned int upper, unsigned int lower) +{ + mtspr(SPRN_TBWL, 0); + mtspr(SPRN_TBWU, upper); + mtspr(SPRN_TBWL, lower); +} + extern __inline__ unsigned long get_rtcl(void) { unsigned long rtcl; asm volatile("mfrtcl %0" : "=r" (rtcl)); diff --git a/include/asm-ppc/timex.h b/include/asm-ppc/timex.h index a18fe0aa39de..c2eb9f7abf58 100644 --- a/include/asm-ppc/timex.h +++ b/include/asm-ppc/timex.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.timex.h 1.5 05/17/01 18:14:26 cort + * BK Id: SCCS/s.timex.h 1.8 08/15/01 22:43:07 paulus */ /* * linux/include/asm-ppc/timex.h @@ -11,6 +11,7 @@ #define _ASMppc_TIMEX_H #include <linux/config.h> +#include <asm/cputable.h> #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ #define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ @@ -23,23 +24,25 @@ typedef unsigned long cycles_t; /* * For the "cycle" counter we use the timebase lower half. * Currently only used on SMP. - * - * Since SMP kernels won't run on the PPC601 CPU (which doesn't have - * the timebase register) anyway, we don't bother checking the CPU version. */ extern cycles_t cacheflush_time; static inline cycles_t get_cycles(void) { -#ifdef CONFIG_SMP - cycles_t ret; - - __asm__("mftb %0" : "=r" (ret) : ); + cycles_t ret = 0; + + __asm__ __volatile__( + "98: mftb %0\n" + "99:\n" + ".section __ftr_fixup,\"a\"\n" + " .long %1\n" + " .long 0\n" + " .long 98b\n" + " .long 99b\n" + ".previous" + : "=r" (ret) : "i" (CPU_FTR_601)); return ret; -#else - return 0; -#endif } #endif diff --git a/include/asm-ppc/tqm8xx.h b/include/asm-ppc/tqm8xx.h index 87e7be2722af..d7305d876cab 100644 --- a/include/asm-ppc/tqm8xx.h +++ b/include/asm-ppc/tqm8xx.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.tqm8xx.h 1.6 05/17/01 18:14:26 cort + * BK Id: SCCS/s.tqm8xx.h 1.7 08/17/01 15:23:17 paulus */ /* * A collection of structures, addresses, and values associated with @@ -69,13 +69,4 @@ typedef struct bd_info { */ #define NR_8259_INTS 0 -/* Generic 8xx type -*/ -#if defined(CONFIG_TQM8xxL) -#define _MACH_8xx (_MACH_tqm8xxL) -#endif -#if defined(CONFIG_TQM860) -#define _MACH_8xx (_MACH_tqm860) -#endif - #endif /* __MACH_TQM8xx_DEFS */ diff --git a/include/asm-ppc/uninorth.h b/include/asm-ppc/uninorth.h index 5950c9cd4bad..80fb66a64961 100644 --- a/include/asm-ppc/uninorth.h +++ b/include/asm-ppc/uninorth.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.uninorth.h 1.7 05/17/01 18:14:26 cort + * BK Id: SCCS/s.uninorth.h 1.11 08/19/01 22:23:04 paulus */ /* * uninorth.h: definitions for using the "UniNorth" host bridge chip @@ -31,6 +31,52 @@ #define UNI_N_CFG_GART_ENABLE 0x00000100 #define UNI_N_CFG_GART_2xRESET 0x00010000 +/* My understanding of UniNorth AGP as of UniNorth rev 1.0x, + * revision 1.5 (x4 AGP) may need further changes. + * + * AGP_BASE register contains the base address of the AGP aperture on + * the AGP bus. It doesn't seem to be visible to the CPU as of UniNorth 1.x, + * even if decoding of this address range is enabled in the address select + * register. Apparently, the only supported bases are 256Mb multiples + * (high 4 bits of that register). + * + * GART_BASE register appear to contain the physical address of the GART + * in system memory in the high address bits (page aligned), and the + * GART size in the low order bits (number of GART pages) + * + * The GART format itself is one 32bits word per physical memory page. + * This word contains, in little-endian format (!!!), the physical address + * of the page in the high bits, and what appears to be an "enable" bit + * in the LSB bit (0) that must be set to 1 when the entry is valid. + * + * Obviously, the GART is not cache coherent and so any change to it + * must be flushed to memory (or maybe just make the GART space non + * cachable). AGP memory itself doens't seem to be cache coherent neither. + * + * In order to invalidate the GART (which is probably necessary to inval + * the bridge internal TLBs), the following sequence has to be written, + * in order, to the GART_CTRL register: + * + * UNI_N_CFG_GART_ENABLE | UNI_N_CFG_GART_INVAL + * UNI_N_CFG_GART_ENABLE + * UNI_N_CFG_GART_ENABLE | UNI_N_CFG_GART_2xRESET + * UNI_N_CFG_GART_ENABLE + * + * As far as AGP "features" are concerned, it looks like fast write may + * not be supported but this has to be confirmed. + * + * Turning on AGP seem to require a double invalidate operation, one before + * setting the AGP command register, on after. + * + * Turning off AGP seems to require the following sequence: first wait + * for the AGP to be idle by reading the internal status register, then + * write in that order to the GART_CTRL register: + * + * UNI_N_CFG_GART_ENABLE | UNI_N_CFG_GART_INVAL + * 0 + * UNI_N_CFG_GART_2xRESET + * 0 + */ /* * Uni-N memory mapped reg. definitions diff --git a/include/asm-sparc/keyboard.h b/include/asm-sparc/keyboard.h index b1c5fef648cf..2cf6f48fdc84 100644 --- a/include/asm-sparc/keyboard.h +++ b/include/asm-sparc/keyboard.h @@ -1,4 +1,4 @@ -/* $Id: keyboard.h,v 1.3 1999/11/23 08:56:44 davem Exp $ +/* $Id: keyboard.h,v 1.7 2001/08/18 09:40:46 davem Exp $ * linux/include/asm-sparc/keyboard.h * * sparc64 Created Aug 29 1997 by Eddie C. Dost (ecd@skynet.be) @@ -13,7 +13,9 @@ #ifdef __KERNEL__ +#include <linux/config.h> #include <linux/ioport.h> +#include <linux/kd.h> #include <asm/io.h> #define KEYBOARD_IRQ 13 diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h index 924e0c0ba301..caa84fcf121a 100644 --- a/include/asm-sparc64/floppy.h +++ b/include/asm-sparc64/floppy.h @@ -1,4 +1,4 @@ -/* $Id: floppy.h,v 1.30 2001/05/11 07:05:38 davem Exp $ +/* $Id: floppy.h,v 1.31 2001/08/22 17:46:31 davem Exp $ * asm-sparc64/floppy.h: Sparc specific parts of the Floppy driver. * * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -268,8 +268,15 @@ static int sun_fd_eject(int drive) static struct linux_ebus_dma *sun_pci_fd_ebus_dma; static struct pci_dev *sun_pci_ebus_dev; static int sun_pci_broken_drive = -1; -static unsigned int sun_pci_dma_addr = -1U; -static int sun_pci_dma_len, sun_pci_dma_direction; + +struct sun_pci_dma_op { + unsigned int addr; + int len; + int direction; + char *buf; +}; +static struct sun_pci_dma_op sun_pci_dma_current = { -1U, 0, 0, NULL}; +static struct sun_pci_dma_op sun_pci_dma_pending = { -1U, 0, 0, NULL}; extern void floppy_interrupt(int irq, void *dev_id, struct pt_regs *regs); @@ -339,6 +346,29 @@ static void sun_pci_fd_enable_dma(void) { unsigned int dcsr; + if((NULL == sun_pci_dma_pending.buf) || + (0 == sun_pci_dma_pending.len) || + (0 == sun_pci_dma_pending.direction)) { + goto enable; /* TODO: BUG() */ + } + + sun_pci_dma_current.buf = sun_pci_dma_pending.buf; + sun_pci_dma_current.len = sun_pci_dma_pending.len; + sun_pci_dma_current.direction = sun_pci_dma_pending.direction; + + sun_pci_dma_pending.buf = NULL; + sun_pci_dma_pending.len = 0; + sun_pci_dma_pending.direction = 0; + sun_pci_dma_pending.addr = -1U; + + sun_pci_dma_current.addr = + pci_map_single( sun_pci_ebus_dev, + sun_pci_dma_current.buf, + sun_pci_dma_current.len, + sun_pci_dma_current.direction); + writel(sun_pci_dma_current.addr, &sun_pci_fd_ebus_dma->dacr); + +enable: dcsr = readl(&sun_pci_fd_ebus_dma->dcsr); dcsr |= EBUS_DCSR_EN_DMA; writel(dcsr, &sun_pci_fd_ebus_dma->dcsr); @@ -362,12 +392,12 @@ static void sun_pci_fd_disable_dma(void) writel(dcsr, &sun_pci_fd_ebus_dma->dcsr); } } - if (sun_pci_dma_addr != -1U) + if (sun_pci_dma_current.addr != -1U) pci_unmap_single(sun_pci_ebus_dev, - sun_pci_dma_addr, - sun_pci_dma_len, - sun_pci_dma_direction); - sun_pci_dma_addr = -1U; + sun_pci_dma_current.addr, + sun_pci_dma_current.len, + sun_pci_dma_current.direction); + sun_pci_dma_current.addr = -1U; } static void sun_pci_fd_set_dma_mode(int mode) @@ -387,29 +417,23 @@ static void sun_pci_fd_set_dma_mode(int mode) */ if (mode == DMA_MODE_WRITE) { dcsr &= ~(EBUS_DCSR_WRITE); - sun_pci_dma_direction = PCI_DMA_TODEVICE; + sun_pci_dma_pending.direction = PCI_DMA_TODEVICE; } else { dcsr |= EBUS_DCSR_WRITE; - sun_pci_dma_direction = PCI_DMA_FROMDEVICE; + sun_pci_dma_pending.direction = PCI_DMA_FROMDEVICE; } writel(dcsr, &sun_pci_fd_ebus_dma->dcsr); } static void sun_pci_fd_set_dma_count(int length) { - sun_pci_dma_len = length; + sun_pci_dma_pending.len = length; writel(length, &sun_pci_fd_ebus_dma->dbcr); } static void sun_pci_fd_set_dma_addr(char *buffer) { - unsigned int addr; - - addr = sun_pci_dma_addr = pci_map_single(sun_pci_ebus_dev, - buffer, - sun_pci_dma_len, - sun_pci_dma_direction); - writel(addr, &sun_pci_fd_ebus_dma->dacr); + sun_pci_dma_pending.buf = buffer; } static unsigned int sun_pci_get_dma_residue(void) @@ -719,7 +743,7 @@ static unsigned long __init sun_floppy_init(void) sun_fdops.fd_inb = sun_pci_fd_inb; sun_fdops.fd_outb = sun_pci_fd_outb; - use_virtual_dma = 0; + can_use_virtual_dma = use_virtual_dma = 0; sun_fdops.fd_enable_dma = sun_pci_fd_enable_dma; sun_fdops.fd_disable_dma = sun_pci_fd_disable_dma; sun_fdops.fd_set_dma_mode = sun_pci_fd_set_dma_mode; @@ -796,9 +820,9 @@ static unsigned long __init sun_floppy_init(void) ns87303_modify(config, ASC, ASC_DRV2_SEL, 0); ns87303_modify(config, FCR, 0, FCR_LDE); - cfg = sun_floppy_types[0]; + config = sun_floppy_types[0]; sun_floppy_types[0] = sun_floppy_types[1]; - sun_floppy_types[1] = cfg; + sun_floppy_types[1] = config; if (sun_pci_broken_drive != -1) { sun_pci_broken_drive = 1 - sun_pci_broken_drive; diff --git a/include/asm-sparc64/keyboard.h b/include/asm-sparc64/keyboard.h index 1813bed622c6..2e5c89ab1c40 100644 --- a/include/asm-sparc64/keyboard.h +++ b/include/asm-sparc64/keyboard.h @@ -1,4 +1,4 @@ -/* $Id: keyboard.h,v 1.4 2001/08/13 14:40:07 davem Exp $ +/* $Id: keyboard.h,v 1.5 2001/08/18 09:40:46 davem Exp $ * linux/include/asm-sparc64/keyboard.h * * Created Aug 29 1997 by Eddie C. Dost (ecd@skynet.be) @@ -25,7 +25,6 @@ extern int pcikbd_translate(unsigned char scancode, unsigned char *keycode, char raw_mode); extern char pcikbd_unexpected_up(unsigned char keycode); extern void pcikbd_leds(unsigned char leds); -extern int pcikbd_rate(struct kbd_repeat *rep); extern void pcikbd_init_hw(void); extern unsigned char pcikbd_sysrq_xlate[128]; @@ -34,7 +33,6 @@ extern unsigned char pcikbd_sysrq_xlate[128]; #define kbd_translate pcikbd_translate #define kbd_unexpected_up pcikbd_unexpected_up #define kbd_leds pcikbd_leds -#define kbd_rate pcikbd_rate #define kbd_init_hw pcikbd_init_hw #define kbd_sysrq_xlate pcikbd_sysrq_xlate #define kbd_init pcikbd_init diff --git a/include/asm-sparc64/mmu_context.h b/include/asm-sparc64/mmu_context.h index 357d0e7ef763..c8296b0ce4ff 100644 --- a/include/asm-sparc64/mmu_context.h +++ b/include/asm-sparc64/mmu_context.h @@ -1,24 +1,11 @@ -/* $Id: mmu_context.h,v 1.50 2001/08/13 20:24:34 kanoj Exp $ */ +/* $Id: mmu_context.h,v 1.51 2001/08/17 04:55:09 kanoj Exp $ */ #ifndef __SPARC64_MMU_CONTEXT_H #define __SPARC64_MMU_CONTEXT_H /* Derived heavily from Linus's Alpha/AXP ASN code... */ -#ifndef __ASSEMBLY__ - -#include <linux/spinlock.h> -#include <asm/system.h> -#include <asm/spitfire.h> #include <asm/page.h> -static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu) -{ -} - -extern spinlock_t ctx_alloc_lock; -extern unsigned long tlb_context_cache; -extern unsigned long mmu_context_bmap[]; - /* * For the 8k pagesize kernel, use only 10 hw context bits to optimize some shifts in * the fast tlbmiss handlers, instead of all 13 bits (specifically for vpte offset @@ -28,10 +15,26 @@ extern unsigned long mmu_context_bmap[]; */ #if PAGE_SHIFT == 13 #define CTX_VERSION_SHIFT 10 +#define TAG_CONTEXT_BITS 0x3ff #else #define CTX_VERSION_SHIFT 12 +#define TAG_CONTEXT_BITS 0xfff #endif +#ifndef __ASSEMBLY__ + +#include <linux/spinlock.h> +#include <asm/system.h> +#include <asm/spitfire.h> + +static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu) +{ +} + +extern spinlock_t ctx_alloc_lock; +extern unsigned long tlb_context_cache; +extern unsigned long mmu_context_bmap[]; + #define CTX_VERSION_MASK ((~0UL) << CTX_VERSION_SHIFT) #define CTX_FIRST_VERSION ((1UL << CTX_VERSION_SHIFT) + 1UL) #define CTX_VALID(__ctx) \ diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h index 831339a6d0af..fa0dfb673c09 100644 --- a/include/asm-sparc64/pgalloc.h +++ b/include/asm-sparc64/pgalloc.h @@ -1,4 +1,4 @@ -/* $Id: pgalloc.h,v 1.20 2001/04/26 02:36:36 davem Exp $ */ +/* $Id: pgalloc.h,v 1.21 2001/08/22 22:16:56 kanoj Exp $ */ #ifndef _SPARC64_PGALLOC_H #define _SPARC64_PGALLOC_H @@ -64,7 +64,7 @@ do { if(CTX_VALID((__mm)->context)) \ #define flush_tlb_range(__mm, start, end) \ do { if(CTX_VALID((__mm)->context)) { \ unsigned long __start = (start)&PAGE_MASK; \ - unsigned long __end = (end)&PAGE_MASK; \ + unsigned long __end = PAGE_ALIGN(end); \ __flush_tlb_range(CTX_HWBITS((__mm)->context), __start, \ SECONDARY_CONTEXT, __end, PAGE_SIZE, \ (__end - __start)); \ diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index 3b506d4146ad..acd9ad6494d9 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h @@ -1,4 +1,4 @@ -/* $Id: pgtable.h,v 1.141 2001/08/13 20:24:34 kanoj Exp $ +/* $Id: pgtable.h,v 1.143 2001/08/22 22:16:56 kanoj Exp $ * pgtable.h: SpitFire page table operations. * * Copyright 1996,1997 David S. Miller (davem@caip.rutgers.edu) @@ -18,16 +18,6 @@ #include <asm/system.h> #include <asm/page.h> -#ifndef __ASSEMBLY__ - -#define PG_dcache_dirty PG_arch_1 - -/* Certain architectures need to do special things when pte's - * within a page table are directly modified. Thus, the following - * hook is made available. - */ -#define set_pte(pteptr, pteval) ((*(pteptr)) = (pteval)) - /* XXX All of this needs to be rethought so we can take advantage * XXX cheetah's full 64-bit virtual address space, ie. no more hole * XXX in the middle like on spitfire. -DaveM @@ -55,6 +45,16 @@ #define PGDIR_SIZE (1UL << PGDIR_SHIFT) #define PGDIR_MASK (~(PGDIR_SIZE-1)) +#ifndef __ASSEMBLY__ + +#define PG_dcache_dirty PG_arch_1 + +/* Certain architectures need to do special things when pte's + * within a page table are directly modified. Thus, the following + * hook is made available. + */ +#define set_pte(pteptr, pteval) ((*(pteptr)) = (pteval)) + /* Entries per page directory level. */ #define PTRS_PER_PTE (1UL << (PAGE_SHIFT-3)) @@ -73,9 +73,6 @@ (1) : (PTRS_PER_PGD))) #define FIRST_USER_PGD_NR 0 -#define PTE_TABLE_SIZE 0x2000 /* 1024 entries 8 bytes each */ -#define PMD_TABLE_SIZE 0x2000 /* 2048 entries 4 bytes each */ - /* NOTE: TLB miss handlers depend heavily upon where this is. */ #define VMALLOC_START 0x0000000140000000UL #define VMALLOC_VMADDR(x) ((unsigned long)(x)) diff --git a/include/asm-sparc64/vaddrs.h b/include/asm-sparc64/vaddrs.h deleted file mode 100644 index 04a2656800e0..000000000000 --- a/include/asm-sparc64/vaddrs.h +++ /dev/null @@ -1,22 +0,0 @@ -/* $Id: vaddrs.h,v 1.10 1998/05/14 13:36:01 jj Exp $ */ -#ifndef _SPARC64_VADDRS_H -#define _SPARC64_VADDRS_H - -/* asm-sparc64/vaddrs.h: Here will be define the virtual addresses at - * which important I/O addresses will be mapped. - * For instance the timer register virtual address - * is defined here. - * - * Copyright (C) 1995,1998 David S. Miller (davem@caip.rutgers.edu) - */ - -/* Everything here must be in the first kernel PGD. */ -#define DVMA_VADDR 0x0000000100000000ULL /* Base area of the DVMA on suns */ -#define DVMA_LEN 0x0000000040000000ULL /* Size of the DVMA address space */ -#define DVMA_END 0x0000000140000000ULL -#define MODULES_VADDR 0x0000000001000000ULL /* Where to map modules */ -#define MODULES_LEN 0x000000007f000000ULL -#define MODULES_END 0x0000000080000000ULL - -#endif /* !(_SPARC_VADDRS_H) */ - diff --git a/include/linux/fs.h b/include/linux/fs.h index 574c6377c97d..8d70498784f5 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -89,12 +89,7 @@ extern int leases_enable, dir_notify_enable, lease_break_time; #define FS_NO_PRELIM 4 /* prevent preloading of dentries, even if * FS_NO_DCACHE is not set. */ -#define FS_SINGLE 8 /* - * Filesystem that can have only one superblock; - * kernel-wide vfsmnt is placed in ->kern_mnt by - * kern_mount() which must be called _after_ - * register_filesystem(). - */ +#define FS_SINGLE 8 /* Filesystem that can have only one superblock */ #define FS_NOMOUNT 16 /* Never mount from userland */ #define FS_LITTER 32 /* Keeps the tree in dcache */ #define FS_ODD_RENAME 32768 /* Temporary stuff; will go away as soon @@ -665,6 +660,7 @@ extern struct list_head super_blocks; extern spinlock_t sb_lock; #define sb_entry(list) list_entry((list), struct super_block, s_list) +#define S_BIAS (1<<30) struct super_block { struct list_head s_list; /* Keep this first */ kdev_t s_dev; @@ -688,6 +684,7 @@ struct super_block { struct list_head s_files; struct block_device *s_bdev; + struct list_head s_instances; struct quota_mount_options s_dquot; /* Diskquota specific options */ union { @@ -913,8 +910,8 @@ struct file_system_type { int fs_flags; struct super_block *(*read_super) (struct super_block *, void *, int); struct module *owner; - struct vfsmount *kern_mnt; /* For kernel mount, if it's FS_SINGLE fs */ struct file_system_type * next; + struct list_head fs_supers; }; #define DECLARE_FSTYPE(var,type,read,flags) \ @@ -1147,7 +1144,7 @@ static inline void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode buffer_insert_inode_queue(bh, inode); } -extern void balance_dirty(kdev_t); +extern void balance_dirty(void); extern int check_disk_change(kdev_t); extern int invalidate_inodes(struct super_block *); extern int invalidate_device(kdev_t, int); diff --git a/include/linux/kernel.h b/include/linux/kernel.h index b9fc98184d11..ea28234bd480 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -10,6 +10,7 @@ #include <stdarg.h> #include <linux/linkage.h> #include <linux/stddef.h> +#include <linux/types.h> /* Optimization barrier */ /* The "volatile" is due to gcc bugs */ @@ -61,6 +62,8 @@ extern unsigned long long simple_strtoull(const char *,char **,unsigned int); extern long long simple_strtoll(const char *,char **,unsigned int); extern int sprintf(char * buf, const char * fmt, ...); extern int vsprintf(char *buf, const char *, va_list); +extern int snprintf(char * buf, size_t size, const char *fmt, ...); +extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args); extern int get_option(char **str, int *pint); extern char *get_options(char *str, int nints, int *ints); extern unsigned long long memparse(char *ptr, char **retptr); diff --git a/include/linux/mm.h b/include/linux/mm.h index 48b8dbd14a3c..d4464136cbe7 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -536,17 +536,20 @@ extern struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int); /* Action modifiers - doesn't change the zoning */ #define __GFP_WAIT 0x10 /* Can wait and reschedule? */ #define __GFP_HIGH 0x20 /* Should access emergency pools? */ -#define __GFP_IO 0x40 /* Can start physical IO? */ -#define __GFP_FS 0x80 /* Can call down to low-level FS? */ +#define __GFP_IO 0x40 /* Can start low memory physical IO? */ +#define __GFP_HIGHIO 0x80 /* Can start high mem physical IO? */ +#define __GFP_FS 0x100 /* Can call down to low-level FS? */ +#define GFP_NOHIGHIO (__GFP_HIGH | __GFP_WAIT | __GFP_IO) #define GFP_NOIO (__GFP_HIGH | __GFP_WAIT) -#define GFP_NOFS (__GFP_HIGH | __GFP_WAIT | __GFP_IO) +#define GFP_NOFS (__GFP_HIGH | __GFP_WAIT | __GFP_IO | __GFP_HIGHIO) #define GFP_ATOMIC (__GFP_HIGH) -#define GFP_USER ( __GFP_WAIT | __GFP_IO | __GFP_FS) -#define GFP_HIGHUSER ( __GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HIGHMEM) -#define GFP_KERNEL (__GFP_HIGH | __GFP_WAIT | __GFP_IO | __GFP_FS) -#define GFP_NFS (__GFP_HIGH | __GFP_WAIT | __GFP_IO | __GFP_FS) -#define GFP_KSWAPD ( __GFP_IO | __GFP_FS) +#define GFP_USER ( __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS) +#define GFP_HIGHUSER ( __GFP_WAIT | __GFP_IO | __GFP_HIGHIO \ + | __GFP_FS | __GFP_HIGHMEM) +#define GFP_KERNEL (__GFP_HIGH | __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS) +#define GFP_NFS (__GFP_HIGH | __GFP_WAIT | __GFP_IO | __GFP_HIGHIO | __GFP_FS) +#define GFP_KSWAPD ( __GFP_IO | __GFP_HIGHIO | __GFP_FS) /* Flag - indicates that the buffer will be suitable for DMA. Ignored on some platforms, used as appropriate on others */ diff --git a/include/linux/ntfs_fs.h b/include/linux/ntfs_fs.h index 7b30dd7b0174..cbb865d7b31c 100644 --- a/include/linux/ntfs_fs.h +++ b/include/linux/ntfs_fs.h @@ -1,3 +1,21 @@ #ifndef _LINUX_NTFS_FS_H #define _LINUX_NTFS_FS_H + +#include <asm/byteorder.h> + +#define NTFS_SECTOR_BITS 9 +#define NTFS_SECTOR_SIZE 512 + +/* + * Attribute flags (16-bit). + */ +typedef enum { + ATTR_IS_COMPRESSED = cpu_to_le16(0x0001), + ATTR_COMPRESSION_MASK = cpu_to_le16(0x00ff), /* Compression method + * mask. Also, first + * illegal value. */ + ATTR_IS_ENCRYPTED = cpu_to_le16(0x4000), + ATTR_IS_SPARSE = cpu_to_le16(0x8000), +} __attribute__ ((__packed__)) ATTR_FLAGS; + #endif diff --git a/include/linux/ntfs_fs_i.h b/include/linux/ntfs_fs_i.h index 263aa1a9da45..c532168a9b4f 100644 --- a/include/linux/ntfs_fs_i.h +++ b/include/linux/ntfs_fs_i.h @@ -1,6 +1,8 @@ #ifndef _LINUX_NTFS_FS_I_H #define _LINUX_NTFS_FS_I_H +#include <linux/types.h> + /* Forward declarations, to keep number of mutual includes low */ struct ntfs_attribute; struct ntfs_sb_info; diff --git a/include/linux/ntfs_fs_sb.h b/include/linux/ntfs_fs_sb.h index 6181604ff0e8..e55da3cdec0f 100644 --- a/include/linux/ntfs_fs_sb.h +++ b/include/linux/ntfs_fs_sb.h @@ -1,7 +1,7 @@ #ifndef _LINUX_NTFS_FS_SB_H #define _LINUX_NTFS_FS_SB_H -typedef __s64 LCN; +#include <linux/ntfs_fs_i.h> struct ntfs_sb_info{ /* Configuration provided by user at mount time. */ @@ -10,6 +10,8 @@ struct ntfs_sb_info{ ntmode_t umask; void *nls_map; unsigned int ngt; + char mft_zone_multiplier; + ntfs_cluster_t mft_zone_end; /* Configuration provided by user with the ntfstools. * FIXME: This is no longer possible. What is this good for? (AIA) */ ntfs_size_t partition_bias; /* For access to underlying device. */ @@ -36,7 +38,9 @@ struct ntfs_sb_info{ int index_clusters_per_record; int index_record_size; int index_record_size_bits; - LCN mft_lcn; + ntfs_cluster_t nr_clusters; + ntfs_cluster_t mft_lcn; + ntfs_cluster_t mft_mirr_lcn; /* Data read from special files. */ unsigned char *mft; unsigned short *upcase; diff --git a/include/linux/slab.h b/include/linux/slab.h index e70bf400632c..d5ec05fef003 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -17,13 +17,14 @@ typedef struct kmem_cache_s kmem_cache_t; /* flags for kmem_cache_alloc() */ #define SLAB_NOFS GFP_NOFS #define SLAB_NOIO GFP_NOIO +#define SLAB_NOHIGHIO GFP_NOHIGHIO #define SLAB_ATOMIC GFP_ATOMIC #define SLAB_USER GFP_USER #define SLAB_KERNEL GFP_KERNEL #define SLAB_NFS GFP_NFS #define SLAB_DMA GFP_DMA -#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS) +#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_HIGHIO|__GFP_FS) #define SLAB_NO_GROW 0x00001000UL /* don't grow a cache */ /* flags to pass to kmem_cache_create(). diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index add4ca9d28b1..413f196ad4d2 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -281,6 +281,8 @@ enum NET_TCP_APP_WIN=86, NET_TCP_ADV_WIN_SCALE=87, NET_IPV4_NONLOCAL_BIND=88, + NET_IPV4_ICMP_RATELIMIT=89, + NET_IPV4_ICMP_RATEMASK=90 }; enum { diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index f24e4de6b9ac..0241b41fdc9e 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h @@ -8,6 +8,7 @@ #include <linux/config.h> #include <linux/vt.h> +#include <linux/kd.h> /* * Presently, a lot of graphics programs do not restore the contents of @@ -31,6 +32,7 @@ extern struct vt_struct { } *vt_cons[MAX_NR_CONSOLES]; extern void (*kd_mksound)(unsigned int hz, unsigned int ticks); +extern int (*kbd_rate)(struct kbd_repeat *rep); /* console.c */ |
