diff options
| author | David S. Miller <davem@nuts.davemloft.net> | 2005-01-12 22:50:27 -0800 |
|---|---|---|
| committer | David S. Miller <davem@nuts.davemloft.net> | 2005-01-12 22:50:27 -0800 |
| commit | 0f76379ca92b8aee2771373e55a67f2631529506 (patch) | |
| tree | cee1399116d9051cfd714b4b1c5207929d15e7e9 /include | |
| parent | 240cdcf7cc2bdc55bc13a065dc737efc5e3d54ba (diff) | |
| parent | de10f9d45f6836709d77629cda7ad4e743e32cbe (diff) | |
Merge nuts.davemloft.net:/disk1/BK/network-2.6
into nuts.davemloft.net:/disk1/BK/net-2.6
Diffstat (limited to 'include')
131 files changed, 1926 insertions, 1188 deletions
diff --git a/include/asm-alpha/cputime.h b/include/asm-alpha/cputime.h new file mode 100644 index 000000000000..19577fd93230 --- /dev/null +++ b/include/asm-alpha/cputime.h @@ -0,0 +1,6 @@ +#ifndef __ALPHA_CPUTIME_H +#define __ALPHA_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __ALPHA_CPUTIME_H */ diff --git a/include/asm-alpha/io_trivial.h b/include/asm-alpha/io_trivial.h index cfe1f86c33db..b10d1aa4cdd1 100644 --- a/include/asm-alpha/io_trivial.h +++ b/include/asm-alpha/io_trivial.h @@ -26,7 +26,7 @@ IO_CONCAT(__IO_PREFIX,iowrite8)(u8 b, void __iomem *a) __EXTERN_INLINE void IO_CONCAT(__IO_PREFIX,iowrite16)(u16 b, void __iomem *a) { - __kernel_stb(b, *(volatile u16 __force *)a); + __kernel_stw(b, *(volatile u16 __force *)a); } #endif @@ -66,7 +66,7 @@ IO_CONCAT(__IO_PREFIX,writeb)(u8 b, volatile void __iomem *a) __EXTERN_INLINE void IO_CONCAT(__IO_PREFIX,writew)(u16 b, volatile void __iomem *a) { - __kernel_stb(b, *(volatile u16 __force *)a); + __kernel_stw(b, *(volatile u16 __force *)a); } #elif IO_CONCAT(__IO_PREFIX,trivial_rw_bw) == 2 __EXTERN_INLINE u8 diff --git a/include/asm-arm/arch-pxa/corgi.h b/include/asm-arm/arch-pxa/corgi.h index 9cfd9c47b366..9de52f035ba6 100644 --- a/include/asm-arm/arch-pxa/corgi.h +++ b/include/asm-arm/arch-pxa/corgi.h @@ -15,29 +15,31 @@ /* - * Corgi GPIO definitions + * Corgi (Non Standard) GPIO Definitions */ -#define CORGI_GPIO_KEY_INT (0) /* key interrupt */ +#define CORGI_GPIO_KEY_INT (0) /* Keyboard Interrupt */ #define CORGI_GPIO_AC_IN (1) #define CORGI_GPIO_WAKEUP (3) -#define CORGI_GPIO_AK_INT (4) // Remote Controller -#define CORGI_GPIO_TP_INT (5) /* Touch Panel interrupt */ -#define CORGI_GPIO_nSD_CLK (6) +#define CORGI_GPIO_AK_INT (4) /* IR Controller Interrupt */ +#define CORGI_GPIO_TP_INT (5) /* Touch Panel Interrupt */ #define CORGI_GPIO_nSD_WP (7) -#define CORGI_GPIO_nSD_DETECT (9) +#define CORGI_GPIO_nSD_DETECT (9) /* MMC/SD Card Detect */ #define CORGI_GPIO_nSD_INT (10) #define CORGI_GPIO_MAIN_BAT_LOW (11) #define CORGI_GPIO_BAT_COVER (11) #define CORGI_GPIO_LED_ORANGE (13) -#define CORGI_GPIO_CF_CD (14) +#define CORGI_GPIO_CF_CD (14) /* Compact Flash Card Detect */ #define CORGI_GPIO_CHRG_FULL (16) -#define CORGI_GPIO_CF_IRQ (17) +#define CORGI_GPIO_CF_IRQ (17) /* Compact Flash Interrupt */ +#define CORGI_GPIO_LCDCON_CS (19) /* LCD Control Chip Select */ +#define CORGI_GPIO_MAX1111_CS (20) /* MAX111 Chip Select */ #define CORGI_GPIO_ADC_TEMP_ON (21) #define CORGI_GPIO_IR_ON (22) -#define CORGI_GPIO_SD_PWR (33) +#define CORGI_GPIO_ADS7846_CS (24) /* ADS7846 Chip Select */ +#define CORGI_GPIO_SD_PWR (33) /* MMC/SD Power */ #define CORGI_GPIO_CHRG_ON (38) #define CORGI_GPIO_DISCHARGE_ON (42) -#define CORGI_GPIO_HSYNC (44) +#define CORGI_GPIO_HSYNC (44) /* LCD HSync Pulse */ #define CORGI_GPIO_USB_PULLUP (45) diff --git a/include/asm-arm/cpu.h b/include/asm-arm/cpu.h index 0f99a8881a8b..fcbdd40cb667 100644 --- a/include/asm-arm/cpu.h +++ b/include/asm-arm/cpu.h @@ -17,7 +17,6 @@ struct cpuinfo_arm { struct cpu cpu; #ifdef CONFIG_SMP unsigned int loops_per_jiffy; - unsigned long ipi_count; #endif }; diff --git a/include/asm-arm/cputime.h b/include/asm-arm/cputime.h new file mode 100644 index 000000000000..3a8002a5fec7 --- /dev/null +++ b/include/asm-arm/cputime.h @@ -0,0 +1,6 @@ +#ifndef __ARM_CPUTIME_H +#define __ARM_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __ARM_CPUTIME_H */ diff --git a/include/asm-arm/mach/irq.h b/include/asm-arm/mach/irq.h index c6ae545e4237..a43a353f6c7b 100644 --- a/include/asm-arm/mach/irq.h +++ b/include/asm-arm/mach/irq.h @@ -47,6 +47,13 @@ struct irqchip { * Set wakeup-enable on the selected IRQ */ int (*wake)(unsigned int, unsigned int); + +#ifdef CONFIG_SMP + /* + * Route an interrupt to a CPU + */ + void (*set_cpu)(struct irqdesc *desc, unsigned int irq, unsigned int cpu); +#endif }; struct irqdesc { @@ -67,6 +74,13 @@ struct irqdesc { unsigned int noautoenable : 1; /* don't automatically enable IRQ */ unsigned int unused :25; + struct proc_dir_entry *procdir; + +#ifdef CONFIG_SMP + cpumask_t affinity; + unsigned int cpu; +#endif + /* * IRQ lock detection */ diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h index 06ab5f106a0f..4a9845997a75 100644 --- a/include/asm-arm/processor.h +++ b/include/asm-arm/processor.h @@ -19,7 +19,6 @@ #ifdef __KERNEL__ -#include <asm/atomic.h> #include <asm/ptrace.h> #include <asm/procinfo.h> #include <asm/types.h> diff --git a/include/asm-arm/smp.h b/include/asm-arm/smp.h index 0b012dfc098a..f21fd8f6bcdd 100644 --- a/include/asm-arm/smp.h +++ b/include/asm-arm/smp.h @@ -32,6 +32,13 @@ extern cpumask_t cpu_present_mask; */ #define PROC_CHANGE_PENALTY 15 +struct seq_file; + +/* + * generate IPI list text + */ +extern void show_ipi_list(struct seq_file *p); + /* * Move global data into per-processor storage. */ @@ -46,6 +53,6 @@ extern void smp_cross_call(cpumask_t callmap); * Boot a secondary CPU, and assign it the specified idle task. * This also gives us the initial stack to use for this CPU. */ -extern int __init boot_secondary(unsigned int cpu, struct task_struct *); +extern int boot_secondary(unsigned int cpu, struct task_struct *); #endif /* ifndef __ASM_ARM_SMP_H */ diff --git a/include/asm-arm/tlb.h b/include/asm-arm/tlb.h index ab3cad4fb53d..0843a876b3ce 100644 --- a/include/asm-arm/tlb.h +++ b/include/asm-arm/tlb.h @@ -91,4 +91,6 @@ tlb_is_full_mm(struct mmu_gather *tlb) #define pte_free_tlb(tlb,ptep) pte_free(ptep) #define pmd_free_tlb(tlb,pmdp) pmd_free(pmdp) +#define tlb_migrate_finish(mm) do { } while (0) + #endif diff --git a/include/asm-arm26/cputime.h b/include/asm-arm26/cputime.h new file mode 100644 index 000000000000..d2783a9e47b3 --- /dev/null +++ b/include/asm-arm26/cputime.h @@ -0,0 +1,6 @@ +#ifndef __ARM26_CPUTIME_H +#define __ARM26_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __ARM26_CPUTIME_H */ diff --git a/include/asm-cris/cputime.h b/include/asm-cris/cputime.h new file mode 100644 index 000000000000..4446a65656fa --- /dev/null +++ b/include/asm-cris/cputime.h @@ -0,0 +1,6 @@ +#ifndef __CRIS_CPUTIME_H +#define __CRIS_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __CRIS_CPUTIME_H */ diff --git a/include/asm-generic/cputime.h b/include/asm-generic/cputime.h new file mode 100644 index 000000000000..c9968a09f8ab --- /dev/null +++ b/include/asm-generic/cputime.h @@ -0,0 +1,64 @@ +#ifndef _ASM_GENERIC_CPUTIME_H +#define _ASM_GENERIC_CPUTIME_H + +#include <linux/time.h> +#include <linux/jiffies.h> + +typedef unsigned long cputime_t; + +#define cputime_zero (0UL) +#define cputime_max ((~0UL >> 1) - 1) +#define cputime_add(__a, __b) ((__a) + (__b)) +#define cputime_sub(__a, __b) ((__a) - (__b)) +#define cputime_eq(__a, __b) ((__a) == (__b)) +#define cputime_gt(__a, __b) ((__a) > (__b)) +#define cputime_ge(__a, __b) ((__a) >= (__b)) +#define cputime_lt(__a, __b) ((__a) < (__b)) +#define cputime_le(__a, __b) ((__a) <= (__b)) +#define cputime_to_jiffies(__ct) (__ct) +#define jiffies_to_cputime(__hz) (__hz) + +typedef u64 cputime64_t; + +#define cputime64_zero (0ULL) +#define cputime64_add(__a, __b) ((__a) + (__b)) +#define cputime64_to_jiffies64(__ct) (__ct) +#define cputime_to_cputime64(__ct) ((u64) __ct) + + +/* + * Convert cputime to milliseconds and back. + */ +#define cputime_to_msecs(__ct) jiffies_to_msecs(__ct) +#define msecs_to_cputime(__msecs) msecs_to_jiffies(__msecs) + +/* + * Convert cputime to seconds and back. + */ +#define cputime_to_secs(__ct) (jiffies_to_msecs(__ct) / HZ) +#define secs_to_cputime(__secs) (msecs_to_jiffies(__secs * HZ)) + +/* + * Convert cputime to timespec and back. + */ +#define timespec_to_cputime(__val) timespec_to_jiffies(__val) +#define cputime_to_timespec(__ct,__val) jiffies_to_timespec(__ct,__val) + +/* + * Convert cputime to timeval and back. + */ +#define timeval_to_cputime(__val) timeval_to_jiffies(__val) +#define cputime_to_timeval(__ct,__val) jiffies_to_timeval(__ct,__val) + +/* + * Convert cputime to clock and back. + */ +#define cputime_to_clock_t(__ct) jiffies_to_clock_t(__ct) +#define clock_t_to_cputime(__x) clock_t_to_jiffies(__x) + +/* + * Convert cputime64 to clock. + */ +#define cputime64_to_clock_t(__ct) jiffies_64_to_clock_t(__ct) + +#endif diff --git a/include/asm-h8300/cputime.h b/include/asm-h8300/cputime.h new file mode 100644 index 000000000000..092e187c7b08 --- /dev/null +++ b/include/asm-h8300/cputime.h @@ -0,0 +1,6 @@ +#ifndef __H8300_CPUTIME_H +#define __H8300_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __H8300_CPUTIME_H */ diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h index fdbd65ca669e..e147cabd3bfe 100644 --- a/include/asm-i386/cpufeature.h +++ b/include/asm-i386/cpufeature.h @@ -9,7 +9,7 @@ #include <linux/bitops.h> -#define NCAPINTS 6 /* Currently we have 6 32-bit words worth of info */ +#define NCAPINTS 7 /* N 32-bit words worth of info */ /* Intel-defined CPU features, CPUID level 0x00000001 (edx), word 0 */ #define X86_FEATURE_FPU (0*32+ 0) /* Onboard FPU */ @@ -77,6 +77,7 @@ #define X86_FEATURE_EST (4*32+ 7) /* Enhanced SpeedStep */ #define X86_FEATURE_TM2 (4*32+ 8) /* Thermal Monitor 2 */ #define X86_FEATURE_CID (4*32+10) /* Context ID */ +#define X86_FEATURE_CX16 (4*32+13) /* CMPXCHG16B */ #define X86_FEATURE_XTPR (4*32+14) /* Send Task Priority Messages */ /* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */ @@ -85,6 +86,9 @@ #define X86_FEATURE_XCRYPT (5*32+ 6) /* on-CPU crypto (xcrypt insn) */ #define X86_FEATURE_XCRYPT_EN (5*32+ 7) /* on-CPU crypto enabled */ +/* More extended AMD flags: CPUID level 0x80000001, ecx, word 6 */ +#define X86_FEATURE_LAHF_LM (5*32+ 0) /* LAHF/SAHF in long mode */ +#define X86_FEATURE_CMP_LEGACY (5*32+ 1) /* If yes HyperThreading not valid */ #define cpu_has(c, bit) test_bit(bit, (c)->x86_capability) #define boot_cpu_has(bit) test_bit(bit, boot_cpu_data.x86_capability) diff --git a/include/asm-i386/cputime.h b/include/asm-i386/cputime.h new file mode 100644 index 000000000000..398ed7cd171d --- /dev/null +++ b/include/asm-i386/cputime.h @@ -0,0 +1,6 @@ +#ifndef __I386_CPUTIME_H +#define __I386_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __I386_CPUTIME_H */ diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 0d4e4acc3b12..70a48f509d24 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h @@ -65,6 +65,7 @@ struct cpuinfo_x86 { int f00f_bug; int coma_bug; unsigned long loops_per_jiffy; + unsigned char x86_num_cores; } __attribute__((__aligned__(SMP_CACHE_BYTES))); #define X86_VENDOR_INTEL 0 @@ -96,6 +97,7 @@ extern struct cpuinfo_x86 cpu_data[]; #define current_cpu_data boot_cpu_data #endif +extern int phys_proc_id[NR_CPUS]; extern char ignore_fpu_irq; extern void identify_cpu(struct cpuinfo_x86 *); @@ -103,6 +105,12 @@ extern void print_cpu_info(struct cpuinfo_x86 *); extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); extern void dodgy_tsc(void); +#ifdef CONFIG_X86_HT +extern void detect_ht(struct cpuinfo_x86 *c); +#else +static inline void detect_ht(struct cpuinfo_x86 *c) {} +#endif + /* * EFLAGS bits */ diff --git a/include/asm-ia64/cputime.h b/include/asm-ia64/cputime.h new file mode 100644 index 000000000000..72400a78002a --- /dev/null +++ b/include/asm-ia64/cputime.h @@ -0,0 +1,6 @@ +#ifndef __IA64_CPUTIME_H +#define __IA64_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __IA64_CPUTIME_H */ diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h index 0749f1a1454e..8ef0f02635d4 100644 --- a/include/asm-ia64/machvec.h +++ b/include/asm-ia64/machvec.h @@ -20,6 +20,7 @@ struct scatterlist; struct irq_desc; struct page; struct mm_struct; +struct pci_bus; typedef void ia64_mv_setup_t (char **); typedef void ia64_mv_cpu_init_t (void); @@ -31,6 +32,11 @@ typedef void ia64_mv_tlb_migrate_finish_t (struct mm_struct *); typedef struct irq_desc *ia64_mv_irq_desc (unsigned int); typedef u8 ia64_mv_irq_to_vector (unsigned int); typedef unsigned int ia64_mv_local_vector_to_irq (u8); +typedef char *ia64_mv_pci_get_legacy_mem_t (struct pci_bus *); +typedef int ia64_mv_pci_legacy_read_t (struct pci_bus *, u16 port, u32 *val, + u8 size); +typedef int ia64_mv_pci_legacy_write_t (struct pci_bus *, u16 port, u32 val, + u8 size); /* DMA-mapping interface: */ typedef void ia64_mv_dma_init (void); @@ -94,6 +100,8 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *); # include <asm/machvec_dig.h> # elif defined (CONFIG_IA64_HP_ZX1) # include <asm/machvec_hpzx1.h> +# elif defined (CONFIG_IA64_HP_ZX1_SWIOTLB) +# include <asm/machvec_hpzx1_swiotlb.h> # elif defined (CONFIG_IA64_SGI_SN2) # include <asm/machvec_sn2.h> # elif defined (CONFIG_IA64_GENERIC) @@ -125,6 +133,9 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *); # define platform_irq_desc ia64_mv.irq_desc # define platform_irq_to_vector ia64_mv.irq_to_vector # define platform_local_vector_to_irq ia64_mv.local_vector_to_irq +# define platform_pci_get_legacy_mem ia64_mv.pci_get_legacy_mem +# define platform_pci_legacy_read ia64_mv.pci_legacy_read +# define platform_pci_legacy_write ia64_mv.pci_legacy_write # define platform_inb ia64_mv.inb # define platform_inw ia64_mv.inw # define platform_inl ia64_mv.inl @@ -172,6 +183,9 @@ struct ia64_machine_vector { ia64_mv_irq_desc *irq_desc; ia64_mv_irq_to_vector *irq_to_vector; ia64_mv_local_vector_to_irq *local_vector_to_irq; + ia64_mv_pci_get_legacy_mem_t *pci_get_legacy_mem; + ia64_mv_pci_legacy_read_t *pci_legacy_read; + ia64_mv_pci_legacy_write_t *pci_legacy_write; ia64_mv_inb_t *inb; ia64_mv_inw_t *inw; ia64_mv_inl_t *inl; @@ -215,6 +229,9 @@ struct ia64_machine_vector { platform_irq_desc, \ platform_irq_to_vector, \ platform_local_vector_to_irq, \ + platform_pci_get_legacy_mem, \ + platform_pci_legacy_read, \ + platform_pci_legacy_write, \ platform_inb, \ platform_inw, \ platform_inl, \ @@ -330,6 +347,15 @@ extern ia64_mv_dma_supported swiotlb_dma_supported; #ifndef platform_local_vector_to_irq # define platform_local_vector_to_irq __ia64_local_vector_to_irq #endif +#ifndef platform_pci_get_legacy_mem +# define platform_pci_get_legacy_mem ia64_pci_get_legacy_mem +#endif +#ifndef platform_pci_legacy_read +# define platform_pci_legacy_read ia64_pci_legacy_read +#endif +#ifndef platform_pci_legacy_write +# define platform_pci_legacy_write ia64_pci_legacy_write +#endif #ifndef platform_inb # define platform_inb __ia64_inb #endif diff --git a/include/asm-ia64/machvec_hpzx1_swiotlb.h b/include/asm-ia64/machvec_hpzx1_swiotlb.h new file mode 100644 index 000000000000..9924b1b00a6c --- /dev/null +++ b/include/asm-ia64/machvec_hpzx1_swiotlb.h @@ -0,0 +1,43 @@ +#ifndef _ASM_IA64_MACHVEC_HPZX1_SWIOTLB_h +#define _ASM_IA64_MACHVEC_HPZX1_SWIOTLB_h + +extern ia64_mv_setup_t dig_setup; +extern ia64_mv_dma_init hwsw_init; +extern ia64_mv_dma_alloc_coherent hwsw_alloc_coherent; +extern ia64_mv_dma_free_coherent hwsw_free_coherent; +extern ia64_mv_dma_map_single hwsw_map_single; +extern ia64_mv_dma_unmap_single hwsw_unmap_single; +extern ia64_mv_dma_map_sg hwsw_map_sg; +extern ia64_mv_dma_unmap_sg hwsw_unmap_sg; +extern ia64_mv_dma_supported hwsw_dma_supported; +extern ia64_mv_dma_mapping_error hwsw_dma_mapping_error; +extern ia64_mv_dma_sync_single_for_cpu hwsw_sync_single_for_cpu; +extern ia64_mv_dma_sync_sg_for_cpu hwsw_sync_sg_for_cpu; +extern ia64_mv_dma_sync_single_for_device hwsw_sync_single_for_device; +extern ia64_mv_dma_sync_sg_for_device hwsw_sync_sg_for_device; + +/* + * This stuff has dual use! + * + * For a generic kernel, the macros are used to initialize the + * platform's machvec structure. When compiling a non-generic kernel, + * the macros are used directly. + */ +#define platform_name "hpzx1_swiotlb" + +#define platform_setup dig_setup +#define platform_dma_init hwsw_init +#define platform_dma_alloc_coherent hwsw_alloc_coherent +#define platform_dma_free_coherent hwsw_free_coherent +#define platform_dma_map_single hwsw_map_single +#define platform_dma_unmap_single hwsw_unmap_single +#define platform_dma_map_sg hwsw_map_sg +#define platform_dma_unmap_sg hwsw_unmap_sg +#define platform_dma_supported hwsw_dma_supported +#define platform_dma_mapping_error hwsw_dma_mapping_error +#define platform_dma_sync_single_for_cpu hwsw_sync_single_for_cpu +#define platform_dma_sync_sg_for_cpu hwsw_sync_sg_for_cpu +#define platform_dma_sync_single_for_device hwsw_sync_single_for_device +#define platform_dma_sync_sg_for_device hwsw_sync_sg_for_device + +#endif /* _ASM_IA64_MACHVEC_HPZX1_SWIOTLB_h */ diff --git a/include/asm-ia64/machvec_init.h b/include/asm-ia64/machvec_init.h index 0d7386a13422..cb19becd3937 100644 --- a/include/asm-ia64/machvec_init.h +++ b/include/asm-ia64/machvec_init.h @@ -5,6 +5,9 @@ extern ia64_mv_global_tlb_purge_t ia64_global_tlb_purge; extern ia64_mv_irq_desc __ia64_irq_desc; extern ia64_mv_irq_to_vector __ia64_irq_to_vector; extern ia64_mv_local_vector_to_irq __ia64_local_vector_to_irq; +extern ia64_mv_pci_get_legacy_mem_t ia64_pci_get_legacy_mem; +extern ia64_mv_pci_legacy_read_t ia64_pci_legacy_read; +extern ia64_mv_pci_legacy_write_t ia64_pci_legacy_write; extern ia64_mv_inb_t __ia64_inb; extern ia64_mv_inw_t __ia64_inw; diff --git a/include/asm-ia64/machvec_sn2.h b/include/asm-ia64/machvec_sn2.h index 299a57f83f29..bd0ed509a4cc 100644 --- a/include/asm-ia64/machvec_sn2.h +++ b/include/asm-ia64/machvec_sn2.h @@ -43,6 +43,9 @@ extern ia64_mv_tlb_migrate_finish_t sn_tlb_migrate_finish; extern ia64_mv_irq_desc sn_irq_desc; extern ia64_mv_irq_to_vector sn_irq_to_vector; extern ia64_mv_local_vector_to_irq sn_local_vector_to_irq; +extern ia64_mv_pci_get_legacy_mem_t sn_pci_get_legacy_mem; +extern ia64_mv_pci_legacy_read_t sn_pci_legacy_read; +extern ia64_mv_pci_legacy_write_t sn_pci_legacy_write; extern ia64_mv_inb_t __sn_inb; extern ia64_mv_inw_t __sn_inw; extern ia64_mv_inl_t __sn_inl; @@ -105,6 +108,9 @@ extern ia64_mv_dma_supported sn_dma_supported; #define platform_irq_desc sn_irq_desc #define platform_irq_to_vector sn_irq_to_vector #define platform_local_vector_to_irq sn_local_vector_to_irq +#define platform_pci_get_legacy_mem sn_pci_get_legacy_mem +#define platform_pci_legacy_read sn_pci_legacy_read +#define platform_pci_legacy_write sn_pci_legacy_write #define platform_dma_init machvec_noop #define platform_dma_alloc_coherent sn_dma_alloc_coherent #define platform_dma_free_coherent sn_dma_free_coherent diff --git a/include/asm-ia64/numnodes.h b/include/asm-ia64/numnodes.h index 4fed3ac3c442..21cff4da5485 100644 --- a/include/asm-ia64/numnodes.h +++ b/include/asm-ia64/numnodes.h @@ -4,7 +4,7 @@ #ifdef CONFIG_IA64_DIG /* Max 8 Nodes */ #define NODES_SHIFT 3 -#elif defined(CONFIG_IA64_HP_ZX1) +#elif defined(CONFIG_IA64_HP_ZX1) || defined(CONFIG_IA64_HP_ZX1_SWIOTLB) /* Max 32 Nodes */ #define NODES_SHIFT 5 #elif defined(CONFIG_IA64_SGI_SN2) || defined(CONFIG_IA64_GENERIC) diff --git a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h index 898f4eca65b5..48e565fb5e0f 100644 --- a/include/asm-ia64/pci.h +++ b/include/asm-ia64/pci.h @@ -85,6 +85,20 @@ extern int pcibios_prep_mwi (struct pci_dev *); #define HAVE_PCI_MMAP extern int pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma, enum pci_mmap_state mmap_state, int write_combine); +#define HAVE_PCI_LEGACY +extern int pci_mmap_legacy_page_range(struct pci_bus *bus, + struct vm_area_struct *vma); +extern ssize_t pci_read_legacy_io(struct kobject *kobj, char *buf, loff_t off, + size_t count); +extern ssize_t pci_write_legacy_io(struct kobject *kobj, char *buf, loff_t off, + size_t count); +extern int pci_mmap_legacy_mem(struct kobject *kobj, + struct bin_attribute *attr, + struct vm_area_struct *vma); + +#define pci_get_legacy_mem platform_pci_get_legacy_mem +#define pci_legacy_read platform_pci_legacy_read +#define pci_legacy_write platform_pci_legacy_write struct pci_window { struct resource resource; diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h index 51485f7d66a8..347bbe6a0af0 100644 --- a/include/asm-ia64/sn/sn_sal.h +++ b/include/asm-ia64/sn/sn_sal.h @@ -203,7 +203,7 @@ ia64_sn_get_master_baseio_nasid(void) return ret_stuff.v0; } -static inline u64 +static inline char * ia64_sn_get_klconfig_addr(nasid_t nasid) { struct ia64_sal_retval ret_stuff; @@ -223,7 +223,7 @@ ia64_sn_get_klconfig_addr(nasid_t nasid) if (ret_stuff.status != 0) { panic("ia64_sn_get_klconfig_addr: Returned error %lx\n", ret_stuff.status); } - return(ret_stuff.v0); + return ret_stuff.v0 ? __va(ret_stuff.v0) : NULL; } /* @@ -474,6 +474,52 @@ ia64_sn_pod_mode(void) return isrv.v0; } +/** + * ia64_sn_probe_mem - read from memory safely + * @addr: address to probe + * @size: number bytes to read (1,2,4,8) + * @data_ptr: address to store value read by probe (-1 returned if probe fails) + * + * Call into the SAL to do a memory read. If the read generates a machine + * check, this routine will recover gracefully and return -1 to the caller. + * @addr is usually a kernel virtual address in uncached space (i.e. the + * address starts with 0xc), but if called in physical mode, @addr should + * be a physical address. + * + * Return values: + * 0 - probe successful + * 1 - probe failed (generated MCA) + * 2 - Bad arg + * <0 - PAL error + */ +static inline u64 +ia64_sn_probe_mem(long addr, long size, void *data_ptr) +{ + struct ia64_sal_retval isrv; + + SAL_CALL(isrv, SN_SAL_PROBE, addr, size, 0, 0, 0, 0, 0); + + if (data_ptr) { + switch (size) { + case 1: + *((u8*)data_ptr) = (u8)isrv.v0; + break; + case 2: + *((u16*)data_ptr) = (u16)isrv.v0; + break; + case 4: + *((u32*)data_ptr) = (u32)isrv.v0; + break; + case 8: + *((u64*)data_ptr) = (u64)isrv.v0; + break; + default: + isrv.status = 2; + } + } + return isrv.status; +} + /* * Retrieve the system serial number as an ASCII string. */ diff --git a/include/asm-m32r/cputime.h b/include/asm-m32r/cputime.h new file mode 100644 index 000000000000..0a47550df2b7 --- /dev/null +++ b/include/asm-m32r/cputime.h @@ -0,0 +1,6 @@ +#ifndef __M32R_CPUTIME_H +#define __M32R_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __M32R_CPUTIME_H */ diff --git a/include/asm-m32r/unistd.h b/include/asm-m32r/unistd.h index a506573b7b69..f71dfa15db74 100644 --- a/include/asm-m32r/unistd.h +++ b/include/asm-m32r/unistd.h @@ -25,26 +25,26 @@ #define __NR_time 13 #define __NR_mknod 14 #define __NR_chmod 15 -#define __NR_lchown 16 -#define __NR_break 17 -#define __NR_oldstat 18 +/* 16 is unused */ +/* 17 is unused */ +/* 18 is unused */ #define __NR_lseek 19 #define __NR_getpid 20 #define __NR_mount 21 #define __NR_umount 22 -#define __NR_setuid 23 -#define __NR_getuid 24 +/* 23 is unused */ +/* 24 is unused */ #define __NR_stime 25 #define __NR_ptrace 26 #define __NR_alarm 27 -#define __NR_oldfstat 28 +/* 28 is unused */ #define __NR_pause 29 #define __NR_utime 30 -#define __NR_cacheflush 31 /* old #define __NR_stty 31*/ +/* 31 is unused */ #define __NR_cachectl 32 /* old #define __NR_gtty 32*/ #define __NR_access 33 -#define __NR_nice 34 -#define __NR_ftime 35 +/* 34 is unused */ +/* 35 is unused */ #define __NR_sync 36 #define __NR_kill 37 #define __NR_rename 38 @@ -53,22 +53,22 @@ #define __NR_dup 41 #define __NR_pipe 42 #define __NR_times 43 -#define __NR_prof 44 +/* 44 is unused */ #define __NR_brk 45 -#define __NR_setgid 46 -#define __NR_getgid 47 -#define __NR_signal 48 -#define __NR_geteuid 49 -#define __NR_getegid 50 +/* 46 is unused */ +/* 47 is unused (getgid16) */ +/* 48 is unused */ +/* 49 is unused */ +/* 50 is unused */ #define __NR_acct 51 #define __NR_umount2 52 -#define __NR_lock 53 +/* 53 is unused */ #define __NR_ioctl 54 -#define __NR_fcntl 55 -#define __NR_mpx 56 +/* 55 is unused (fcntl) */ +/* 56 is unused */ #define __NR_setpgid 57 -#define __NR_ulimit 58 -#define __NR_oldolduname 59 +/* 58 is unused */ +/* 59 is unused */ #define __NR_umask 60 #define __NR_chroot 61 #define __NR_ustat 62 @@ -76,41 +76,41 @@ #define __NR_getppid 64 #define __NR_getpgrp 65 #define __NR_setsid 66 -#define __NR_sigaction 67 -#define __NR_sgetmask 68 -#define __NR_ssetmask 69 -#define __NR_setreuid 70 -#define __NR_setregid 71 -#define __NR_sigsuspend 72 -#define __NR_sigpending 73 +/* 67 is unused */ +/* 68 is unused*/ +/* 69 is unused*/ +/* 70 is unused */ +/* 71 is unused */ +/* 72 is unused */ +/* 73 is unused */ #define __NR_sethostname 74 #define __NR_setrlimit 75 -#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */ +/* 76 is unused (old getrlimit) */ #define __NR_getrusage 77 #define __NR_gettimeofday 78 #define __NR_settimeofday 79 -#define __NR_getgroups 80 -#define __NR_setgroups 81 -#define __NR_select 82 +/* 80 is unused */ +/* 81 is unused */ +/* 82 is unused */ #define __NR_symlink 83 -#define __NR_oldlstat 84 +/* 84 is unused */ #define __NR_readlink 85 #define __NR_uselib 86 #define __NR_swapon 87 #define __NR_reboot 88 -#define __NR_readdir 89 -#define __NR_mmap 90 +/* 89 is unused */ +/* 90 is unused */ #define __NR_munmap 91 #define __NR_truncate 92 #define __NR_ftruncate 93 #define __NR_fchmod 94 -#define __NR_fchown 95 +/* 95 is unused */ #define __NR_getpriority 96 #define __NR_setpriority 97 -#define __NR_profil 98 +/* 98 is unused */ #define __NR_statfs 99 #define __NR_fstatfs 100 -#define __NR_ioperm 101 +/* 101 is unused */ #define __NR_socketcall 102 #define __NR_syslog 103 #define __NR_setitimer 104 @@ -118,37 +118,37 @@ #define __NR_stat 106 #define __NR_lstat 107 #define __NR_fstat 108 -#define __NR_olduname 109 -#define __NR_iopl 110 +/* 109 is unused */ +/* 110 is unused */ #define __NR_vhangup 111 -#define __NR_idle 112 -#define __NR_vm86old 113 +/* 112 is unused */ +/* 113 is unused */ #define __NR_wait4 114 #define __NR_swapoff 115 #define __NR_sysinfo 116 #define __NR_ipc 117 #define __NR_fsync 118 -#define __NR_sigreturn 119 +/* 119 is unused */ #define __NR_clone 120 #define __NR_setdomainname 121 #define __NR_uname 122 -#define __NR_modify_ldt 123 +/* 123 is unused */ #define __NR_adjtimex 124 #define __NR_mprotect 125 -#define __NR_sigprocmask 126 -#define __NR_create_module 127 +/* 126 is unused */ +/* 127 is unused */ #define __NR_init_module 128 #define __NR_delete_module 129 -#define __NR_get_kernel_syms 130 +/* 130 is unused */ #define __NR_quotactl 131 #define __NR_getpgid 132 #define __NR_fchdir 133 #define __NR_bdflush 134 #define __NR_sysfs 135 #define __NR_personality 136 -#define __NR_afs_syscall 137 /* Syscall for Andrew File System */ -#define __NR_setfsuid 138 -#define __NR_setfsgid 139 +/* 137 is unused */ +/* 138 is unused */ +/* 139 is unused */ #define __NR__llseek 140 #define __NR_getdents 141 #define __NR__newselect 142 @@ -173,14 +173,14 @@ #define __NR_sched_rr_get_interval 161 #define __NR_nanosleep 162 #define __NR_mremap 163 -#define __NR_setresuid 164 -#define __NR_getresuid 165 +/* 164 is unused */ +/* 165 is unused */ #define __NR_tas 166 -#define __NR_query_module 167 +/* 167 is unused */ #define __NR_poll 168 #define __NR_nfsservctl 169 -#define __NR_setresgid 170 -#define __NR_getresgid 171 +/* 170 is unused */ +/* 171 is unused */ #define __NR_prctl 172 #define __NR_rt_sigreturn 173 #define __NR_rt_sigaction 174 @@ -191,14 +191,14 @@ #define __NR_rt_sigsuspend 179 #define __NR_pread64 180 #define __NR_pwrite64 181 -#define __NR_chown 182 +/* 182 is unused */ #define __NR_getcwd 183 #define __NR_capget 184 #define __NR_capset 185 #define __NR_sigaltstack 186 #define __NR_sendfile 187 -#define __NR_getpmsg 188 /* some people actually want streams */ -#define __NR_putpmsg 189 /* some people actually want streams */ +/* 188 is unused */ +/* 189 is unused */ #define __NR_vfork 190 #define __NR_ugetrlimit 191 /* SuS compliant getrlimit */ #define __NR_mmap2 192 @@ -229,71 +229,71 @@ #define __NR_pivot_root 217 #define __NR_mincore 218 #define __NR_madvise 219 -#define __NR_madvise1 219 /* delete when C lib stub is removed */ #define __NR_getdents64 220 #define __NR_fcntl64 221 -#define __NR_security 223 /* syscall for security modules */ -#define __NR_gettid 224 -#define __NR_readahead 225 -#define __NR_setxattr 226 -#define __NR_lsetxattr 227 -#define __NR_fsetxattr 228 -#define __NR_getxattr 229 -#define __NR_lgetxattr 230 -#define __NR_fgetxattr 231 -#define __NR_listxattr 232 -#define __NR_llistxattr 233 -#define __NR_flistxattr 234 -#define __NR_removexattr 235 -#define __NR_lremovexattr 236 -#define __NR_fremovexattr 237 +/* 222 is unused */ +/* 223 is unused */ +#define __NR_gettid 224 +#define __NR_readahead 225 +#define __NR_setxattr 226 +#define __NR_lsetxattr 227 +#define __NR_fsetxattr 228 +#define __NR_getxattr 229 +#define __NR_lgetxattr 230 +#define __NR_fgetxattr 231 +#define __NR_listxattr 232 +#define __NR_llistxattr 233 +#define __NR_flistxattr 234 +#define __NR_removexattr 235 +#define __NR_lremovexattr 236 +#define __NR_fremovexattr 237 #define __NR_tkill 238 #define __NR_sendfile64 239 #define __NR_futex 240 #define __NR_sched_setaffinity 241 #define __NR_sched_getaffinity 242 -#define __NR_set_thread_area 243 -#define __NR_get_thread_area 244 -#define __NR_io_setup 245 -#define __NR_io_destroy 246 -#define __NR_io_getevents 247 -#define __NR_io_submit 248 -#define __NR_io_cancel 249 -#define __NR_fadvise64 250 - -#define __NR_exit_group 252 -#define __NR_lookup_dcookie 253 -#define __NR_epoll_create 254 -#define __NR_epoll_ctl 255 -#define __NR_epoll_wait 256 -#define __NR_remap_file_pages 257 -#define __NR_set_tid_address 258 -#define __NR_timer_create 259 -#define __NR_timer_settime (__NR_timer_create+1) -#define __NR_timer_gettime (__NR_timer_create+2) -#define __NR_timer_getoverrun (__NR_timer_create+3) -#define __NR_timer_delete (__NR_timer_create+4) -#define __NR_clock_settime (__NR_timer_create+5) -#define __NR_clock_gettime (__NR_timer_create+6) -#define __NR_clock_getres (__NR_timer_create+7) -#define __NR_clock_nanosleep (__NR_timer_create+8) -#define __NR_statfs64 268 -#define __NR_fstatfs64 269 -#define __NR_tgkill 270 -#define __NR_utimes 271 -#define __NR_fadvise64_64 272 -#define __NR_vserver 273 -#define __NR_mbind 274 -#define __NR_get_mempolicy 275 -#define __NR_set_mempolicy 276 -#define __NR_mq_open 277 -#define __NR_mq_unlink (__NR_mq_open+1) -#define __NR_mq_timedsend (__NR_mq_open+2) -#define __NR_mq_timedreceive (__NR_mq_open+3) -#define __NR_mq_notify (__NR_mq_open+4) -#define __NR_mq_getsetattr (__NR_mq_open+5) -#define __NR_sys_kexec_load 283 -#define __NR_waitid 284 +#define __NR_set_thread_area 243 +#define __NR_get_thread_area 244 +#define __NR_io_setup 245 +#define __NR_io_destroy 246 +#define __NR_io_getevents 247 +#define __NR_io_submit 248 +#define __NR_io_cancel 249 +#define __NR_fadvise64 250 +/* 251 is unused */ +#define __NR_exit_group 252 +#define __NR_lookup_dcookie 253 +#define __NR_epoll_create 254 +#define __NR_epoll_ctl 255 +#define __NR_epoll_wait 256 +#define __NR_remap_file_pages 257 +#define __NR_set_tid_address 258 +#define __NR_timer_create 259 +#define __NR_timer_settime (__NR_timer_create+1) +#define __NR_timer_gettime (__NR_timer_create+2) +#define __NR_timer_getoverrun (__NR_timer_create+3) +#define __NR_timer_delete (__NR_timer_create+4) +#define __NR_clock_settime (__NR_timer_create+5) +#define __NR_clock_gettime (__NR_timer_create+6) +#define __NR_clock_getres (__NR_timer_create+7) +#define __NR_clock_nanosleep (__NR_timer_create+8) +#define __NR_statfs64 268 +#define __NR_fstatfs64 269 +#define __NR_tgkill 270 +#define __NR_utimes 271 +#define __NR_fadvise64_64 272 +#define __NR_vserver 273 +#define __NR_mbind 274 +#define __NR_get_mempolicy 275 +#define __NR_set_mempolicy 276 +#define __NR_mq_open 277 +#define __NR_mq_unlink (__NR_mq_open+1) +#define __NR_mq_timedsend (__NR_mq_open+2) +#define __NR_mq_timedreceive (__NR_mq_open+3) +#define __NR_mq_notify (__NR_mq_open+4) +#define __NR_mq_getsetattr (__NR_mq_open+5) +#define __NR_sys_kexec_load 283 +#define __NR_waitid 284 #define NR_syscalls 285 @@ -407,14 +407,10 @@ __syscall_return(type,__res); \ #ifdef __KERNEL__ #define __ARCH_WANT_IPC_PARSE_VERSION -#define __ARCH_WANT_OLD_READDIR -#define __ARCH_WANT_OLD_STAT #define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_ALARM #define __ARCH_WANT_SYS_GETHOSTNAME #define __ARCH_WANT_SYS_PAUSE -#define __ARCH_WANT_SYS_SGETMASK -#define __ARCH_WANT_SYS_SIGNAL #define __ARCH_WANT_SYS_TIME #define __ARCH_WANT_SYS_UTIME #define __ARCH_WANT_SYS_WAITPID @@ -422,11 +418,8 @@ __syscall_return(type,__res); \ #define __ARCH_WANT_SYS_FADVISE64 #define __ARCH_WANT_SYS_GETPGRP #define __ARCH_WANT_SYS_LLSEEK -#define __ARCH_WANT_SYS_NICE -#define __ARCH_WANT_SYS_OLD_GETRLIMIT +#define __ARCH_WANT_SYS_OLD_GETRLIMIT /*will be unused*/ #define __ARCH_WANT_SYS_OLDUMOUNT -#define __ARCH_WANT_SYS_SIGPENDING -#define __ARCH_WANT_SYS_SIGPROCMASK #define __ARCH_WANT_SYS_RT_SIGACTION #endif @@ -451,7 +444,6 @@ __syscall_return(type,__res); \ */ static __inline__ _syscall3(int,execve,const char *,file,char **,argv,char **,envp) -asmlinkage int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount); asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff); @@ -461,7 +453,6 @@ asmlinkage int sys_fork(struct pt_regs regs); asmlinkage int sys_vfork(struct pt_regs regs); asmlinkage int sys_pipe(unsigned long __user *fildes); asmlinkage int sys_ptrace(long request, long pid, long addr, long data); -asmlinkage long sys_iopl(unsigned long unused); struct sigaction; asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act, diff --git a/include/asm-m68k/atari_SCCserial.h b/include/asm-m68k/atari_SCCserial.h deleted file mode 100644 index de3af56c6874..000000000000 --- a/include/asm-m68k/atari_SCCserial.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef _ATARI_SCCSERIAL_H -#define _ATARI_SCCSERIAL_H - -/* Special configuration ioctls for the Atari SCC5380 Serial - * Communications Controller - */ - -/* ioctl command codes */ - -#define TIOCGATSCC 0x54c0 /* get SCC configuration */ -#define TIOCSATSCC 0x54c1 /* set SCC configuration */ -#define TIOCDATSCC 0x54c2 /* reset configuration to defaults */ - -/* Clock sources */ - -#define CLK_RTxC 0 -#define CLK_TRxC 1 -#define CLK_PCLK 2 - -/* baud_bases for the common clocks in the Atari. These are the real - * frequencies divided by 16. - */ - -#define SCC_BAUD_BASE_TIMC 19200 /* 0.3072 MHz from TT-MFP, Timer C */ -#define SCC_BAUD_BASE_BCLK 153600 /* 2.4576 MHz */ -#define SCC_BAUD_BASE_PCLK4 229500 /* 3.6720 MHz */ -#define SCC_BAUD_BASE_PCLK 503374 /* 8.0539763 MHz */ -#define SCC_BAUD_BASE_NONE 0 /* for not connected or unused - * clock sources */ - -#define SCC_BAUD_BASE_M147_PCLK 312500 /* 5 MHz */ -#define SCC_BAUD_BASE_M147 312500 /* 5 MHz */ -#define SCC_BAUD_BASE_MVME_PCLK 781250 /* 12.5 MHz */ -#define SCC_BAUD_BASE_MVME 625000 /* 10.000 MHz */ -#define SCC_BAUD_BASE_BVME_PCLK 781250 /* 12.5 MHz */ /* XXX ??? */ -#define SCC_BAUD_BASE_BVME 460800 /* 7.3728 MHz */ - -/* The SCC configuration structure */ - -struct atari_SCCserial { - unsigned RTxC_base; /* base_baud of RTxC */ - unsigned TRxC_base; /* base_baud of TRxC */ - unsigned PCLK_base; /* base_baud of PCLK, for both channels! */ - struct { - unsigned clksrc; /* CLK_RTxC, CLK_TRxC or CLK_PCLK */ - unsigned divisor; /* divisor for base baud, valid values: - * see below */ - } baud_table[17]; /* For 50, 75, 110, 135, 150, 200, 300, - * 600, 1200, 1800, 2400, 4800, 9600, - * 19200, 38400, 57600 and 115200 bps. The - * last two could be replaced by other - * rates > 38400 if they're not possible. - */ -}; - -/* The following divisors are valid: - * - * - CLK_RTxC: 1 or even (1, 2 and 4 are the direct modes, > 4 use - * the BRG) - * - * - CLK_TRxC: 1, 2 or 4 (no BRG, only direct modes possible) - * - * - CLK_PCLK: >= 4 and even (no direct modes, only BRG) - * - */ - -#endif /* _ATARI_SCCSERIAL_H */ diff --git a/include/asm-m68k/cputime.h b/include/asm-m68k/cputime.h new file mode 100644 index 000000000000..c79c5e892305 --- /dev/null +++ b/include/asm-m68k/cputime.h @@ -0,0 +1,6 @@ +#ifndef __M68K_CPUTIME_H +#define __M68K_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __M68K_CPUTIME_H */ diff --git a/include/asm-m68knommu/cputime.h b/include/asm-m68knommu/cputime.h new file mode 100644 index 000000000000..a0c4a660878d --- /dev/null +++ b/include/asm-m68knommu/cputime.h @@ -0,0 +1,6 @@ +#ifndef __M68KNOMMU_CPUTIME_H +#define __M68KNOMMU_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __M68KNOMMU_CPUTIME_H */ diff --git a/include/asm-mips/cputime.h b/include/asm-mips/cputime.h new file mode 100644 index 000000000000..c00eacbdd979 --- /dev/null +++ b/include/asm-mips/cputime.h @@ -0,0 +1,6 @@ +#ifndef __MIPS_CPUTIME_H +#define __MIPS_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __MIPS_CPUTIME_H */ diff --git a/include/asm-parisc/cputime.h b/include/asm-parisc/cputime.h new file mode 100644 index 000000000000..dcdf2fbd7e72 --- /dev/null +++ b/include/asm-parisc/cputime.h @@ -0,0 +1,6 @@ +#ifndef __PARISC_CPUTIME_H +#define __PARISC_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __PARISC_CPUTIME_H */ diff --git a/include/asm-ppc/cputime.h b/include/asm-ppc/cputime.h new file mode 100644 index 000000000000..8e9faf5ce720 --- /dev/null +++ b/include/asm-ppc/cputime.h @@ -0,0 +1,6 @@ +#ifndef __PPC_CPUTIME_H +#define __PPC_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __PPC_CPUTIME_H */ diff --git a/include/asm-ppc/reg.h b/include/asm-ppc/reg.h index 73eab4528eb9..48c0706466ca 100644 --- a/include/asm-ppc/reg.h +++ b/include/asm-ppc/reg.h @@ -329,6 +329,7 @@ #define MMCR0_PMC2_CYCLES 0x1 #define MMCR0_PMC2_ITLB 0x7 #define MMCR0_PMC2_LOADMISSTIME 0x5 +#define MMCR0_PMXE (1 << 26) /* Short-hand versions for a number of the above SPRNs */ #define CTR SPRN_CTR /* Counter Register */ diff --git a/include/asm-ppc64/bug.h b/include/asm-ppc64/bug.h index 790bc56091d6..db31dd22233c 100644 --- a/include/asm-ppc64/bug.h +++ b/include/asm-ppc64/bug.h @@ -18,6 +18,8 @@ struct bug_entry { const char *function; }; +struct bug_entry *find_bug(unsigned long bugaddr); + /* * If this bit is set in the line number it means that the trap * is for WARN_ON rather than BUG or BUG_ON. diff --git a/include/asm-ppc64/cputime.h b/include/asm-ppc64/cputime.h new file mode 100644 index 000000000000..8e9faf5ce720 --- /dev/null +++ b/include/asm-ppc64/cputime.h @@ -0,0 +1,6 @@ +#ifndef __PPC_CPUTIME_H +#define __PPC_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __PPC_CPUTIME_H */ diff --git a/include/asm-ppc64/machdep.h b/include/asm-ppc64/machdep.h index ae1c4fd4a7cf..476d2185ffd1 100644 --- a/include/asm-ppc64/machdep.h +++ b/include/asm-ppc64/machdep.h @@ -28,9 +28,10 @@ struct smp_ops_t { int (*probe)(void); void (*kick_cpu)(int nr); void (*setup_cpu)(int nr); - void (*late_setup_cpu)(int nr); void (*take_timebase)(void); void (*give_timebase)(void); + int (*cpu_disable)(void); + void (*cpu_die)(unsigned int nr); }; #endif diff --git a/include/asm-ppc64/pci-bridge.h b/include/asm-ppc64/pci-bridge.h index 51cfa8b72812..c4f9023ea5ed 100644 --- a/include/asm-ppc64/pci-bridge.h +++ b/include/asm-ppc64/pci-bridge.h @@ -11,18 +11,10 @@ * 2 of the License, or (at your option) any later version. */ -struct device_node; -struct pci_controller; - -/* Get the PCI host controller for an OF device */ -extern struct pci_controller* -pci_find_hose_for_OF_device(struct device_node* node); - /* * Structure of a PCI controller (host bridge) */ struct pci_controller { - char what[8]; /* Eye catcher */ struct pci_bus *bus; char is_dynamic; void *arch_data; @@ -49,7 +41,6 @@ struct pci_controller { */ struct resource io_resource; struct resource mem_resources[3]; - int mem_resource_count; int global_number; int local_number; unsigned long buid; @@ -57,14 +48,6 @@ struct pci_controller { unsigned long dma_window_size; }; -/* - * pci_device_loc returns the bus number and device/function number - * for a device on a PCI bus, given its device_node struct. - * It returns 0 if OK, -1 on error. - */ -extern int pci_device_loc(struct device_node *dev, unsigned char *bus_ptr, - unsigned char *devfn_ptr); - struct device_node *fetch_dev_dn(struct pci_dev *dev); /* Get a device_node from a pci_dev. This code must be fast except in the case @@ -72,8 +55,9 @@ struct device_node *fetch_dev_dn(struct pci_dev *dev); */ static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev) { - struct device_node *dn = (struct device_node *)(dev->sysdata); - if (dn->devfn == dev->devfn && dn->busno == (dev->bus->number&0xff)) + struct device_node *dn = dev->sysdata; + + if (dn->devfn == dev->devfn && dn->busno == dev->bus->number) return dn; /* fast path. sysdata is good */ else return fetch_dev_dn(dev); @@ -102,6 +86,5 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) return busdn->phb; } - #endif #endif /* __KERNEL__ */ diff --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h index d5b23b426efa..1cf388538595 100644 --- a/include/asm-ppc64/processor.h +++ b/include/asm-ppc64/processor.h @@ -331,8 +331,8 @@ #define MMCR0_FCECE 0x02000000UL /* freeze counters on enabled condition or event */ /* time base exception enable */ #define MMCR0_TBEE 0x00400000UL /* time base exception enable */ -#define MMCR0_PMC1INTCONTROL 0x00008000UL /* PMC1 count enable*/ -#define MMCR0_PMCNINTCONTROL 0x00004000UL /* PMCn count enable*/ +#define MMCR0_PMC1CE 0x00008000UL /* PMC1 count enable*/ +#define MMCR0_PMCjCE 0x00004000UL /* PMCj count enable*/ #define MMCR0_TRIGGER 0x00002000UL /* TRIGGER enable */ #define MMCR0_PMAO 0x00000080UL /* performance monitor alert has occurred, set to 0 after handling exception */ #define MMCR0_SHRFC 0x00000040UL /* SHRre freeze conditions between threads */ diff --git a/include/asm-ppc64/rtas.h b/include/asm-ppc64/rtas.h index a405a871919e..dc2879cc4981 100644 --- a/include/asm-ppc64/rtas.h +++ b/include/asm-ppc64/rtas.h @@ -241,4 +241,6 @@ extern void rtas_stop_self(void); /* RMO buffer reserved for user-space RTAS use */ extern unsigned long rtas_rmo_buf; +#define GLOBAL_INTERRUPT_QUEUE 9005 + #endif /* _PPC64_RTAS_H */ diff --git a/include/asm-ppc64/smp.h b/include/asm-ppc64/smp.h index 6121d21355bc..965980bbbb57 100644 --- a/include/asm-ppc64/smp.h +++ b/include/asm-ppc64/smp.h @@ -38,7 +38,7 @@ struct pt_regs; extern void smp_message_recv(int, struct pt_regs *); -#define smp_processor_id() (get_paca()->paca_index) +#define __smp_processor_id() (get_paca()->paca_index) #define hard_smp_processor_id() (get_paca()->hw_cpu_id) extern cpumask_t cpu_sibling_map[NR_CPUS]; diff --git a/include/asm-ppc64/spinlock.h b/include/asm-ppc64/spinlock.h index 58e5dc61d9d8..e194599dbe50 100644 --- a/include/asm-ppc64/spinlock.h +++ b/include/asm-ppc64/spinlock.h @@ -222,8 +222,6 @@ static void __inline__ _raw_read_unlock(rwlock_t *rw) : "cr0", "memory"); } -#define _raw_read_trylock(lock) generic_raw_read_trylock(lock) - /* * This returns the old value in the lock, * so we got the write lock if the return value is 0. diff --git a/include/asm-ppc64/system.h b/include/asm-ppc64/system.h index dc3153fa414e..6785e69e8b9e 100644 --- a/include/asm-ppc64/system.h +++ b/include/asm-ppc64/system.h @@ -108,7 +108,6 @@ extern void show_regs(struct pt_regs * regs); extern void low_hash_fault(struct pt_regs *regs, unsigned long address); extern int die(const char *str, struct pt_regs *regs, long err); -extern void flush_instruction_cache(void); extern int _get_PVR(void); extern void giveup_fpu(struct task_struct *); extern void disable_kernel_fp(void); diff --git a/include/asm-ppc64/thread_info.h b/include/asm-ppc64/thread_info.h index 595d67ef4b6f..e823d119ffcf 100644 --- a/include/asm-ppc64/thread_info.h +++ b/include/asm-ppc64/thread_info.h @@ -12,6 +12,7 @@ #ifndef __ASSEMBLY__ #include <linux/config.h> +#include <linux/cache.h> #include <asm/processor.h> #include <asm/page.h> #include <linux/stringify.h> @@ -22,12 +23,13 @@ struct thread_info { struct task_struct *task; /* main task structure */ struct exec_domain *exec_domain; /* execution domain */ - unsigned long flags; /* low level flags */ int cpu; /* cpu we're on */ int preempt_count; struct restart_block restart_block; /* set by force_successful_syscall_return */ unsigned char syscall_noerror; + /* low level flags - has atomic operations done on it */ + unsigned long flags ____cacheline_aligned_in_smp; }; /* @@ -39,12 +41,12 @@ struct thread_info { { \ .task = &tsk, \ .exec_domain = &default_exec_domain, \ - .flags = 0, \ .cpu = 0, \ .preempt_count = 1, \ .restart_block = { \ .fn = do_no_restart_syscall, \ }, \ + .flags = 0, \ } #define init_thread_info (init_thread_union.thread_info) diff --git a/include/asm-ppc64/tlbflush.h b/include/asm-ppc64/tlbflush.h index 183bdfba9f0c..45411a67e082 100644 --- a/include/asm-ppc64/tlbflush.h +++ b/include/asm-ppc64/tlbflush.h @@ -32,10 +32,11 @@ extern void __flush_tlb_pending(struct ppc64_tlb_batch *batch); static inline void flush_tlb_pending(void) { - struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); + struct ppc64_tlb_batch *batch = &get_cpu_var(ppc64_tlb_batch); if (batch->index) __flush_tlb_pending(batch); + put_cpu_var(ppc64_tlb_batch); } #define flush_tlb_mm(mm) flush_tlb_pending() diff --git a/include/asm-ppc64/xics.h b/include/asm-ppc64/xics.h index 560f4fd99e21..0027da4364ac 100644 --- a/include/asm-ppc64/xics.h +++ b/include/asm-ppc64/xics.h @@ -18,6 +18,8 @@ void xics_init_IRQ(void); int xics_get_irq(struct pt_regs *); void xics_setup_cpu(void); void xics_cause_IPI(int cpu); +void xics_request_IPIs(void); +void xics_migrate_irqs_away(void); /* first argument is ignored for now*/ void pSeriesLP_cppr_info(int n_cpu, u8 value); @@ -28,4 +30,7 @@ struct xics_ipi_struct { extern struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned; +extern unsigned int default_distrib_server; +extern unsigned int interrupt_server_size; + #endif /* _PPC64_KERNEL_XICS_H */ diff --git a/include/asm-s390/cputime.h b/include/asm-s390/cputime.h new file mode 100644 index 000000000000..216d861337e6 --- /dev/null +++ b/include/asm-s390/cputime.h @@ -0,0 +1,168 @@ +/* + * include/asm-s390/cputime.h + * + * (C) Copyright IBM Corp. 2004 + * + * Author: Martin Schwidefsky <schwidefsky@de.ibm.com> + */ + +#ifndef _S390_CPUTIME_H +#define _S390_CPUTIME_H + +/* We want to use micro-second resolution. */ + +typedef unsigned long long cputime_t; +typedef unsigned long long cputime64_t; + +#ifndef __s390x__ + +static inline unsigned int +__div(unsigned long long n, unsigned int base) +{ + register_pair rp; + + rp.pair = n >> 1; + asm ("dr %0,%1" : "+d" (rp) : "d" (base >> 1)); + return rp.subreg.odd; +} + +#else /* __s390x__ */ + +static inline unsigned int +__div(unsigned long long n, unsigned int base) +{ + return n / base; +} + +#endif /* __s390x__ */ + +#define cputime_zero (0ULL) +#define cputime_max ((~0UL >> 1) - 1) +#define cputime_add(__a, __b) ((__a) + (__b)) +#define cputime_sub(__a, __b) ((__a) - (__b)) +#define cputime_eq(__a, __b) ((__a) == (__b)) +#define cputime_gt(__a, __b) ((__a) > (__b)) +#define cputime_ge(__a, __b) ((__a) >= (__b)) +#define cputime_lt(__a, __b) ((__a) < (__b)) +#define cputime_le(__a, __b) ((__a) <= (__b)) +#define cputime_to_jiffies(__ct) (__div((__ct), 1000000 / HZ)) +#define jiffies_to_cputime(__hz) ((cputime_t)(__hz) * (1000000 / HZ)) + +#define cputime64_zero (0ULL) +#define cputime64_add(__a, __b) ((__a) + (__b)) +#define cputime_to_cputime64(__ct) (__ct) + +static inline u64 +cputime64_to_jiffies64(cputime64_t cputime) +{ + do_div(cputime, 1000000 / HZ); + return cputime; +} + +/* + * Convert cputime to milliseconds and back. + */ +static inline unsigned int +cputime_to_msecs(const cputime_t cputime) +{ + return __div(cputime, 1000); +} + +static inline cputime_t +msecs_to_cputime(const unsigned int m) +{ + return (cputime_t) m * 1000; +} + +/* + * Convert cputime to milliseconds and back. + */ +static inline unsigned int +cputime_to_secs(const cputime_t cputime) +{ + return __div(cputime, 1000000); +} + +static inline cputime_t +secs_to_cputime(const unsigned int s) +{ + return (cputime_t) s * 1000000; +} + +/* + * Convert cputime to timespec and back. + */ +static inline cputime_t +timespec_to_cputime(const struct timespec *value) +{ + return value->tv_nsec / 1000 + (u64) value->tv_sec * 1000000; +} + +static inline void +cputime_to_timespec(const cputime_t cputime, struct timespec *value) +{ +#ifndef __s390x__ + register_pair rp; + + rp.pair = cputime >> 1; + asm ("dr %0,%1" : "+d" (rp) : "d" (1000000 >> 1)); + value->tv_nsec = rp.subreg.even * 1000; + value->tv_sec = rp.subreg.odd; +#else + value->tv_nsec = (cputime % 1000000) * 1000; + value->tv_sec = cputime / 1000000; +#endif +} + +/* + * Convert cputime to timeval and back. + * Since cputime and timeval have the same resolution (microseconds) + * this is easy. + */ +static inline cputime_t +timeval_to_cputime(const struct timeval *value) +{ + return value->tv_usec + (u64) value->tv_sec * 1000000; +} + +static inline void +cputime_to_timeval(const cputime_t cputime, struct timeval *value) +{ +#ifndef __s390x__ + register_pair rp; + + rp.pair = cputime >> 1; + asm ("dr %0,%1" : "+d" (rp) : "d" (1000000 >> 1)); + value->tv_usec = rp.subreg.even; + value->tv_sec = rp.subreg.odd; +#else + value->tv_usec = cputime % 1000000; + value->tv_sec = cputime / 1000000; +#endif +} + +/* + * Convert cputime to clock and back. + */ +static inline clock_t +cputime_to_clock_t(cputime_t cputime) +{ + return __div(cputime, 1000000 / USER_HZ); +} + +static inline cputime_t +clock_t_to_cputime(unsigned long x) +{ + return (cputime_t) x * (1000000 / USER_HZ); +} + +/* + * Convert cputime64 to clock. + */ +static inline clock_t +cputime64_to_clock_t(cputime64_t cputime) +{ + return __div(cputime, 1000000 / USER_HZ); +} + +#endif /* _S390_CPUTIME_H */ diff --git a/include/asm-s390/hardirq.h b/include/asm-s390/hardirq.h index 1580b7b2b05e..53e59b4760c5 100644 --- a/include/asm-s390/hardirq.h +++ b/include/asm-s390/hardirq.h @@ -16,6 +16,7 @@ #include <linux/threads.h> #include <linux/sched.h> #include <linux/cache.h> +#include <linux/interrupt.h> #include <asm/lowcore.h> /* irq_cpustat_t is unused currently, but could be converted diff --git a/include/asm-s390/lowcore.h b/include/asm-s390/lowcore.h index 0aa1c0f1e705..df5172fc589d 100644 --- a/include/asm-s390/lowcore.h +++ b/include/asm-s390/lowcore.h @@ -56,13 +56,18 @@ #define __LC_RETURN_PSW 0x200 -#define __LC_IRB 0x210 - -#define __LC_DIAG44_OPCODE 0x250 - #define __LC_SAVE_AREA 0xC00 #ifndef __s390x__ +#define __LC_IRB 0x208 +#define __LC_SYNC_ENTER_TIMER 0x248 +#define __LC_ASYNC_ENTER_TIMER 0x250 +#define __LC_EXIT_TIMER 0x258 +#define __LC_LAST_UPDATE_TIMER 0x260 +#define __LC_USER_TIMER 0x268 +#define __LC_SYSTEM_TIMER 0x270 +#define __LC_LAST_UPDATE_CLOCK 0x278 +#define __LC_STEAL_CLOCK 0x280 #define __LC_KERNEL_STACK 0xC40 #define __LC_THREAD_INFO 0xC44 #define __LC_ASYNC_STACK 0xC48 @@ -76,6 +81,16 @@ #define __LC_CURRENT 0xC90 #define __LC_INT_CLOCK 0xC98 #else /* __s390x__ */ +#define __LC_IRB 0x210 +#define __LC_SYNC_ENTER_TIMER 0x250 +#define __LC_ASYNC_ENTER_TIMER 0x258 +#define __LC_EXIT_TIMER 0x260 +#define __LC_LAST_UPDATE_TIMER 0x268 +#define __LC_USER_TIMER 0x270 +#define __LC_SYSTEM_TIMER 0x278 +#define __LC_LAST_UPDATE_CLOCK 0x280 +#define __LC_STEAL_CLOCK 0x288 +#define __LC_DIAG44_OPCODE 0x290 #define __LC_KERNEL_STACK 0xD40 #define __LC_THREAD_INFO 0xD48 #define __LC_ASYNC_STACK 0xD50 @@ -87,7 +102,7 @@ #define __LC_IPLDEV 0xDB8 #define __LC_JIFFY_TIMER 0xDC0 #define __LC_CURRENT 0xDD8 -#define __LC_INT_CLOCK 0xDe8 +#define __LC_INT_CLOCK 0xDE8 #endif /* __s390x__ */ #define __LC_PANIC_MAGIC 0xE00 @@ -169,7 +184,15 @@ struct _lowcore psw_t return_psw; /* 0x200 */ __u8 irb[64]; /* 0x208 */ - __u8 pad8[0xc00-0x248]; /* 0x248 */ + __u64 sync_enter_timer; /* 0x248 */ + __u64 async_enter_timer; /* 0x250 */ + __u64 exit_timer; /* 0x258 */ + __u64 last_update_timer; /* 0x260 */ + __u64 user_timer; /* 0x268 */ + __u64 system_timer; /* 0x270 */ + __u64 last_update_clock; /* 0x278 */ + __u64 steal_clock; /* 0x280 */ + __u8 pad8[0xc00-0x288]; /* 0x288 */ /* System info area */ __u32 save_area[16]; /* 0xc00 */ @@ -250,8 +273,16 @@ struct _lowcore psw_t io_new_psw; /* 0x1f0 */ psw_t return_psw; /* 0x200 */ __u8 irb[64]; /* 0x210 */ - __u32 diag44_opcode; /* 0x250 */ - __u8 pad8[0xc00-0x254]; /* 0x254 */ + __u64 sync_enter_timer; /* 0x250 */ + __u64 async_enter_timer; /* 0x258 */ + __u64 exit_timer; /* 0x260 */ + __u64 last_update_timer; /* 0x268 */ + __u64 user_timer; /* 0x270 */ + __u64 system_timer; /* 0x278 */ + __u64 last_update_clock; /* 0x280 */ + __u64 steal_clock; /* 0x288 */ + __u32 diag44_opcode; /* 0x290 */ + __u8 pad8[0xc00-0x294]; /* 0x294 */ /* System info area */ __u64 save_area[16]; /* 0xc00 */ __u8 pad9[0xd40-0xc80]; /* 0xc80 */ diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h index d9f3498136e1..e8596077e057 100644 --- a/include/asm-s390/system.h +++ b/include/asm-s390/system.h @@ -105,11 +105,29 @@ static inline void restore_access_regs(unsigned int *acrs) #define prepare_arch_switch(rq, next) do { } while(0) #define task_running(rq, p) ((rq)->curr == (p)) + +#ifdef CONFIG_VIRT_CPU_ACCOUNTING +extern void account_user_vtime(struct task_struct *); +extern void account_system_vtime(struct task_struct *); + +#define finish_arch_switch(rq, prev) do { \ + set_fs(current->thread.mm_segment); \ + spin_unlock(&(rq)->lock); \ + account_system_vtime(prev); \ + local_irq_enable(); \ +} while (0) + +#else + +#define account_system_vtime(prev) + #define finish_arch_switch(rq, prev) do { \ set_fs(current->thread.mm_segment); \ spin_unlock_irq(&(rq)->lock); \ } while (0) +#endif + #define nop() __asm__ __volatile__ ("nop") #define xchg(ptr,x) \ diff --git a/include/asm-s390/timer.h b/include/asm-s390/timer.h index 454d1ea85c54..ea0788967c51 100644 --- a/include/asm-s390/timer.h +++ b/include/asm-s390/timer.h @@ -37,8 +37,6 @@ struct vtimer_queue { __u64 idle; /* temp var for idle */ }; -void set_vtimer(__u64 expires); - extern void init_virt_timer(struct vtimer_list *timer); extern void add_virt_timer(void *new); extern void add_virt_timer_periodic(void *new); diff --git a/include/asm-sh/cputime.h b/include/asm-sh/cputime.h new file mode 100644 index 000000000000..6ca395d1393e --- /dev/null +++ b/include/asm-sh/cputime.h @@ -0,0 +1,6 @@ +#ifndef __SH_CPUTIME_H +#define __SH_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __SH_CPUTIME_H */ diff --git a/include/asm-sh64/cputime.h b/include/asm-sh64/cputime.h new file mode 100644 index 000000000000..0fd89da2aa86 --- /dev/null +++ b/include/asm-sh64/cputime.h @@ -0,0 +1,6 @@ +#ifndef __SH64_CPUTIME_H +#define __SH64_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __SH64_CPUTIME_H */ diff --git a/include/asm-sparc/cputime.h b/include/asm-sparc/cputime.h new file mode 100644 index 000000000000..1a642b81e019 --- /dev/null +++ b/include/asm-sparc/cputime.h @@ -0,0 +1,6 @@ +#ifndef __SPARC_CPUTIME_H +#define __SPARC_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __SPARC_CPUTIME_H */ diff --git a/include/asm-sparc64/cputime.h b/include/asm-sparc64/cputime.h new file mode 100644 index 000000000000..dec2fc7a36f8 --- /dev/null +++ b/include/asm-sparc64/cputime.h @@ -0,0 +1,6 @@ +#ifndef __SPARC64_CPUTIME_H +#define __SPARC64_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __SPARC64_CPUTIME_H */ diff --git a/include/asm-um/apic.h b/include/asm-um/apic.h new file mode 100644 index 000000000000..876dee84ab11 --- /dev/null +++ b/include/asm-um/apic.h @@ -0,0 +1,4 @@ +#ifndef __UM_APIC_H +#define __UM_APIC_H + +#endif diff --git a/include/asm-um/archparam-i386.h b/include/asm-um/archparam-i386.h index 0d3bad3efc3f..5b5df118d9a5 100644 --- a/include/asm-um/archparam-i386.h +++ b/include/asm-um/archparam-i386.h @@ -66,6 +66,13 @@ extern unsigned long __kernel_vsyscall; #define VSYSCALL_END vsyscall_end /* + * This is the range that is readable by user mode, and things + * acting like user mode such as get_user_pages. + */ +#define FIXADDR_USER_START VSYSCALL_BASE +#define FIXADDR_USER_END VSYSCALL_END + +/* * Architecture-neutral AT_ values in 0-17, leave some room * for more of them, start the x86-specific ones at 32. */ @@ -136,10 +143,6 @@ if ( vsyscall_ehdr ) { \ #define R_386_GOTPC 10 #define R_386_NUM 11 -/********* Bits for asm-um/delay.h **********/ - -typedef unsigned long um_udelay_t; - /********* Nothing for asm-um/hardirq.h **********/ /********* Nothing for asm-um/hw_irq.h **********/ diff --git a/include/asm-um/archparam-ppc.h b/include/asm-um/archparam-ppc.h index 9b8b27e29551..0ebced92a762 100644 --- a/include/asm-um/archparam-ppc.h +++ b/include/asm-um/archparam-ppc.h @@ -21,10 +21,6 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; #define ELF_DATA ELFDATA2MSB #define ELF_ARCH EM_PPC -/********* Bits for asm-um/delay.h **********/ - -typedef unsigned int um_udelay_t; - /********* Bits for asm-um/hw_irq.h **********/ struct hw_interrupt_type; diff --git a/include/asm-um/archparam-x86_64.h b/include/asm-um/archparam-x86_64.h new file mode 100644 index 000000000000..96321c4892f1 --- /dev/null +++ b/include/asm-um/archparam-x86_64.h @@ -0,0 +1,62 @@ +/* + * Copyright 2003 PathScale, Inc. + * + * Licensed under the GPL + */ + +#ifndef __UM_ARCHPARAM_X86_64_H +#define __UM_ARCHPARAM_X86_64_H + +#include <asm/user.h> + +#define ELF_PLATFORM "x86_64" + +#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3) + +typedef unsigned long elf_greg_t; +typedef struct { } elf_fpregset_t; + +#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; + +#define ELF_DATA ELFDATA2LSB +#define ELF_ARCH EM_X86_64 + +#define ELF_PLAT_INIT(regs, load_addr) do { \ + PT_REGS_RBX(regs) = 0; \ + PT_REGS_RCX(regs) = 0; \ + PT_REGS_RDX(regs) = 0; \ + PT_REGS_RSI(regs) = 0; \ + PT_REGS_RDI(regs) = 0; \ + PT_REGS_RBP(regs) = 0; \ + PT_REGS_RAX(regs) = 0; \ + PT_REGS_R8(regs) = 0; \ + PT_REGS_R9(regs) = 0; \ + PT_REGS_R10(regs) = 0; \ + PT_REGS_R11(regs) = 0; \ + PT_REGS_R12(regs) = 0; \ + PT_REGS_R13(regs) = 0; \ + PT_REGS_R14(regs) = 0; \ + PT_REGS_R15(regs) = 0; \ +} while (0) + +#ifdef TIF_IA32 /* XXX */ + clear_thread_flag(TIF_IA32); +#endif + +/* No user-accessible fixmap addresses, i.e. vsyscall */ +#define FIXADDR_USER_START 0 +#define FIXADDR_USER_END 0 + +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/include/asm-um/calling.h b/include/asm-um/calling.h new file mode 100644 index 000000000000..0b2384cc99fd --- /dev/null +++ b/include/asm-um/calling.h @@ -0,0 +1,9 @@ +# Copyright 2003 - 2004 Pathscale, Inc +# Released under the GPL + +#ifndef __UM_CALLING_H /* XXX x86_64 */ +#define __UM_CALLING_H + +#include "asm/arch/calling.h" + +#endif diff --git a/include/asm-um/cputime.h b/include/asm-um/cputime.h new file mode 100644 index 000000000000..c84acbadfa2f --- /dev/null +++ b/include/asm-um/cputime.h @@ -0,0 +1,6 @@ +#ifndef __UM_CPUTIME_H +#define __UM_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __UM_CPUTIME_H */ diff --git a/include/asm-um/dwarf2.h b/include/asm-um/dwarf2.h new file mode 100644 index 000000000000..d1a02e762931 --- /dev/null +++ b/include/asm-um/dwarf2.h @@ -0,0 +1,11 @@ +/* Copyright 2003 - 2004 Pathscale, Inc + * Released under the GPL + */ + +/* Needed on x86_64 by thunk.S */ +#ifndef __UM_DWARF2_H +#define __UM_DWARF2_H + +#include "asm/arch/dwarf2.h" + +#endif diff --git a/include/asm-um/elf.h b/include/asm-um/elf.h index b689a770a83f..b3a7258f9971 100644 --- a/include/asm-um/elf.h +++ b/include/asm-um/elf.h @@ -1,6 +1,7 @@ #ifndef __UM_ELF_H #define __UM_ELF_H +#include "linux/config.h" #include "asm/archparam.h" extern long elf_aux_hwcap; @@ -12,7 +13,11 @@ extern long elf_aux_hwcap; #define elf_check_arch(x) (1) +#ifdef CONFIG_64_BIT +#define ELF_CLASS ELFCLASS64 +#else #define ELF_CLASS ELFCLASS32 +#endif #define USE_ELF_CORE_DUMP diff --git a/include/asm-um/fixmap.h b/include/asm-um/fixmap.h index 0fb5779088b0..900f3fbb9fab 100644 --- a/include/asm-um/fixmap.h +++ b/include/asm-um/fixmap.h @@ -64,13 +64,6 @@ extern unsigned long get_kmem_end(void); #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)) #define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT) -/* - * This is the range that is readable by user mode, and things - * acting like user mode such as get_user_pages. - */ -#define FIXADDR_USER_START VSYSCALL_BASE -#define FIXADDR_USER_END VSYSCALL_END - extern void __this_fixmap_does_not_exist(void); /* diff --git a/include/asm-um/module-x86_64.h b/include/asm-um/module-x86_64.h new file mode 100644 index 000000000000..35b5491d3e96 --- /dev/null +++ b/include/asm-um/module-x86_64.h @@ -0,0 +1,30 @@ +/* + * Copyright 2003 PathScale, Inc. + * + * Licensed under the GPL + */ + +#ifndef __UM_MODULE_X86_64_H +#define __UM_MODULE_X86_64_H + +/* UML is simple */ +struct mod_arch_specific +{ +}; + +#define Elf_Shdr Elf64_Shdr +#define Elf_Sym Elf64_Sym +#define Elf_Ehdr Elf64_Ehdr + +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/include/asm-um/page.h b/include/asm-um/page.h index f69b0f1c270e..3620a08dc9f3 100644 --- a/include/asm-um/page.h +++ b/include/asm-um/page.h @@ -1,5 +1,6 @@ /* - * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) + * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) + * Copyright 2003 PathScale, Inc. * Licensed under the GPL */ @@ -8,18 +9,82 @@ struct page; -#include "asm/arch/page.h" +#include <linux/config.h> +#include <asm/vm-flags.h> -#undef __pa -#undef __va -#undef pfn_to_page -#undef page_to_pfn -#undef virt_to_page -#undef pfn_valid -#undef virt_addr_valid -#undef VALID_PAGE -#undef PAGE_OFFSET -#undef KERNELBASE +/* PAGE_SHIFT determines the page size */ +#define PAGE_SHIFT 12 +#define PAGE_SIZE (1UL << PAGE_SHIFT) +#define PAGE_MASK (~(PAGE_SIZE-1)) + +/* + * These are used to make use of C type-checking.. + */ + +#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) +#define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE) + +#define clear_user_page(page, vaddr, pg) clear_page(page) +#define copy_user_page(to, from, vaddr, pg) copy_page(to, from) + +#if defined(CONFIG_3_LEVEL_PGTABLES) && !defined(CONFIG_64_BIT) + +typedef struct { unsigned long pte_low, pte_high; } pte_t; +typedef struct { unsigned long long pmd; } pmd_t; +typedef struct { unsigned long pgd; } pgd_t; +#define pte_val(x) ((x).pte_low | ((unsigned long long) (x).pte_high << 32)) + +#define pte_get_bits(pte, bits) ((pte).pte_low & (bits)) +#define pte_set_bits(pte, bits) ((pte).pte_low |= (bits)) +#define pte_clear_bits(pte, bits) ((pte).pte_low &= ~(bits)) +#define pte_copy(to, from) ({ (to).pte_high = (from).pte_high; \ + smp_wmb(); \ + (to).pte_low = (from).pte_low; }) +#define pte_is_zero(pte) (!((pte).pte_low & ~_PAGE_NEWPAGE) && !(pte).pte_high) +#define pte_set_val(pte, phys, prot) \ + ({ (pte).pte_high = (phys) >> 32; \ + (pte).pte_low = (phys) | pgprot_val(prot); }) + +typedef unsigned long long pfn_t; +typedef unsigned long long phys_t; + +#else + +typedef struct { unsigned long pte; } pte_t; +typedef struct { unsigned long pgd; } pgd_t; + +#ifdef CONFIG_3_LEVEL_PGTABLES +typedef struct { unsigned long pmd; } pmd_t; +#define pmd_val(x) ((x).pmd) +#define __pmd(x) ((pmd_t) { (x) } ) +#endif + +#define pte_val(x) ((x).pte) + + +#define pte_get_bits(p, bits) ((p).pte & (bits)) +#define pte_set_bits(p, bits) ((p).pte |= (bits)) +#define pte_clear_bits(p, bits) ((p).pte &= ~(bits)) +#define pte_copy(to, from) ((to).pte = (from).pte) +#define pte_is_zero(p) (!((p).pte & ~_PAGE_NEWPAGE)) +#define pte_set_val(p, phys, prot) (p).pte = (phys | pgprot_val(prot)) + +typedef unsigned long pfn_t; +typedef unsigned long phys_t; + +#endif + +typedef struct { unsigned long pgprot; } pgprot_t; + +#define pgd_val(x) ((x).pgd) +#define pgprot_val(x) ((x).pgprot) + +#define __pte(x) ((pte_t) { (x) } ) +#define __pgd(x) ((pgd_t) { (x) } ) +#define __pgprot(x) ((pgprot_t) { (x) } ) + +/* to align the pointer to the (next) page boundary */ +#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) extern unsigned long uml_physmem; @@ -30,7 +95,6 @@ extern unsigned long uml_physmem; extern unsigned long to_phys(void *virt); extern void *to_virt(unsigned long phys); - #define __pa(virt) to_phys((void *) virt) #define __va(phys) to_virt((unsigned long) phys) @@ -42,7 +106,21 @@ extern void *to_virt(unsigned long phys); #define pfn_valid(pfn) ((pfn) < max_mapnr) #define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v))) - + +/* Pure 2^n version of get_order */ +static __inline__ int get_order(unsigned long size) +{ + int order; + + size = (size-1) >> (PAGE_SHIFT-1); + order = -1; + do { + size >>= 1; + order++; + } while (size); + return order; +} + extern struct page *arch_validate(struct page *page, int mask, int order); #define HAVE_ARCH_VALIDATE diff --git a/include/asm-um/pda.h b/include/asm-um/pda.h new file mode 100644 index 000000000000..0d8bf33ffd42 --- /dev/null +++ b/include/asm-um/pda.h @@ -0,0 +1,31 @@ +/* + * Copyright 2003 PathScale, Inc. + * + * Licensed under the GPL + */ + +#ifndef __UM_PDA_X86_64_H +#define __UM_PDA_X86_64_H + +/* XXX */ +struct foo { + unsigned int __softirq_pending; + unsigned int __nmi_count; +}; + +extern struct foo me; + +#define read_pda(me) (&me) + +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/include/asm-um/pgalloc.h b/include/asm-um/pgalloc.h index 73973aeaf482..8fcb2fc0a892 100644 --- a/include/asm-um/pgalloc.h +++ b/include/asm-um/pgalloc.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) + * Copyright 2003 PathScale, Inc. * Derived from include/asm-i386/pgalloc.h and include/asm-i386/pgtable.h * Licensed under the GPL */ @@ -7,18 +8,21 @@ #ifndef __UM_PGALLOC_H #define __UM_PGALLOC_H +#include "linux/config.h" #include "linux/mm.h" #include "asm/fixmap.h" #define pmd_populate_kernel(mm, pmd, pte) \ - set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) __pa(pte))) + set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) __pa(pte))) -static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, - struct page *pte) -{ - set_pmd(pmd, __pmd(_PAGE_TABLE + page_to_phys(pte))); -} +#define pmd_populate(mm, pmd, pte) \ + set_pmd(pmd, __pmd(_PAGE_TABLE + \ + ((unsigned long long)page_to_pfn(pte) << \ + (unsigned long long) PAGE_SHIFT))) +/* + * Allocate and free page tables. + */ extern pgd_t *pgd_alloc(struct mm_struct *); extern void pgd_free(pgd_t *pgd); @@ -37,15 +41,13 @@ static inline void pte_free(struct page *pte) #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) +#ifdef CONFIG_3_LEVEL_PGTABLES /* - * allocating and freeing a pmd is trivial: the 1-entry pmd is - * inside the pgd, so has no extra memory associated with it. + * In the 3-level case we free the pmds as part of the pgd. */ - -#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) #define pmd_free(x) do { } while (0) #define __pmd_free_tlb(tlb,x) do { } while (0) -#define pgd_populate(mm, pmd, pte) BUG() +#endif #define check_pgt_cache() do { } while (0) diff --git a/include/asm-um/pgtable-2level.h b/include/asm-um/pgtable-2level.h new file mode 100644 index 000000000000..f6263d11f205 --- /dev/null +++ b/include/asm-um/pgtable-2level.h @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) + * Copyright 2003 PathScale, Inc. + * Derived from include/asm-i386/pgtable.h + * Licensed under the GPL + */ + +#ifndef __UM_PGTABLE_2LEVEL_H +#define __UM_PGTABLE_2LEVEL_H + +#include <asm-generic/pgtable-nopmd.h> + +/* PGDIR_SHIFT determines what a third-level page table entry can map */ + +#define PGDIR_SHIFT 22 +#define PGDIR_SIZE (1UL << PGDIR_SHIFT) +#define PGDIR_MASK (~(PGDIR_SIZE-1)) + +/* + * entries per page directory level: the i386 is two-level, so + * we don't really have any PMD directory physically. + */ +#define PTRS_PER_PTE 1024 +#define PTRS_PER_PMD 1 +#define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE) +#define PTRS_PER_PGD 1024 +#define FIRST_USER_PGD_NR 0 + +#define pte_ERROR(e) \ + printk("%s:%d: bad pte %p(%08lx).\n", __FILE__, __LINE__, &(e), \ + pte_val(e)) +#define pgd_ERROR(e) \ + printk("%s:%d: bad pgd %p(%08lx).\n", __FILE__, __LINE__, &(e), \ + pgd_val(e)) + +static inline int pgd_newpage(pgd_t pgd) { return 0; } +static inline void pgd_mkuptodate(pgd_t pgd) { } + +#define pte_present(x) (pte_val(x) & (_PAGE_PRESENT | _PAGE_PROTNONE)) + +static inline pte_t pte_mknewprot(pte_t pte) +{ + pte_val(pte) |= _PAGE_NEWPROT; + return(pte); +} + +static inline pte_t pte_mknewpage(pte_t pte) +{ + pte_val(pte) |= _PAGE_NEWPAGE; + return(pte); +} + +static inline void set_pte(pte_t *pteptr, pte_t pteval) +{ + /* If it's a swap entry, it needs to be marked _PAGE_NEWPAGE so + * fix_range knows to unmap it. _PAGE_NEWPROT is specific to + * mapped pages. + */ + *pteptr = pte_mknewpage(pteval); + if(pte_present(*pteptr)) *pteptr = pte_mknewprot(*pteptr); +} + +#define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval)) + +#define pte_page(x) pfn_to_page(pte_pfn(x)) +#define pte_none(x) !(pte_val(x) & ~_PAGE_NEWPAGE) +#define pte_pfn(x) phys_to_pfn(pte_val(x)) +#define pfn_pte(pfn, prot) __pte(pfn_to_phys(pfn) | pgprot_val(prot)) +#define pfn_pmd(pfn, prot) __pmd(pfn_to_phys(pfn) | pgprot_val(prot)) + +#define pmd_page_kernel(pmd) \ + ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) + +/* + * Bits 0 through 3 are taken + */ +#define PTE_FILE_MAX_BITS 28 + +#define pte_to_pgoff(pte) (pte_val(pte) >> 4) + +#define pgoff_to_pte(off) ((pte_t) { ((off) << 4) + _PAGE_FILE }) + +#endif diff --git a/include/asm-um/pgtable-3level.h b/include/asm-um/pgtable-3level.h new file mode 100644 index 000000000000..acebb593cfd6 --- /dev/null +++ b/include/asm-um/pgtable-3level.h @@ -0,0 +1,172 @@ +/* + * Copyright 2003 PathScale Inc + * Derived from include/asm-i386/pgtable.h + * Licensed under the GPL + */ + +#ifndef __UM_PGTABLE_3LEVEL_H +#define __UM_PGTABLE_3LEVEL_H + +#include <asm-generic/pgtable-nopud.h> + +/* PGDIR_SHIFT determines what a third-level page table entry can map */ + +#define PGDIR_SHIFT 30 +#define PGDIR_SIZE (1UL << PGDIR_SHIFT) +#define PGDIR_MASK (~(PGDIR_SIZE-1)) + +/* PMD_SHIFT determines the size of the area a second-level page table can + * map + */ + +#define PMD_SHIFT 21 +#define PMD_SIZE (1UL << PMD_SHIFT) +#define PMD_MASK (~(PMD_SIZE-1)) + +/* + * entries per page directory level + */ + +#define PTRS_PER_PTE 512 +#define PTRS_PER_PMD 512 +#define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE) +#define PTRS_PER_PGD 512 +#define FIRST_USER_PGD_NR 0 + +#define pte_ERROR(e) \ + printk("%s:%d: bad pte %p(%016lx).\n", __FILE__, __LINE__, &(e), \ + pte_val(e)) +#define pmd_ERROR(e) \ + printk("%s:%d: bad pmd %p(%016lx).\n", __FILE__, __LINE__, &(e), \ + pmd_val(e)) +#define pgd_ERROR(e) \ + printk("%s:%d: bad pgd %p(%016lx).\n", __FILE__, __LINE__, &(e), \ + pgd_val(e)) + +#define pud_none(x) (!(pud_val(x) & ~_PAGE_NEWPAGE)) +#define pud_bad(x) ((pud_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) +#define pud_present(x) (pud_val(x) & _PAGE_PRESENT) +#define pud_populate(mm, pud, pmd) \ + set_pud(pud, __pud(_PAGE_TABLE + __pa(pmd))) + +#define set_pud(pudptr, pudval) set_64bit((phys_t *) (pudptr), pud_val(pudval)) +static inline int pgd_newpage(pgd_t pgd) +{ + return(pgd_val(pgd) & _PAGE_NEWPAGE); +} + +static inline void pgd_mkuptodate(pgd_t pgd) { pgd_val(pgd) &= ~_PAGE_NEWPAGE; } + + +#define pte_present(x) pte_get_bits(x, (_PAGE_PRESENT | _PAGE_PROTNONE)) + +static inline pte_t pte_mknewprot(pte_t pte) +{ + pte_set_bits(pte, _PAGE_NEWPROT); + return(pte); +} + +static inline pte_t pte_mknewpage(pte_t pte) +{ + pte_set_bits(pte, _PAGE_NEWPAGE); + return(pte); +} + +static inline void set_pte(pte_t *pteptr, pte_t pteval) +{ + pte_copy(*pteptr, pteval); + + /* If it's a swap entry, it needs to be marked _PAGE_NEWPAGE so + * fix_range knows to unmap it. _PAGE_NEWPROT is specific to + * mapped pages. + */ + + *pteptr = pte_mknewpage(*pteptr); + if(pte_present(*pteptr)) *pteptr = pte_mknewprot(*pteptr); +} + +#define set_pmd(pmdptr, pmdval) set_64bit((phys_t *) (pmdptr), pmd_val(pmdval)) + +static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) +{ + pmd_t *pmd = (pmd_t *) __get_free_page(GFP_KERNEL); + + if(pmd) + memset(pmd, 0, PAGE_SIZE); + + return pmd; +} + +static inline void pmd_free(pmd_t *pmd){ + free_page((unsigned long) pmd); +} + +#define __pmd_free_tlb(tlb,x) do { } while (0) + +static inline void pud_clear (pud_t * pud) { } + +#define pud_page(pud) \ + ((struct page *) __va(pud_val(pud) & PAGE_MASK)) + +/* Find an entry in the second-level page table.. */ +#define pmd_offset(pud, address) ((pmd_t *) pud_page(*(pud)) + \ + pmd_index(address)) + +#define pte_page(x) pfn_to_page(pte_pfn(x)) + +static inline int pte_none(pte_t pte) +{ + return pte_is_zero(pte); +} + +static inline unsigned long pte_pfn(pte_t pte) +{ + return phys_to_pfn(pte_val(pte)); +} + +static inline pte_t pfn_pte(pfn_t page_nr, pgprot_t pgprot) +{ + pte_t pte; + phys_t phys = pfn_to_phys(page_nr); + + pte_set_val(pte, phys, pgprot); + return pte; +} + +static inline pmd_t pfn_pmd(pfn_t page_nr, pgprot_t pgprot) +{ + return __pmd((page_nr << PAGE_SHIFT) | pgprot_val(pgprot)); +} + +/* + * Bits 0 through 3 are taken in the low part of the pte, + * put the 32 bits of offset into the high part. + */ +#define PTE_FILE_MAX_BITS 32 + +#ifdef CONFIG_64_BIT + +#define pte_to_pgoff(p) ((p).pte >> 32) + +#define pgoff_to_pte(off) ((pte_t) { ((off) < 32) | _PAGE_FILE }) + +#else + +#define pte_to_pgoff(pte) ((pte).pte_high) + +#define pgoff_to_pte(off) ((pte_t) { _PAGE_FILE, (off) }) + +#endif + +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h index a747f7dd4ff4..7f980a262334 100644 --- a/include/asm-um/pgtable.h +++ b/include/asm-um/pgtable.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) + * Copyright 2003 PathScale, Inc. * Derived from include/asm-i386/pgtable.h * Licensed under the GPL */ @@ -7,13 +8,29 @@ #ifndef __UM_PGTABLE_H #define __UM_PGTABLE_H -#include <asm-generic/4level-fixup.h> - #include "linux/sched.h" #include "asm/processor.h" #include "asm/page.h" #include "asm/fixmap.h" +#define _PAGE_PRESENT 0x001 +#define _PAGE_NEWPAGE 0x002 +#define _PAGE_NEWPROT 0x004 +#define _PAGE_FILE 0x008 /* set:pagecache unset:swap */ +#define _PAGE_PROTNONE 0x010 /* If not present */ +#define _PAGE_RW 0x020 +#define _PAGE_USER 0x040 +#define _PAGE_ACCESSED 0x080 +#define _PAGE_DIRTY 0x100 + +#ifdef CONFIG_3_LEVEL_PGTABLES +#include "asm/pgtable-3level.h" +#else +#include "asm/pgtable-2level.h" +#endif + +extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; + extern void *um_virt_to_phys(struct task_struct *task, unsigned long virt, pte_t *pte_out); @@ -22,35 +39,6 @@ extern unsigned long *empty_zero_page; #define pgtable_cache_init() do ; while (0) -/* PMD_SHIFT determines the size of the area a second-level page table can map */ -#define PMD_SHIFT 22 -#define PMD_SIZE (1UL << PMD_SHIFT) -#define PMD_MASK (~(PMD_SIZE-1)) - -/* PGDIR_SHIFT determines what a third-level page table entry can map */ -#define PGDIR_SHIFT 22 -#define PGDIR_SIZE (1UL << PGDIR_SHIFT) -#define PGDIR_MASK (~(PGDIR_SIZE-1)) - -/* - * entries per page directory level: the i386 is two-level, so - * we don't really have any PMD directory physically. - */ -#define PTRS_PER_PTE 1024 -#define PTRS_PER_PMD 1 -#define PTRS_PER_PGD 1024 -#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) -#define FIRST_USER_PGD_NR 0 - -#define pte_ERROR(e) \ - printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) -#define pmd_ERROR(e) \ - printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e)) -#define pgd_ERROR(e) \ - printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) - -extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; - /* * pgd entries used up by user/kernel: */ @@ -70,7 +58,7 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; extern unsigned long end_iomem; #define VMALLOC_OFFSET (__va_space) -#define VMALLOC_START ((end_iomem + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) +#define VMALLOC_START ((end_iomem + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) #ifdef CONFIG_HIGHMEM # define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) @@ -78,18 +66,8 @@ extern unsigned long end_iomem; # define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE) #endif -#define _PAGE_PRESENT 0x001 -#define _PAGE_NEWPAGE 0x002 -#define _PAGE_NEWPROT 0x004 -#define _PAGE_FILE 0x008 /* set:pagecache unset:swap */ -#define _PAGE_PROTNONE 0x010 /* If not present */ -#define _PAGE_RW 0x020 -#define _PAGE_USER 0x040 -#define _PAGE_ACCESSED 0x080 -#define _PAGE_DIRTY 0x100 - -#define REGION_MASK 0xf0000000 -#define REGION_SHIFT 28 +#define REGION_SHIFT (sizeof(pte_t) * 8 - 4) +#define REGION_MASK (((unsigned long) 0xf) << REGION_SHIFT) #define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY) #define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY) @@ -157,16 +135,13 @@ extern pte_t * __bad_pagetable(void); /* sizeof(void*)==1<<SIZEOF_PTR_LOG2 */ /* 64-bit machines, beware! SRB. */ -#define SIZEOF_PTR_LOG2 2 +#define SIZEOF_PTR_LOG2 3 /* to find an entry in a page-table */ #define PAGE_PTR(address) \ ((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK) -#define pte_none(x) !(pte_val(x) & ~_PAGE_NEWPAGE) -#define pte_present(x) (pte_val(x) & (_PAGE_PRESENT | _PAGE_PROTNONE)) - -#define pte_clear(xp) do { pte_val(*(xp)) = _PAGE_NEWPAGE; } while (0) +#define pte_clear(xp) pte_set_val(*(xp), (phys_t) 0, __pgprot(_PAGE_NEWPAGE)) #define pmd_none(x) (!(pmd_val(x) & ~_PAGE_NEWPAGE)) #define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) @@ -176,67 +151,22 @@ extern pte_t * __bad_pagetable(void); #define pmd_newpage(x) (pmd_val(x) & _PAGE_NEWPAGE) #define pmd_mkuptodate(x) (pmd_val(x) &= ~_PAGE_NEWPAGE) -/* - * The "pgd_xxx()" functions here are trivial for a folded two-level - * setup: the pgd is never bad, and a pmd always exists (as it's folded - * into the pgd entry) - */ -static inline int pgd_none(pgd_t pgd) { return 0; } -static inline int pgd_bad(pgd_t pgd) { return 0; } -static inline int pgd_present(pgd_t pgd) { return 1; } -static inline void pgd_clear(pgd_t * pgdp) { } - - -#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) +#define pud_newpage(x) (pud_val(x) & _PAGE_NEWPAGE) +#define pud_mkuptodate(x) (pud_val(x) &= ~_PAGE_NEWPAGE) -#define pte_page(pte) phys_to_page(pte_val(pte)) -#define pmd_page(pmd) phys_to_page(pmd_val(pmd) & PAGE_MASK) - -#define pte_pfn(x) phys_to_pfn(pte_val(x)) -#define pfn_pte(pfn, prot) __pte(pfn_to_phys(pfn) | pgprot_val(prot)) - -extern struct page *phys_to_page(const unsigned long phys); -extern struct page *__virt_to_page(const unsigned long virt); -#define virt_to_page(addr) __virt_to_page((const unsigned long) addr) - -/* - * Bits 0 through 3 are taken - */ -#define PTE_FILE_MAX_BITS 28 - -#define pte_to_pgoff(pte) ((pte).pte_low >> 4) - -#define pgoff_to_pte(off) \ - ((pte_t) { ((off) << 4) + _PAGE_FILE }) - -static inline pte_t pte_mknewprot(pte_t pte) +static inline pud_t *__pud_alloc(struct mm_struct *mm, pgd_t *pgd, + unsigned long addr) { - pte_val(pte) |= _PAGE_NEWPROT; - return(pte); + BUG(); } -static inline pte_t pte_mknewpage(pte_t pte) -{ - pte_val(pte) |= _PAGE_NEWPAGE; - return(pte); -} +#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT)) -static inline void set_pte(pte_t *pteptr, pte_t pteval) -{ - /* If it's a swap entry, it needs to be marked _PAGE_NEWPAGE so - * fix_range knows to unmap it. _PAGE_NEWPROT is specific to - * mapped pages. - */ - *pteptr = pte_mknewpage(pteval); - if(pte_present(*pteptr)) *pteptr = pte_mknewprot(*pteptr); -} +#define pmd_page(pmd) phys_to_page(pmd_val(pmd) & PAGE_MASK) -/* - * (pmds are folded into pgds so this doesn't get actually called, - * but the define is needed for a generic inline function.) - */ -#define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval) -#define set_pgd(pgdptr, pgdval) (*(pgdptr) = pgdval) +#define pte_address(x) (__va(pte_val(x) & PAGE_MASK)) +#define mk_phys(a, r) ((a) + (((unsigned long) r) << REGION_SHIFT)) +#define phys_addr(p) ((p) & ~REGION_MASK) /* * The following only work if pte_present() is true. @@ -244,25 +174,25 @@ static inline void set_pte(pte_t *pteptr, pte_t pteval) */ static inline int pte_user(pte_t pte) { - return((pte_val(pte) & _PAGE_USER) && - !(pte_val(pte) & _PAGE_PROTNONE)); + return((pte_get_bits(pte, _PAGE_USER)) && + !(pte_get_bits(pte, _PAGE_PROTNONE))); } static inline int pte_read(pte_t pte) { - return((pte_val(pte) & _PAGE_USER) && - !(pte_val(pte) & _PAGE_PROTNONE)); + return((pte_get_bits(pte, _PAGE_USER)) && + !(pte_get_bits(pte, _PAGE_PROTNONE))); } static inline int pte_exec(pte_t pte){ - return((pte_val(pte) & _PAGE_USER) && - !(pte_val(pte) & _PAGE_PROTNONE)); + return((pte_get_bits(pte, _PAGE_USER)) && + !(pte_get_bits(pte, _PAGE_PROTNONE))); } static inline int pte_write(pte_t pte) { - return((pte_val(pte) & _PAGE_RW) && - !(pte_val(pte) & _PAGE_PROTNONE)); + return((pte_get_bits(pte, _PAGE_RW)) && + !(pte_get_bits(pte, _PAGE_PROTNONE))); } /* @@ -270,85 +200,98 @@ static inline int pte_write(pte_t pte) */ static inline int pte_file(pte_t pte) { - return (pte).pte_low & _PAGE_FILE; + return pte_get_bits(pte, _PAGE_FILE); +} + +static inline int pte_dirty(pte_t pte) +{ + return pte_get_bits(pte, _PAGE_DIRTY); +} + +static inline int pte_young(pte_t pte) +{ + return pte_get_bits(pte, _PAGE_ACCESSED); +} + +static inline int pte_newpage(pte_t pte) +{ + return pte_get_bits(pte, _PAGE_NEWPAGE); } -static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } -static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } -static inline int pte_newpage(pte_t pte) { return pte_val(pte) & _PAGE_NEWPAGE; } static inline int pte_newprot(pte_t pte) { - return(pte_present(pte) && (pte_val(pte) & _PAGE_NEWPROT)); + return(pte_present(pte) && (pte_get_bits(pte, _PAGE_NEWPROT))); } static inline pte_t pte_rdprotect(pte_t pte) { - pte_val(pte) &= ~_PAGE_USER; + pte_clear_bits(pte, _PAGE_USER); return(pte_mknewprot(pte)); } static inline pte_t pte_exprotect(pte_t pte) { - pte_val(pte) &= ~_PAGE_USER; + pte_clear_bits(pte, _PAGE_USER); return(pte_mknewprot(pte)); } static inline pte_t pte_mkclean(pte_t pte) { - pte_val(pte) &= ~_PAGE_DIRTY; + pte_clear_bits(pte, _PAGE_DIRTY); return(pte); } static inline pte_t pte_mkold(pte_t pte) { - pte_val(pte) &= ~_PAGE_ACCESSED; + pte_clear_bits(pte, _PAGE_ACCESSED); return(pte); } static inline pte_t pte_wrprotect(pte_t pte) { - pte_val(pte) &= ~_PAGE_RW; + pte_clear_bits(pte, _PAGE_RW); return(pte_mknewprot(pte)); } static inline pte_t pte_mkread(pte_t pte) { - pte_val(pte) |= _PAGE_USER; + pte_set_bits(pte, _PAGE_RW); return(pte_mknewprot(pte)); } static inline pte_t pte_mkexec(pte_t pte) { - pte_val(pte) |= _PAGE_USER; + pte_set_bits(pte, _PAGE_USER); return(pte_mknewprot(pte)); } static inline pte_t pte_mkdirty(pte_t pte) { - pte_val(pte) |= _PAGE_DIRTY; + pte_set_bits(pte, _PAGE_DIRTY); return(pte); } static inline pte_t pte_mkyoung(pte_t pte) { - pte_val(pte) |= _PAGE_ACCESSED; + pte_set_bits(pte, _PAGE_ACCESSED); return(pte); } static inline pte_t pte_mkwrite(pte_t pte) { - pte_val(pte) |= _PAGE_RW; + pte_set_bits(pte, _PAGE_RW); return(pte_mknewprot(pte)); } static inline pte_t pte_mkuptodate(pte_t pte) { - pte_val(pte) &= ~_PAGE_NEWPAGE; - if(pte_present(pte)) pte_val(pte) &= ~_PAGE_NEWPROT; + pte_clear_bits(pte, _PAGE_NEWPAGE); + if(pte_present(pte)) + pte_clear_bits(pte, _PAGE_NEWPROT); return(pte); } -extern unsigned long page_to_phys(struct page *page); +extern phys_t page_to_phys(struct page *page); /* * Conversion functions: convert a page and protection to a page entry, @@ -357,11 +300,9 @@ extern unsigned long page_to_phys(struct page *page); extern pte_t mk_pte(struct page *page, pgprot_t pgprot); -#define pte_set_val(p, phys, prot) pte_val(p) = (phys | pgprot_val(prot)) - static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) { - pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); + pte_set_val(pte, (pte_val(pte) & _PAGE_CHG_MASK), newprot); if(pte_present(pte)) pte = pte_mknewpage(pte_mknewprot(pte)); return pte; } @@ -374,15 +315,15 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) * this macro returns the index of the entry in the pgd page which would * control the given virtual address */ -#define pgd_index(address) ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) +#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) + +#define pgd_index_k(addr) pgd_index(addr) /* * pgd_offset() returns a (pgd_t *) * pgd_index() is used get the offset into the pgd page's array of pgd_t's; */ -#define pgd_offset(mm, address) \ -((mm)->pgd + ((address) >> PGDIR_SHIFT)) - +#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address)) /* * a shortcut which implies the use of the kernel's pgd, instead @@ -390,14 +331,13 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) */ #define pgd_offset_k(address) pgd_offset(&init_mm, address) -#define pmd_index(address) \ - (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) - -/* Find an entry in the second-level page table.. */ -static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address) -{ - return (pmd_t *) dir; -} +/* + * the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD] + * + * this macro returns the index of the entry in the pmd page which would + * control the given virtual address + */ +#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) /* * the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE] @@ -430,9 +370,15 @@ static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address) #include <asm-generic/pgtable.h> -#endif +#include <asm-generic/pgtable-nopud.h> #endif +#endif + +extern struct page *phys_to_page(const unsigned long phys); +extern struct page *__virt_to_page(const unsigned long virt); +#define virt_to_page(addr) __virt_to_page((const unsigned long) addr) + /* * Overrides for Emacs so that we follow Linus's tabbing style. * Emacs will notice this stuff at the end of the file and automatically diff --git a/include/asm-um/prctl.h b/include/asm-um/prctl.h new file mode 100644 index 000000000000..64b6d099bdd5 --- /dev/null +++ b/include/asm-um/prctl.h @@ -0,0 +1,6 @@ +#ifndef __UM_PRCTL_H +#define __UM_PRCTL_H + +#include "asm/arch/prctl.h" + +#endif diff --git a/include/asm-um/processor-i386.h b/include/asm-um/processor-i386.h index b276481cc6cb..cb44bb56836f 100644 --- a/include/asm-um/processor-i386.h +++ b/include/asm-um/processor-i386.h @@ -24,7 +24,8 @@ struct arch_thread { * instruction pointer ("program counter"). Stolen * from asm-i386/processor.h */ -#define current_text_addr() ({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; }) +#define current_text_addr() \ + ({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; }) #include "asm/processor-generic.h" diff --git a/include/asm-um/processor-x86_64.h b/include/asm-um/processor-x86_64.h new file mode 100644 index 000000000000..0b8d4e2d8efc --- /dev/null +++ b/include/asm-um/processor-x86_64.h @@ -0,0 +1,33 @@ +/* + * Copyright 2003 PathScale, Inc. + * + * Licensed under the GPL + */ + +#ifndef __UM_PROCESSOR_X86_64_H +#define __UM_PROCESSOR_X86_64_H + +#include "asm/arch/user.h" + +struct arch_thread { +}; + +#define INIT_ARCH_THREAD { } + +#define current_text_addr() \ + ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; }) + +#include "asm/processor-generic.h" + +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/include/asm-um/ptrace-generic.h b/include/asm-um/ptrace-generic.h index a1bb25f8e85b..46599ac44037 100644 --- a/include/asm-um/ptrace-generic.h +++ b/include/asm-um/ptrace-generic.h @@ -12,16 +12,17 @@ #define pt_regs pt_regs_subarch #define show_regs show_regs_subarch +#define send_sigtrap send_sigtrap_subarch #include "asm/arch/ptrace.h" #undef pt_regs #undef show_regs +#undef send_sigtrap #undef user_mode #undef instruction_pointer #include "sysdep/ptrace.h" -#include "skas_ptrace.h" struct pt_regs { union uml_pt_regs regs; @@ -56,6 +57,9 @@ extern int set_fpxregs(unsigned long buf, struct task_struct *tsk); extern void show_regs(struct pt_regs *regs); +extern void send_sigtrap(struct task_struct *tsk, union uml_pt_regs *regs, + int error_code); + #endif #endif diff --git a/include/asm-um/ptrace-x86_64.h b/include/asm-um/ptrace-x86_64.h new file mode 100644 index 000000000000..c34be39b78b2 --- /dev/null +++ b/include/asm-um/ptrace-x86_64.h @@ -0,0 +1,75 @@ +/* + * Copyright 2003 PathScale, Inc. + * + * Licensed under the GPL + */ + +#ifndef __UM_PTRACE_X86_64_H +#define __UM_PTRACE_X86_64_H + +#include "linux/compiler.h" + +#define signal_fault signal_fault_x86_64 +#define __FRAME_OFFSETS /* Needed to get the R* macros */ +#include "asm/ptrace-generic.h" +#undef signal_fault + +void signal_fault(struct pt_regs_subarch *regs, void *frame, char *where); + +#define FS_BASE (21 * sizeof(unsigned long)) +#define GS_BASE (22 * sizeof(unsigned long)) +#define DS (23 * sizeof(unsigned long)) +#define ES (24 * sizeof(unsigned long)) +#define FS (25 * sizeof(unsigned long)) +#define GS (26 * sizeof(unsigned long)) + +#define PT_REGS_RBX(r) UPT_RBX(&(r)->regs) +#define PT_REGS_RCX(r) UPT_RCX(&(r)->regs) +#define PT_REGS_RDX(r) UPT_RDX(&(r)->regs) +#define PT_REGS_RSI(r) UPT_RSI(&(r)->regs) +#define PT_REGS_RDI(r) UPT_RDI(&(r)->regs) +#define PT_REGS_RBP(r) UPT_RBP(&(r)->regs) +#define PT_REGS_RAX(r) UPT_RAX(&(r)->regs) +#define PT_REGS_R8(r) UPT_R8(&(r)->regs) +#define PT_REGS_R9(r) UPT_R9(&(r)->regs) +#define PT_REGS_R10(r) UPT_R10(&(r)->regs) +#define PT_REGS_R11(r) UPT_R11(&(r)->regs) +#define PT_REGS_R12(r) UPT_R12(&(r)->regs) +#define PT_REGS_R13(r) UPT_R13(&(r)->regs) +#define PT_REGS_R14(r) UPT_R14(&(r)->regs) +#define PT_REGS_R15(r) UPT_R15(&(r)->regs) + +#define PT_REGS_FS(r) UPT_FS(&(r)->regs) +#define PT_REGS_GS(r) UPT_GS(&(r)->regs) +#define PT_REGS_DS(r) UPT_DS(&(r)->regs) +#define PT_REGS_ES(r) UPT_ES(&(r)->regs) +#define PT_REGS_SS(r) UPT_SS(&(r)->regs) +#define PT_REGS_CS(r) UPT_CS(&(r)->regs) + +#define PT_REGS_ORIG_RAX(r) UPT_ORIG_RAX(&(r)->regs) +#define PT_REGS_RIP(r) UPT_IP(&(r)->regs) +#define PT_REGS_RSP(r) UPT_SP(&(r)->regs) + +#define PT_REGS_EFLAGS(r) UPT_EFLAGS(&(r)->regs) + +/* XXX */ +#define user_mode(r) UPT_IS_USER(&(r)->regs) +#define PT_REGS_ORIG_SYSCALL(r) PT_REGS_RAX(r) +#define PT_REGS_SYSCALL_RET(r) PT_REGS_RAX(r) + +#define PT_FIX_EXEC_STACK(sp) do ; while(0) + +#define profile_pc(regs) PT_REGS_IP(regs) + +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/include/asm-um/sigcontext-x86_64.h b/include/asm-um/sigcontext-x86_64.h new file mode 100644 index 000000000000..b600e0b01e48 --- /dev/null +++ b/include/asm-um/sigcontext-x86_64.h @@ -0,0 +1,22 @@ +/* Copyright 2003 PathScale, Inc. + * + * Licensed under the GPL + */ + +#ifndef __UM_SIGCONTEXT_X86_64_H +#define __UM_SIGCONTEXT_X86_64_H + +#include "asm/sigcontext-generic.h" + +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/include/asm-um/system-x86_64.h b/include/asm-um/system-x86_64.h new file mode 100644 index 000000000000..e1b61b580734 --- /dev/null +++ b/include/asm-um/system-x86_64.h @@ -0,0 +1,23 @@ +/* + * Copyright 2003 PathScale, Inc. + * + * Licensed under the GPL + */ + +#ifndef __UM_SYSTEM_X86_64_H +#define __UM_SYSTEM_X86_64_H + +#include "asm/system-generic.h" + +#endif + +/* + * Overrides for Emacs so that we follow Linus's tabbing style. + * Emacs will notice this stuff at the end of the file and automatically + * adjust the settings for this buffer only. This must remain at the end + * of the file. + * --------------------------------------------------------------------------- + * Local variables: + * c-file-style: "linux" + * End: + */ diff --git a/include/asm-um/thread_info.h b/include/asm-um/thread_info.h index 6550ed4355c2..7797873890c2 100644 --- a/include/asm-um/thread_info.h +++ b/include/asm-um/thread_info.h @@ -47,7 +47,7 @@ static inline struct thread_info *current_thread_info(void) struct thread_info *ti; unsigned long mask = PAGE_SIZE * (1 << CONFIG_KERNEL_STACK_ORDER) - 1; - __asm__("andl %%esp,%0; ":"=r" (ti) : "0" (~mask)); + ti = (struct thread_info *) (((unsigned long) &ti) & ~mask); return ti; } diff --git a/include/asm-um/uaccess.h b/include/asm-um/uaccess.h index d42d5f8dcdfd..801710d00a40 100644 --- a/include/asm-um/uaccess.h +++ b/include/asm-um/uaccess.h @@ -55,7 +55,7 @@ #define get_user(x, ptr) \ ({ \ - const __typeof__((*(ptr))) *private_ptr = (ptr); \ + const __typeof__((*(ptr))) __user *private_ptr = (ptr); \ (access_ok(VERIFY_READ, private_ptr, sizeof(*private_ptr)) ? \ __get_user(x, private_ptr) : ((x) = 0, -EFAULT)); \ }) @@ -75,7 +75,7 @@ #define put_user(x, ptr) \ ({ \ - __typeof__(*(ptr)) *private_ptr = (ptr); \ + __typeof__(*(ptr)) __user *private_ptr = (ptr); \ (access_ok(VERIFY_WRITE, private_ptr, sizeof(*private_ptr)) ? \ __put_user(x, private_ptr) : -EFAULT); \ }) diff --git a/include/asm-um/vm-flags-i386.h b/include/asm-um/vm-flags-i386.h new file mode 100644 index 000000000000..e0d24c568dbc --- /dev/null +++ b/include/asm-um/vm-flags-i386.h @@ -0,0 +1,14 @@ +/* + * Copyright (C) 2004 Jeff Dike (jdike@addtoit.com) + * Licensed under the GPL + */ + +#ifndef __VM_FLAGS_I386_H +#define __VM_FLAGS_I386_H + +#define VM_DATA_DEFAULT_FLAGS \ + (VM_READ | VM_WRITE | \ + ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + +#endif diff --git a/include/asm-um/vm-flags-x86_64.h b/include/asm-um/vm-flags-x86_64.h new file mode 100644 index 000000000000..3213edfa7888 --- /dev/null +++ b/include/asm-um/vm-flags-x86_64.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2004 Jeff Dike (jdike@addtoit.com) + * Copyright 2003 PathScale, Inc. + * Licensed under the GPL + */ + +#ifndef __VM_FLAGS_X86_64_H +#define __VM_FLAGS_X86_64_H + +#define __VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) +#define __VM_STACK_FLAGS (VM_GROWSDOWN | VM_READ | VM_WRITE | \ + VM_EXEC | VM_MAYREAD | VM_MAYWRITE | \ + VM_MAYEXEC) + +extern unsigned long vm_stack_flags, vm_stack_flags32; +extern unsigned long vm_data_default_flags, vm_data_default_flags32; +extern unsigned long vm_force_exec32; + +#ifdef TIF_IA32 +#define VM_DATA_DEFAULT_FLAGS \ + (test_thread_flag(TIF_IA32) ? vm_data_default_flags32 : \ + vm_data_default_flags) + +#define VM_STACK_DEFAULT_FLAGS \ + (test_thread_flag(TIF_IA32) ? vm_stack_flags32 : vm_stack_flags) +#endif + +#define VM_DATA_DEFAULT_FLAGS vm_data_default_flags + +#define VM_STACK_DEFAULT_FLAGS vm_stack_flags + +#endif diff --git a/include/asm-v850/cputime.h b/include/asm-v850/cputime.h new file mode 100644 index 000000000000..7c799c33b8a9 --- /dev/null +++ b/include/asm-v850/cputime.h @@ -0,0 +1,6 @@ +#ifndef __V850_CPUTIME_H +#define __V850_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __V850_CPUTIME_H */ diff --git a/include/asm-x86_64/cputime.h b/include/asm-x86_64/cputime.h new file mode 100644 index 000000000000..a07012dc5a3c --- /dev/null +++ b/include/asm-x86_64/cputime.h @@ -0,0 +1,6 @@ +#ifndef __X86_64_CPUTIME_H +#define __X86_64_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __X86_64_CPUTIME_H */ diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h index 767e11abd5c5..2b5cb2865d21 100644 --- a/include/asm-x86_64/hw_irq.h +++ b/include/asm-x86_64/hw_irq.h @@ -87,8 +87,6 @@ extern u8 irq_vector[NR_IRQ_VECTORS]; * Interrupt entry/exit code at both C and assembly level */ -extern void mask_irq(unsigned int irq); -extern void unmask_irq(unsigned int irq); extern void disable_8259A_irq(unsigned int irq); extern void enable_8259A_irq(unsigned int irq); extern int i8259A_irq_pending(unsigned int irq); diff --git a/include/asm-x86_64/ia32_unistd.h b/include/asm-x86_64/ia32_unistd.h index 26e56c27fe18..f3b7111cf33d 100644 --- a/include/asm-x86_64/ia32_unistd.h +++ b/include/asm-x86_64/ia32_unistd.h @@ -290,7 +290,11 @@ #define __NR_ia32_mq_getsetattr (__NR_ia32_mq_open+5) #define __NR_ia32_kexec 283 #define __NR_ia32_waitid 284 +/* #define __NR_sys_setaltroot 285 */ +#define __NR_ia32_add_key 286 +#define __NR_ia32_request_key 287 +#define __NR_ia32_keyctl 288 -#define IA32_NR_syscalls 285 /* must be > than biggest syscall! */ +#define IA32_NR_syscalls 290 /* must be > than biggest syscall! */ #endif /* _ASM_X86_64_IA32_UNISTD_H_ */ diff --git a/include/asm-x86_64/io.h b/include/asm-x86_64/io.h index ce379aee7355..734db492e889 100644 --- a/include/asm-x86_64/io.h +++ b/include/asm-x86_64/io.h @@ -260,10 +260,8 @@ static inline void memcpy_toio(volatile void __iomem *to, const void *from, unsi { __memcpy_toio((unsigned long)to,from,len); } -static inline void memset_io(volatile void __iomem *a, int b, size_t c) -{ - memset((__force void *)a,b,c); -} + +void memset_io(volatile void __iomem *a, int b, size_t c); /* * ISA space is 'always mapped' on a typical x86 system, no need to diff --git a/include/asm-x86_64/msr.h b/include/asm-x86_64/msr.h index ed94245a5d4f..850695678419 100644 --- a/include/asm-x86_64/msr.h +++ b/include/asm-x86_64/msr.h @@ -67,7 +67,8 @@ : "=a" (low), "=d" (high) \ : "c" (counter)) -extern inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx) +extern inline void cpuid(int op, unsigned int *eax, unsigned int *ebx, + unsigned int *ecx, unsigned int *edx) { __asm__("cpuid" : "=a" (*eax), diff --git a/include/asm-x86_64/numa.h b/include/asm-x86_64/numa.h index 21843b35ef18..3574f604542b 100644 --- a/include/asm-x86_64/numa.h +++ b/include/asm-x86_64/numa.h @@ -8,7 +8,7 @@ struct node { u64 start,end; }; -extern int compute_hash_shift(struct node *nodes); +extern int compute_hash_shift(struct node *nodes, int numnodes); #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT)) diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h index e942ca5957e4..3bee3482389a 100644 --- a/include/asm-x86_64/proto.h +++ b/include/asm-x86_64/proto.h @@ -15,7 +15,7 @@ extern void pda_init(int); extern void early_idt_handler(void); extern void mcheck_init(struct cpuinfo_x86 *c); -extern void init_memory_mapping(void); +extern void init_memory_mapping(unsigned long start, unsigned long end); extern void system_call(void); extern int kernel_syscall(void); diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h index 406102dbf298..926e614e60d6 100644 --- a/include/asm-x86_64/uaccess.h +++ b/include/asm-x86_64/uaccess.h @@ -172,7 +172,7 @@ do { \ /* FIXME: this hack is definitely wrong -AK */ struct __large_struct { unsigned long buf[100]; }; -#define __m(x) (*(struct __large_struct *)(x)) +#define __m(x) (*(struct __large_struct __user *)(x)) /* * Tell gcc we read from memory instead of writing: this is because diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h index 506ec8d12e75..d9182e600b69 100644 --- a/include/asm-x86_64/unistd.h +++ b/include/asm-x86_64/unistd.h @@ -556,8 +556,14 @@ __SYSCALL(__NR_mq_getsetattr, sys_mq_getsetattr) __SYSCALL(__NR_kexec_load, sys_ni_syscall) #define __NR_waitid 247 __SYSCALL(__NR_waitid, sys_waitid) - -#define __NR_syscall_max __NR_waitid +#define __NR_add_key 248 +__SYSCALL(__NR_add_key, sys_add_key) +#define __NR_request_key 249 +__SYSCALL(__NR_request_key, sys_request_key) +#define __NR_keyctl 250 +__SYSCALL(__NR_keyctl, sys_keyctl) + +#define __NR_syscall_max __NR_keyctl #ifndef __NO_STUBS /* user-visible error numbers are in the range -1 - -4095 */ @@ -724,7 +730,7 @@ static inline long dup(unsigned int fd) } /* implemented in asm in arch/x86_64/kernel/entry.S */ -extern long execve(char *, char **, char **); +extern int execve(const char *, char * const *, char * const *); static inline long open(const char * filename, int flags, int mode) { diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h index bd4364daf948..7198f129e135 100644 --- a/include/linux/arcdevice.h +++ b/include/linux/arcdevice.h @@ -343,7 +343,6 @@ void arcnet_dump_packet(struct net_device *dev, int bufnum, char *desc, void arcnet_unregister_proto(struct ArcProto *proto); irqreturn_t arcnet_interrupt(int irq, void *dev_id, struct pt_regs *regs); -void arcdev_setup(struct net_device *dev); struct net_device *alloc_arcdev(char *name); void arcnet_rx(struct net_device *dev, int bufnum); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 1b7dc44bf3c1..5615a3c9e410 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -95,6 +95,7 @@ void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); struct request_list { int count[2]; + int starved[2]; mempool_t *rq_pool; wait_queue_head_t wait[2]; wait_queue_head_t drain; diff --git a/include/linux/coda.h b/include/linux/coda.h index 309cbbe35e67..bbc5afcd7db6 100644 --- a/include/linux/coda.h +++ b/include/linux/coda.h @@ -761,8 +761,8 @@ union coda_downcalls { struct ViceIoctl { void __user *in; /* Data to be transferred in */ void __user *out; /* Data to be transferred out */ - short in_size; /* Size of input buffer <= 2K */ - short out_size; /* Maximum size of output buffer, <= 2K */ + u_short in_size; /* Size of input buffer <= 2K */ + u_short out_size; /* Maximum size of output buffer, <= 2K */ }; struct PioctlData { diff --git a/include/linux/coda_proc.h b/include/linux/coda_proc.h index c061a22ed86d..0dc1b0458e75 100644 --- a/include/linux/coda_proc.h +++ b/include/linux/coda_proc.h @@ -72,26 +72,5 @@ struct coda_cache_inv_stats /* these global variables hold the actual statistics data */ extern struct coda_vfs_stats coda_vfs_stat; -extern struct coda_cache_inv_stats coda_cache_inv_stat; - -/* reset statistics to 0 */ -void reset_coda_vfs_stats( void ); -void reset_coda_cache_inv_stats( void ); - -/* like coda_dointvec, these functions are to be registered in the ctl_table - * data structure for /proc/sys/... files - */ -int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp, - void __user * buffer, size_t * lenp, loff_t * ppos ); -int do_reset_coda_cache_inv_stats( ctl_table * table, int write, - struct file * filp, void __user * buffer, - size_t * lenp, loff_t * ppos ); - -/* these functions are called to form the content of /proc/fs/coda/... files */ -int coda_vfs_stats_get_info( char * buffer, char ** start, off_t offset, - int length); -int coda_cache_inv_stats_get_info( char * buffer, char ** start, off_t offset, - int length); - #endif /* _CODA_PROC_H */ diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h index 0c767ffd6a0d..d539262a8f89 100644 --- a/include/linux/coda_psdev.h +++ b/include/linux/coda_psdev.h @@ -49,7 +49,7 @@ int venus_mkdir(struct super_block *sb, struct CodaFid *dirfid, const char *name, int length, struct CodaFid *newfid, struct coda_vattr *attrs); int venus_create(struct super_block *sb, struct CodaFid *dirfid, - const char *name, int length, int excl, int mode, dev_t rdev, + const char *name, int length, int excl, int mode, struct CodaFid *newfid, struct coda_vattr *attrs) ; int venus_rmdir(struct super_block *sb, struct CodaFid *dirfid, const char *name, int length); diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index a9a2a486234c..062049ca5c44 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h @@ -9,6 +9,8 @@ * to achieve effects such as fast scrolling by changing the origin. */ +struct vt_struct; + #define NPAR 16 struct vc_data { @@ -87,6 +89,7 @@ struct vc_data { struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */ unsigned long vc_uni_pagedir; unsigned long *vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */ + struct vt_struct *vc_vt; /* additional information is in vt_kern.h */ }; diff --git a/include/linux/device.h b/include/linux/device.h index 2c5d57283d5a..786e1591102b 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -61,7 +61,7 @@ struct bus_type { int (*match)(struct device * dev, struct device_driver * drv); int (*hotplug) (struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size); - int (*suspend)(struct device * dev, u32 state); + int (*suspend)(struct device * dev, pm_message_t state); int (*resume)(struct device * dev); }; diff --git a/include/linux/efs_vh.h b/include/linux/efs_vh.h index b3df61ef2eb2..8a11150c61fe 100644 --- a/include/linux/efs_vh.h +++ b/include/linux/efs_vh.h @@ -47,23 +47,6 @@ struct volume_header { struct pt_types { int pt_type; char *pt_name; -} sgi_pt_types[] = { - {0x00, "SGI vh"}, - {0x01, "SGI trkrepl"}, - {0x02, "SGI secrepl"}, - {0x03, "SGI raw"}, - {0x04, "SGI bsd"}, - {SGI_SYSV, "SGI sysv"}, - {0x06, "SGI vol"}, - {SGI_EFS, "SGI efs"}, - {0x08, "SGI lv"}, - {0x09, "SGI rlv"}, - {0x0A, "SGI xfs"}, - {0x0B, "SGI xfslog"}, - {0x0C, "SGI xlv"}, - {0x82, "Linux swap"}, - {0x83, "Linux native"}, - {0, NULL} }; #endif /* __EFS_VH_H__ */ diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index a45400d0a2f4..2789be67fbe9 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h @@ -793,25 +793,15 @@ extern void ext3_error (struct super_block *, const char *, const char *, ...) extern void __ext3_std_error (struct super_block *, const char *, int); extern void ext3_abort (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4))); -extern NORET_TYPE void ext3_panic (struct super_block *, const char *, - const char *, ...) - __attribute__ ((NORET_AND format (printf, 3, 4))); extern void ext3_warning (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4))); extern void ext3_update_dynamic_rev (struct super_block *sb); -extern void ext3_put_super (struct super_block *); -extern void ext3_write_super (struct super_block *); -extern void ext3_write_super_lockfs (struct super_block *); -extern void ext3_unlockfs (struct super_block *); -extern int ext3_remount (struct super_block *, int *, char *); -extern int ext3_statfs (struct super_block *, struct kstatfs *); #define ext3_std_error(sb, errno) \ do { \ if ((errno)) \ __ext3_std_error((sb), __FUNCTION__, (errno)); \ } while (0) -extern const char *ext3_decode_error(struct super_block *sb, int errno, char nbuf[16]); /* * Inodes and files operations diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h index 0380c1fbdab0..47445f93d4f7 100644 --- a/include/linux/ext3_jbd.h +++ b/include/linux/ext3_jbd.h @@ -46,8 +46,6 @@ EXT3_XATTR_TRANS_BLOCKS - 2 + \ 2*EXT3_QUOTA_TRANS_BLOCKS) -extern int ext3_writepage_trans_blocks(struct inode *inode); - /* Delete operations potentially hit one directory's namespace plus an * entire inode, plus arbitrary amounts of bitmap/indirection data. Be * generous. We can grow the delete transaction later if necessary. */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 31391d59ddc2..4d26f55c1299 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -68,8 +68,6 @@ extern int dir_notify_enable; #endif #define NR_FILE 8192 /* this can well be larger on a larger system */ -#define NR_RESERVED_FILES 10 /* reserved for root */ -#define NR_SUPER 256 #define MAY_EXEC 1 #define MAY_WRITE 2 @@ -1346,7 +1344,7 @@ static inline void invalidate_remote_inode(struct inode *inode) invalidate_inode_pages(inode->i_mapping); } extern int invalidate_inode_pages2(struct address_space *mapping); -extern void write_inode_now(struct inode *, int); +extern int write_inode_now(struct inode *, int); extern int filemap_fdatawrite(struct address_space *); extern int filemap_flush(struct address_space *); extern int filemap_fdatawait(struct address_space *); diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index ba0fcb34c8cd..ebc712e91066 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h @@ -4,6 +4,7 @@ #include <linux/config.h> #include <linux/smp_lock.h> #include <asm/hardirq.h> +#include <asm/system.h> /* * We put the hardirq and softirq counter into the preemption @@ -84,7 +85,22 @@ extern void synchronize_irq(unsigned int irq); #define nmi_enter() irq_enter() #define nmi_exit() sub_preempt_count(HARDIRQ_OFFSET) -#define irq_enter() add_preempt_count(HARDIRQ_OFFSET) +#ifndef CONFIG_VIRT_CPU_ACCOUNTING +static inline void account_user_vtime(struct task_struct *tsk) +{ +} + +static inline void account_system_vtime(struct task_struct *tsk) +{ +} +#endif + +#define irq_enter() \ + do { \ + account_system_vtime(current); \ + add_preempt_count(HARDIRQ_OFFSET); \ + } while (0) + extern void irq_exit(void); #endif /* LINUX_HARDIRQ_H */ diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 991831cff1da..d99e7aeb7d33 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -61,12 +61,30 @@ extern void enable_irq(unsigned int irq); * Temporary defines for UP kernels, until all code gets fixed. */ #ifndef CONFIG_SMP -# define cli() local_irq_disable() -# define sti() local_irq_enable() -# define save_flags(x) local_save_flags(x) -# define restore_flags(x) local_irq_restore(x) -# define save_and_cli(x) local_irq_save(x) -#endif +static inline void __deprecated cli(void) +{ + local_irq_disable(); +} +static inline void __deprecated sti(void) +{ + local_irq_enable(); +} +static inline void __deprecated save_flags(unsigned long *x) +{ + local_save_flags(*x); +} +#define save_flags(x) save_flags(&x); +static inline void __deprecated restore_flags(unsigned long x) +{ + local_irq_restore(x); +} + +static inline void __deprecated save_and_cli(unsigned long *x) +{ + local_irq_save(*x); +} +#define save_and_cli(x) save_and_cli(&x) +#endif /* CONFIG_SMP */ /* SoftIRQ primitives. */ #define local_bh_disable() \ diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 4594ccc4a7c1..dba27749b428 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h @@ -6,6 +6,7 @@ #include <linux/smp.h> #include <linux/threads.h> #include <linux/percpu.h> +#include <asm/cputime.h> /* * 'kernel_stat.h' contains the definitions needed for doing @@ -14,13 +15,14 @@ */ struct cpu_usage_stat { - u64 user; - u64 nice; - u64 system; - u64 softirq; - u64 irq; - u64 idle; - u64 iowait; + cputime64_t user; + cputime64_t nice; + cputime64_t system; + cputime64_t softirq; + cputime64_t irq; + cputime64_t idle; + cputime64_t iowait; + cputime64_t steal; }; struct kernel_stat { @@ -50,4 +52,8 @@ static inline int kstat_irqs(int irq) return sum; } +extern void account_user_time(struct task_struct *, cputime_t); +extern void account_system_time(struct task_struct *, int, cputime_t); +extern void account_steal_time(struct task_struct *, cputime_t); + #endif /* _LINUX_KERNEL_STAT_H */ diff --git a/include/linux/list.h b/include/linux/list.h index 7cad5322077c..dd7cd54fa831 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -326,8 +326,8 @@ static inline void list_splice_init(struct list_head *list, * @head: the head for your list. */ #define list_for_each(pos, head) \ - for (pos = (head)->next, prefetch(pos->next); pos != (head); \ - pos = pos->next, prefetch(pos->next)) + for (pos = (head)->next; prefetch(pos->next), pos != (head); \ + pos = pos->next) /** * __list_for_each - iterate over a list @@ -348,8 +348,8 @@ static inline void list_splice_init(struct list_head *list, * @head: the head for your list. */ #define list_for_each_prev(pos, head) \ - for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \ - pos = pos->prev, prefetch(pos->prev)) + for (pos = (head)->prev; prefetch(pos->prev), pos != (head); \ + pos = pos->prev) /** * list_for_each_safe - iterate over a list safe against removal of list entry @@ -368,11 +368,9 @@ static inline void list_splice_init(struct list_head *list, * @member: the name of the list_struct within the struct. */ #define list_for_each_entry(pos, head, member) \ - for (pos = list_entry((head)->next, typeof(*pos), member), \ - prefetch(pos->member.next); \ - &pos->member != (head); \ - pos = list_entry(pos->member.next, typeof(*pos), member), \ - prefetch(pos->member.next)) + for (pos = list_entry((head)->next, typeof(*pos), member); \ + prefetch(pos->member.next), &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member)) /** * list_for_each_entry_reverse - iterate backwards over list of given type. @@ -381,11 +379,9 @@ static inline void list_splice_init(struct list_head *list, * @member: the name of the list_struct within the struct. */ #define list_for_each_entry_reverse(pos, head, member) \ - for (pos = list_entry((head)->prev, typeof(*pos), member), \ - prefetch(pos->member.prev); \ - &pos->member != (head); \ - pos = list_entry(pos->member.prev, typeof(*pos), member), \ - prefetch(pos->member.prev)) + for (pos = list_entry((head)->prev, typeof(*pos), member); \ + prefetch(pos->member.prev), &pos->member != (head); \ + pos = list_entry(pos->member.prev, typeof(*pos), member)) /** * list_prepare_entry - prepare a pos entry for use as a start point in @@ -405,11 +401,9 @@ static inline void list_splice_init(struct list_head *list, * @member: the name of the list_struct within the struct. */ #define list_for_each_entry_continue(pos, head, member) \ - for (pos = list_entry(pos->member.next, typeof(*pos), member), \ - prefetch(pos->member.next); \ - &pos->member != (head); \ - pos = list_entry(pos->member.next, typeof(*pos), member), \ - prefetch(pos->member.next)) + for (pos = list_entry(pos->member.next, typeof(*pos), member); \ + prefetch(pos->member.next), &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member)) /** * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry @@ -434,8 +428,8 @@ static inline void list_splice_init(struct list_head *list, * as long as the traversal is guarded by rcu_read_lock(). */ #define list_for_each_rcu(pos, head) \ - for (pos = (head)->next, prefetch(pos->next); pos != (head); \ - pos = rcu_dereference(pos->next), prefetch(pos->next)) + for (pos = (head)->next; prefetch(pos->next), pos != (head); \ + pos = rcu_dereference(pos->next)) #define __list_for_each_rcu(pos, head) \ for (pos = (head)->next; pos != (head); \ @@ -467,12 +461,10 @@ static inline void list_splice_init(struct list_head *list, * as long as the traversal is guarded by rcu_read_lock(). */ #define list_for_each_entry_rcu(pos, head, member) \ - for (pos = list_entry((head)->next, typeof(*pos), member), \ - prefetch(pos->member.next); \ - &pos->member != (head); \ + for (pos = list_entry((head)->next, typeof(*pos), member); \ + prefetch(pos->member.next), &pos->member != (head); \ pos = rcu_dereference(list_entry(pos->member.next, \ - typeof(*pos), member)), \ - prefetch(pos->member.next)) + typeof(*pos), member))) /** @@ -486,8 +478,8 @@ static inline void list_splice_init(struct list_head *list, * as long as the traversal is guarded by rcu_read_lock(). */ #define list_for_each_continue_rcu(pos, head) \ - for ((pos) = (pos)->next, prefetch((pos)->next); (pos) != (head); \ - (pos) = rcu_dereference((pos)->next), prefetch((pos)->next)) + for ((pos) = (pos)->next; prefetch((pos)->next), (pos) != (head); \ + (pos) = rcu_dereference((pos)->next)) /* * Double linked lists with a single pointer list head. diff --git a/include/linux/lp.h b/include/linux/lp.h index 521bcd2fecb1..7059b6b9878a 100644 --- a/include/linux/lp.h +++ b/include/linux/lp.h @@ -186,12 +186,6 @@ struct lp_struct { */ #define LP_DELAY 50 -/* - * function prototypes - */ - -extern int lp_init(void); - #endif #endif diff --git a/include/linux/mm.h b/include/linux/mm.h index ee9817135376..75f5b8ed7231 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -711,6 +711,7 @@ static inline void vma_nonlinear_insert(struct vm_area_struct *vma, } /* mmap.c */ +extern int __vm_enough_memory(long pages, int cap_sys_admin); extern void vma_adjust(struct vm_area_struct *vma, unsigned long start, unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert); extern struct vm_area_struct *vma_merge(struct mm_struct *, diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index 4de843d94147..16475a23efa7 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h @@ -38,6 +38,8 @@ * * int first_node(mask) Number lowest set bit, or MAX_NUMNODES * int next_node(node, mask) Next node past 'node', or MAX_NUMNODES + * int first_unset_node(mask) First node not set in mask, or + * MAX_NUMNODES. * * nodemask_t nodemask_of_node(node) Return nodemask with bit 'node' set * NODE_MASK_ALL Initializer - all bits set @@ -235,6 +237,13 @@ static inline int __next_node(int n, const nodemask_t *srcp, int nbits) m; \ }) +#define first_unset_node(mask) __first_unset_node(&(mask)) +static inline int __first_unset_node(const nodemask_t *maskp) +{ + return min_t(int,MAX_NUMNODES, + find_first_zero_bit(maskp->bits, MAX_NUMNODES)); +} + #define NODE_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(MAX_NUMNODES) #if MAX_NUMNODES <= BITS_PER_LONG diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index f36775e68710..791a795862c2 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -693,7 +693,7 @@ #define PCI_DEVICE_ID_HP_SX1000_IOC 0x127c #define PCI_DEVICE_ID_HP_DIVA_EVEREST 0x1282 #define PCI_DEVICE_ID_HP_DIVA_AUX 0x1290 -#define PCI_DEVICE_ID_HP_CISS 0x3210 +#define PCI_DEVICE_ID_HP_CISSA 0x3220 #define PCI_VENDOR_ID_PCTECH 0x1042 #define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000 diff --git a/include/linux/pm.h b/include/linux/pm.h index 68da2eae8547..1d106a3edad5 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -28,44 +28,28 @@ #include <asm/atomic.h> /* - * Power management requests + * Power management requests... these are passed to pm_send_all() and friends. + * + * these functions are old and deprecated, see below. */ -enum -{ - PM_SUSPEND, /* enter D1-D3 */ - PM_RESUME, /* enter D0 */ +typedef int __bitwise pm_request_t; - PM_SAVE_STATE, /* save device's state */ +#define PM_SUSPEND ((__force pm_request_t) 1) /* enter D1-D3 */ +#define PM_RESUME ((__force pm_request_t) 2) /* enter D0 */ - /* enable wake-on */ - PM_SET_WAKEUP, - - /* bus resource management */ - PM_GET_RESOURCES, - PM_SET_RESOURCES, - - /* base station management */ - PM_EJECT, - PM_LOCK, -}; - -typedef int pm_request_t; /* - * Device types + * Device types... these are passed to pm_register */ -enum -{ - PM_UNKNOWN_DEV = 0, /* generic */ - PM_SYS_DEV, /* system device (fan, KB controller, ...) */ - PM_PCI_DEV, /* PCI device */ - PM_USB_DEV, /* USB device */ - PM_SCSI_DEV, /* SCSI device */ - PM_ISA_DEV, /* ISA device */ - PM_MTD_DEV, /* Memory Technology Device */ -}; +typedef int __bitwise pm_dev_t; -typedef int pm_dev_t; +#define PM_UNKNOWN_DEV ((__force pm_dev_t) 0) /* generic */ +#define PM_SYS_DEV ((__force pm_dev_t) 1) /* system device (fan, KB controller, ...) */ +#define PM_PCI_DEV ((__force pm_dev_t) 2) /* PCI device */ +#define PM_USB_DEV ((__force pm_dev_t) 3) /* USB device */ +#define PM_SCSI_DEV ((__force pm_dev_t) 4) /* SCSI device */ +#define PM_ISA_DEV ((__force pm_dev_t) 5) /* ISA device */ +#define PM_MTD_DEV ((__force pm_dev_t) 6) /* Memory Technology Device */ /* * System device hardware ID (PnP) values @@ -119,32 +103,27 @@ extern int pm_active; /* * Register a device with power management */ -struct pm_dev *pm_register(pm_dev_t type, - unsigned long id, - pm_callback callback); +struct pm_dev __deprecated *pm_register(pm_dev_t type, unsigned long id, pm_callback callback); /* * Unregister a device with power management */ -void pm_unregister(struct pm_dev *dev); +void __deprecated pm_unregister(struct pm_dev *dev); /* * Unregister all devices with matching callback */ -void pm_unregister_all(pm_callback callback); +void __deprecated pm_unregister_all(pm_callback callback); /* * Send a request to a single device */ -int pm_send(struct pm_dev *dev, pm_request_t rqst, void *data); +int __deprecated pm_send(struct pm_dev *dev, pm_request_t rqst, void *data); /* * Send a request to all devices */ -int pm_send_all(pm_request_t rqst, void *data); - -static inline void pm_access(struct pm_dev *dev) {} -static inline void pm_dev_idle(struct pm_dev *dev) {} +int __deprecated pm_send_all(pm_request_t rqst, void *data); #else /* CONFIG_PM */ @@ -171,16 +150,10 @@ static inline int pm_send_all(pm_request_t rqst, void *data) return 0; } -static inline struct pm_dev *pm_find(pm_dev_t type, struct pm_dev *from) -{ - return 0; -} - -static inline void pm_access(struct pm_dev *dev) {} -static inline void pm_dev_idle(struct pm_dev *dev) {} - #endif /* CONFIG_PM */ +/* Functions above this comment are list-based old-style power + * managment. Please avoid using them. */ /* * Callbacks for platform drivers to implement. @@ -222,10 +195,34 @@ extern int pm_suspend(suspend_state_t state); struct device; +typedef u32 __bitwise pm_message_t; + +/* + * There are 4 important states driver can be in: + * ON -- driver is working + * FREEZE -- stop operations and apply whatever policy is applicable to a suspended driver + * of that class, freeze queues for block like IDE does, drop packets for + * ethernet, etc... stop DMA engine too etc... so a consistent image can be + * saved; but do not power any hardware down. + * SUSPEND - like FREEZE, but hardware is doing as much powersaving as possible. Roughly + * pci D3. + * + * Unfortunately, current drivers only recognize numeric values 0 (ON) and 3 (SUSPEND). + * We'll need to fix the drivers. So yes, putting 3 to all diferent defines is intentional, + * and will go away as soon as drivers are fixed. Also note that typedef is neccessary, + * we'll probably want to switch to + * typedef struct pm_message_t { int event; int flags; } pm_message_t + * or something similar soon. + */ + +#define PMSG_FREEZE ((__force pm_message_t) 3) +#define PMSG_SUSPEND ((__force pm_message_t) 3) +#define PMSG_ON ((__force pm_message_t) 0) + struct dev_pm_info { - u32 power_state; + pm_message_t power_state; #ifdef CONFIG_PM - u32 prev_state; + pm_message_t prev_state; void * saved_state; atomic_t pm_users; struct device * pm_parent; @@ -235,8 +232,8 @@ struct dev_pm_info { extern void device_pm_set_parent(struct device * dev, struct device * parent); -extern int device_suspend(u32 state); -extern int device_power_down(u32 state); +extern int device_suspend(pm_message_t state); +extern int device_power_down(pm_message_t state); extern void device_power_up(void); extern void device_resume(void); diff --git a/include/linux/sched.h b/include/linux/sched.h index 3c2c63f23a4a..96f69aaa0534 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -20,6 +20,7 @@ #include <asm/page.h> #include <asm/ptrace.h> #include <asm/mmu.h> +#include <asm/cputime.h> #include <linux/smp.h> #include <linux/sem.h> @@ -120,6 +121,9 @@ extern unsigned long nr_iowait(void); #define set_current_state(state_value) \ set_mb(current->state, (state_value)) +/* Task command name length */ +#define TASK_COMM_LEN 16 + /* * Scheduling policies */ @@ -168,7 +172,7 @@ long io_schedule_timeout(long timeout); extern void cpu_init (void); extern void trap_init(void); extern void update_process_times(int user); -extern void scheduler_tick(int user_tick, int system); +extern void scheduler_tick(void); extern unsigned long cache_decay_ticks; /* Attach to any functions which should be ignored in wchan output. */ @@ -311,7 +315,7 @@ struct signal_struct { * Live threads maintain their own counters and add to these * in __exit_signal, except for the group leader. */ - unsigned long utime, stime, cutime, cstime; + cputime_t utime, stime, cutime, cstime; unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; @@ -589,10 +593,11 @@ struct task_struct { int __user *clear_child_tid; /* CLONE_CHILD_CLEARTID */ unsigned long rt_priority; - unsigned long it_real_value, it_prof_value, it_virt_value; - unsigned long it_real_incr, it_prof_incr, it_virt_incr; + unsigned long it_real_value, it_real_incr; + cputime_t it_virt_value, it_virt_incr; + cputime_t it_prof_value, it_prof_incr; struct timer_list real_timer; - unsigned long utime, stime; + cputime_t utime, stime; unsigned long nvcsw, nivcsw; /* context switch counts */ struct timespec start_time; /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ @@ -610,7 +615,7 @@ struct task_struct { struct key *thread_keyring; /* keyring private to this thread */ #endif unsigned short used_math; - char comm[16]; + char comm[TASK_COMM_LEN]; /* file system info */ int link_count, total_link_count; /* ipc stuff */ diff --git a/include/linux/security.h b/include/linux/security.h index 4e0795b5a276..2b048ec62e9c 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -109,13 +109,20 @@ struct swap_info_struct; * and the information saved in @bprm->security by the set_security hook. * Since this hook function (and its caller) are void, this hook can not * return an error. However, it can leave the security attributes of the - * process unchanged if an access failure occurs at this point. It can - * also perform other state changes on the process (e.g. closing open - * file descriptors to which access is no longer granted if the attributes - * were changed). + * process unchanged if an access failure occurs at this point. * bprm_apply_creds is called under task_lock. @unsafe indicates various * reasons why it may be unsafe to change security state. * @bprm contains the linux_binprm structure. + * @bprm_post_apply_creds: + * Runs after bprm_apply_creds with the task_lock dropped, so that + * functions which cannot be called safely under the task_lock can + * be used. This hook is a good place to perform state changes on + * the process such as closing open file descriptors to which access + * is no longer granted if the attributes were changed. + * Note that a security module might need to save state between + * bprm_apply_creds and bprm_post_apply_creds to store the decision + * on whether the process may proceed. + * @bprm contains the linux_binprm structure. * @bprm_set_security: * Save security information in the bprm->security field, typically based * on information about the bprm->file, for later use by the apply_creds @@ -1042,6 +1049,7 @@ struct security_operations { int (*bprm_alloc_security) (struct linux_binprm * bprm); void (*bprm_free_security) (struct linux_binprm * bprm); void (*bprm_apply_creds) (struct linux_binprm * bprm, int unsafe); + void (*bprm_post_apply_creds) (struct linux_binprm * bprm); int (*bprm_set_security) (struct linux_binprm * bprm); int (*bprm_check_security) (struct linux_binprm * bprm); int (*bprm_secureexec) (struct linux_binprm * bprm); @@ -1314,6 +1322,10 @@ static inline void security_bprm_apply_creds (struct linux_binprm *bprm, int uns { security_ops->bprm_apply_creds (bprm, unsafe); } +static inline void security_bprm_post_apply_creds (struct linux_binprm *bprm) +{ + security_ops->bprm_post_apply_creds (bprm); +} static inline int security_bprm_set (struct linux_binprm *bprm) { return security_ops->bprm_set_security (bprm); @@ -1992,6 +2004,11 @@ static inline void security_bprm_apply_creds (struct linux_binprm *bprm, int uns cap_bprm_apply_creds (bprm, unsafe); } +static inline void security_bprm_post_apply_creds (struct linux_binprm *bprm) +{ + return; +} + static inline int security_bprm_set (struct linux_binprm *bprm) { return cap_bprm_set_security (bprm); diff --git a/include/linux/selection.h b/include/linux/selection.h index 059c958951f3..ed3408b400f1 100644 --- a/include/linux/selection.h +++ b/include/linux/selection.h @@ -10,7 +10,7 @@ #include <linux/tiocl.h> #include <linux/vt_buffer.h> -extern int sel_cons; +extern struct vc_data *sel_cons; extern void clear_selection(void); extern int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *tty); @@ -19,11 +19,6 @@ extern int sel_loadlut(char __user *p); extern int mouse_reporting(void); extern void mouse_report(struct tty_struct * tty, int butt, int mrx, int mry); -#define video_num_columns (vc_cons[currcons].d->vc_cols) -#define video_num_lines (vc_cons[currcons].d->vc_rows) -#define video_size_row (vc_cons[currcons].d->vc_size_row) -#define can_do_color (vc_cons[currcons].d->vc_can_do_color) - extern int console_blanked; extern unsigned char color_table[]; @@ -31,15 +26,15 @@ extern int default_red[]; extern int default_grn[]; extern int default_blu[]; -extern unsigned short *screen_pos(int currcons, int w_offset, int viewed); -extern u16 screen_glyph(int currcons, int offset); -extern void complement_pos(int currcons, int offset); -extern void invert_screen(int currcons, int offset, int count, int shift); +extern unsigned short *screen_pos(struct vc_data *vc, int w_offset, int viewed); +extern u16 screen_glyph(struct vc_data *vc, int offset); +extern void complement_pos(struct vc_data *vc, int offset); +extern void invert_screen(struct vc_data *vc, int offset, int count, int shift); -extern void getconsxy(int currcons, unsigned char *p); -extern void putconsxy(int currcons, unsigned char *p); +extern void getconsxy(struct vc_data *vc, unsigned char *p); +extern void putconsxy(struct vc_data *vc, unsigned char *p); -extern u16 vcs_scr_readw(int currcons, const u16 *org); -extern void vcs_scr_writew(int currcons, u16 val, u16 *org); +extern u16 vcs_scr_readw(struct vc_data *vc, const u16 *org); +extern void vcs_scr_writew(struct vc_data *vc, u16 val, u16 *org); #endif diff --git a/include/linux/slab.h b/include/linux/slab.h index 93c8264fe67b..0c7ae4f678a2 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -118,7 +118,6 @@ extern kmem_cache_t *mm_cachep; extern kmem_cache_t *names_cachep; extern kmem_cache_t *files_cachep; extern kmem_cache_t *filp_cachep; -extern kmem_cache_t *dquot_cachep; extern kmem_cache_t *fs_cachep; extern kmem_cache_t *signal_cachep; extern kmem_cache_t *sighand_cachep; diff --git a/include/linux/umsdos_fs.h b/include/linux/umsdos_fs.h deleted file mode 100644 index 67c25693db66..000000000000 --- a/include/linux/umsdos_fs.h +++ /dev/null @@ -1,182 +0,0 @@ -#ifndef LINUX_UMSDOS_FS_H -#define LINUX_UMSDOS_FS_H - - -/*#define UMS_DEBUG 1 // define for check_* functions */ -/*#define UMSDOS_DEBUG 1*/ -#define UMSDOS_PARANOIA 1 - -#define UMSDOS_VERSION 0 -#define UMSDOS_RELEASE 4 - -#define UMSDOS_ROOT_INO 1 - -/* This is the file acting as a directory extension */ -#define UMSDOS_EMD_FILE "--linux-.---" -#define UMSDOS_EMD_NAMELEN 12 -#define UMSDOS_PSDROOT_NAME "linux" -#define UMSDOS_PSDROOT_LEN 5 - -#ifndef _LINUX_TYPES_H -#include <linux/types.h> -#endif -#ifndef _LINUX_LIMITS_H -#include <linux/limits.h> -#endif -#ifndef _LINUX_DIRENT_H -#include <linux/dirent.h> -#endif -#ifndef _LINUX_IOCTL_H -#include <linux/ioctl.h> -#endif - - -#ifdef __KERNEL__ -/* #Specification: convention / PRINTK Printk and printk - * Here is the convention for the use of printk inside fs/umsdos - * - * printk carry important message (error or status). - * Printk is for debugging (it is a macro defined at the beginning of - * most source. - * PRINTK is a nulled Printk macro. - * - * This convention makes the source easier to read, and Printk easier - * to shut off. - */ -# define PRINTK(x) -# ifdef UMSDOS_DEBUG -# define Printk(x) printk x -# else -# define Printk(x) -# endif -#endif /* __KERNEL__ */ - - -struct umsdos_fake_info { - char fname[13]; - int len; -}; - -#define UMSDOS_MAXNAME 220 -/* This structure is 256 bytes large, depending on the name, only part */ -/* of it is written to disk */ -/* nice though it would be, I can't change this and preserve backward compatibility */ -struct umsdos_dirent { - unsigned char name_len; /* if == 0, then this entry is not used */ - unsigned char flags; /* UMSDOS_xxxx */ - unsigned short nlink; /* How many hard links point to this entry */ - __kernel_uid_t uid; /* Owner user id */ - __kernel_gid_t gid; /* Group id */ - time_t atime; /* Access time */ - time_t mtime; /* Last modification time */ - time_t ctime; /* Creation time */ - unsigned short rdev; /* major and minor of a device special file */ - umode_t mode; /* Standard UNIX permissions bits + type of */ - char spare[12]; /* unused bytes for future extensions */ - /* file, see linux/stat.h */ - char name[UMSDOS_MAXNAME]; /* Not '\0' terminated */ - /* but '\0' padded, so it will allow */ - /* for adding news fields in this record */ - /* by reducing the size of name[] */ -}; - -#define UMSDOS_HIDDEN 1 /* Never show this entry in directory search */ -#define UMSDOS_HLINK 2 /* It is a (pseudo) hard link */ - -/* #Specification: EMD file / record size - * Entry are 64 bytes wide in the EMD file. It allows for a 30 characters - * name. If a name is longer, contiguous entries are allocated. So a - * umsdos_dirent may span multiple records. - */ - -#define UMSDOS_REC_SIZE 64 - -/* Translation between MSDOS name and UMSDOS name */ - -struct umsdos_info { - int msdos_reject; /* Tell if the file name is invalid for MSDOS */ - /* See umsdos_parse */ - struct umsdos_fake_info fake; - struct umsdos_dirent entry; - off_t f_pos; /* offset of the entry in the EMD file - * or offset where the entry may be store - * if it is a new entry - */ - int recsize; /* Record size needed to store entry */ -}; - -/* Definitions for ioctl (number randomly chosen) - * The next ioctl commands operate only on the DOS directory - * The file umsdos_progs/umsdosio.c contain a string table - * based on the order of those definition. Keep it in sync - */ -#define UMSDOS_READDIR_DOS _IO(0x04,210) /* Do a readdir of the DOS directory */ -#define UMSDOS_UNLINK_DOS _IO(0x04,211) /* Erase in the DOS directory only */ -#define UMSDOS_RMDIR_DOS _IO(0x04,212) /* rmdir in the DOS directory only */ -#define UMSDOS_STAT_DOS _IO(0x04,213) /* Get info about a file */ - -/* The next ioctl commands operate only on the EMD file */ -#define UMSDOS_CREAT_EMD _IO(0x04,214) /* Create a file */ -#define UMSDOS_UNLINK_EMD _IO(0x04,215) /* unlink (rmdir) a file */ -#define UMSDOS_READDIR_EMD _IO(0x04,216) /* read the EMD file only. */ -#define UMSDOS_GETVERSION _IO(0x04,217) /* Get the release number of UMSDOS */ -#define UMSDOS_INIT_EMD _IO(0x04,218) /* Create the EMD file if not there */ -#define UMSDOS_DOS_SETUP _IO(0x04,219) /* Set the defaults of the MS-DOS driver. */ - -#define UMSDOS_RENAME_DOS _IO(0x04,220) /* rename a file/directory in the DOS - * directory only */ -struct umsdos_ioctl { - struct dirent dos_dirent; - struct umsdos_dirent umsdos_dirent; - /* The following structure is used to exchange some data with - * utilities (umsdos_progs/util/umsdosio.c). The first releases - * were using struct stat from "sys/stat.h". This was causing - * some problem for cross compilation of the kernel. - * Since I am not really using the structure stat, but only - * some fields of it, I have decided to replicate the structure - * here for compatibility with the binaries out there. - * FIXME PTW 1998, this has probably changed - */ - - struct { - unsigned long st_dev; - ino_t st_ino; /* used */ - umode_t st_mode; /* used */ - nlink_t st_nlink; - __kernel_uid_t st_uid; - __kernel_gid_t st_gid; - unsigned long st_rdev; - off_t st_size; /* used */ - unsigned long st_blksize; - unsigned long st_blocks; - time_t st_atime; /* used */ - unsigned long __unused1; - time_t st_mtime; /* used */ - unsigned long __unused2; - time_t st_ctime; /* used */ - unsigned long __unused3; - uid_t st_uid32; - gid_t st_gid32; - } stat; - char version, release; -}; - -/* Different macros to access struct umsdos_dirent */ -#define EDM_ENTRY_ISUSED(e) ((e)->name_len!=0) - -#ifdef __KERNEL__ - -#ifndef LINUX_FS_H -#include <linux/fs.h> -#endif - -extern struct inode_operations umsdos_dir_inode_operations; -extern struct inode_operations umsdos_rdir_inode_operations; -extern struct file_operations umsdos_dir_operations; -extern struct file_operations umsdos_rdir_operations; - -#include <linux/umsdos_fs.p> - -#endif /* __KERNEL__ */ - -#endif diff --git a/include/linux/umsdos_fs.p b/include/linux/umsdos_fs.p deleted file mode 100644 index 1c284c5a7aec..000000000000 --- a/include/linux/umsdos_fs.p +++ /dev/null @@ -1,100 +0,0 @@ -/* check.c 23/01/95 03.38.30 */ -void check_page_tables (void); - -/* dir.c 22/06/95 00.22.12 */ -int dummy_dir_read ( struct file *filp, - char *buf, - size_t size, - loff_t *count); -char * umsdos_d_path(struct dentry *, char *, int); -void umsdos_lookup_patch_new(struct dentry *, struct umsdos_info *); -int umsdos_is_pseudodos (struct inode *dir, struct dentry *dentry); -struct dentry *umsdos_lookup_x ( struct inode *dir, struct dentry *dentry, int nopseudo); -struct dentry *UMSDOS_lookup(struct inode *, struct dentry *, struct nameidata *); -struct dentry *umsdos_lookup_dentry(struct dentry *, char *, int, int); -struct dentry *umsdos_covered(struct dentry *, char *, int); - -struct dentry *umsdos_solve_hlink (struct dentry *hlink); - -/* emd.c 22/06/95 00.22.04 */ -struct dentry *umsdos_get_emd_dentry(struct dentry *); -int umsdos_have_emd(struct dentry *); -int umsdos_make_emd(struct dentry *); -int umsdos_emd_dir_readentry (struct dentry *, loff_t *, struct umsdos_dirent *); -int umsdos_newentry (struct dentry *, struct umsdos_info *); -int umsdos_newhidden (struct dentry *, struct umsdos_info *); -int umsdos_delentry (struct dentry *, struct umsdos_info *, int); -int umsdos_findentry (struct dentry *, struct umsdos_info *, int); -int umsdos_isempty (struct dentry *); -int umsdos_writeentry (struct dentry *, struct umsdos_info *, int); - -/* file.c 25/01/95 02.25.38 */ - -/* inode.c 12/06/95 09.49.40 */ -void fill_new_filp (struct file *filp, struct dentry *dentry); -void UMSDOS_read_inode (struct inode *); -void UMSDOS_write_inode (struct inode *, int); -int UMSDOS_notify_change (struct dentry *, struct iattr *attr); -int umsdos_notify_change_locked(struct dentry *, struct iattr *attr); -void UMSDOS_put_inode (struct inode *); -int UMSDOS_statfs (struct super_block *, struct statfs *); -struct super_block *UMSDOS_read_super (struct super_block *, void *, int); -void UMSDOS_put_super (struct super_block *); - -void umsdos_setup_dir(struct dentry *); -void umsdos_set_dirinfo_new(struct dentry *, off_t); -void umsdos_patch_dentry_inode (struct dentry *, off_t); -int umsdos_get_dirowner (struct inode *inode, struct inode **result); - -/* ioctl.c 22/06/95 00.22.08 */ -int UMSDOS_ioctl_dir (struct inode *dir, - struct file *filp, - unsigned int cmd, - unsigned long data); - -/* mangle.c 25/01/95 02.25.38 */ -void umsdos_manglename (struct umsdos_info *info); -int umsdos_evalrecsize (int len); -int umsdos_parse (const char *name,int len, struct umsdos_info *info); - -/* namei.c 25/01/95 02.25.38 */ -void umsdos_lockcreate (struct inode *dir); -void umsdos_startlookup (struct inode *dir); -void umsdos_unlockcreate (struct inode *dir); -void umsdos_endlookup (struct inode *dir); - -int umsdos_readlink_x ( struct dentry *dentry, - char *buffer, - int bufsiz); -int UMSDOS_symlink (struct inode *dir, - struct dentry *dentry, - const char *symname); -int UMSDOS_link (struct dentry *olddentry, - struct inode *dir, - struct dentry *dentry); -int UMSDOS_create (struct inode *dir, - struct dentry *dentry, - int mode); - -int UMSDOS_mkdir (struct inode *dir, - struct dentry *dentry, - int mode); -int UMSDOS_mknod (struct inode *dir, - struct dentry *dentry, - int mode, - dev_t rdev); -int UMSDOS_rmdir (struct inode *dir,struct dentry *dentry); -int UMSDOS_unlink (struct inode *dir, struct dentry *dentry); -int UMSDOS_rename (struct inode *old_dir, - struct dentry *old_dentry, - struct inode *new_dir, - struct dentry *new_dentry); - -/* rdir.c 22/03/95 03.31.42 */ -struct dentry *umsdos_rlookup_x (struct inode *dir, struct dentry *dentry, int nopseudo); -struct dentry *UMSDOS_rlookup (struct inode *dir, struct dentry *dentry, struct nameidata *nd); - -static inline struct umsdos_inode_info *UMSDOS_I(struct inode *inode) -{ - return &inode->u.umsdos_i; -} diff --git a/include/linux/umsdos_fs_i.h b/include/linux/umsdos_fs_i.h deleted file mode 100644 index f4c992b44cd2..000000000000 --- a/include/linux/umsdos_fs_i.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef UMSDOS_FS_I_H -#define UMSDOS_FS_I_H - -#ifndef _LINUX_TYPES_H -#include <linux/types.h> -#endif - -#include <linux/msdos_fs_i.h> -#include <linux/pipe_fs_i.h> - -/* #Specification: strategy / in memory inode - * Here is the information specific to the inode of the UMSDOS file - * system. This information is added to the end of the standard struct - * inode. Each file system has its own extension to struct inode, - * so do the umsdos file system. - * - * The strategy is to have the umsdos_inode_info as a superset of - * the msdos_inode_info, since most of the time the job is done - * by the msdos fs code. - * - * So we duplicate the msdos_inode_info, and add our own info at the - * end. - * - * The offset in this EMD file of the entry: pos - * - * For directory, we have dir_locking_info to help synchronise - * file creation and file lookup. See also msdos_fs_i.h for more - * information about msdos_inode_info. - * - * Special file and fifo do have an inode which correspond to an - * empty MSDOS file. - * - * symlink are processed mostly like regular file. The content is the - * link. - * - * The UMSDOS specific extension is placed after the union. - */ - -struct dir_locking_info { - wait_queue_head_t p; - short int looking; /* How many process doing a lookup */ - short int creating; /* Is there any creation going on here - * Only one at a time, although one - * may recursively lock, so it is a counter - */ - long pid; /* pid of the process owning the creation - * lock */ -}; - -struct umsdos_inode_info { - struct msdos_inode_info msdos_info; - struct dir_locking_info dir_info; - int i_patched; /* Inode has been patched */ - int i_is_hlink; /* Resolved hardlink inode? */ - off_t pos; /* Entry offset in the emd_owner file */ -}; - -#endif diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 8c68717810c3..9af7ad38c08d 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -8,6 +8,7 @@ #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ #define VM_ALLOC 0x00000002 /* vmalloc() */ #define VM_MAP 0x00000004 /* vmap()ed pages */ +/* bits [20..32] reserved for arch specific ioremap internals */ struct vm_struct { void *addr; diff --git a/include/pcmcia/bulkmem.h b/include/pcmcia/bulkmem.h index f6954220f419..b53b78d497ba 100644 --- a/include/pcmcia/bulkmem.h +++ b/include/pcmcia/bulkmem.h @@ -1,33 +1,15 @@ /* - * Definitions for bulk memory services + * bulkmem.h -- Definitions for bulk memory services * - * bulkmem.h 1.12 2000/06/12 21:55:41 - * - * The contents of this file are subject to the Mozilla Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License - * at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - * the License for the specific language governing rights and - * limitations under the License. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. * * The initial developer of the original code is David A. Hinds * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision by - * deleting the provisions above and replace them with the notice and - * other provisions required by the GPL. If you do not delete the - * provisions above, a recipient may use your version of this file - * under either the MPL or the GPL. - * bulkmem.h 1.3 1995/05/27 04:49:49 + * (C) 1999 David A. Hinds */ #ifndef _LINUX_BULKMEM_H diff --git a/include/pcmcia/ciscode.h b/include/pcmcia/ciscode.h index 0d84b163d055..2000b43ece91 100644 --- a/include/pcmcia/ciscode.h +++ b/include/pcmcia/ciscode.h @@ -1,30 +1,15 @@ /* - * ciscode.h 1.56 2002/10/25 06:37:30 + * ciscode.h -- Definitions for bulk memory services * - * The contents of this file are subject to the Mozilla Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License - * at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - * the License for the specific language governing rights and - * limitations under the License. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. * * The initial developer of the original code is David A. Hinds * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License version 2 (the "GPL"), in - * which case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision by - * deleting the provisions above and replace them with the notice and - * other provisions required by the GPL. If you do not delete the - * provisions above, a recipient may use your version of this file - * under either the MPL or the GPL. + * (C) 1999 David A. Hinds */ #ifndef _LINUX_CISCODE_H diff --git a/include/pcmcia/cisreg.h b/include/pcmcia/cisreg.h index 803d2c369a4b..ddaad465502e 100644 --- a/include/pcmcia/cisreg.h +++ b/include/pcmcia/cisreg.h @@ -1,30 +1,15 @@ /* - * cisreg.h 1.17 2000/06/12 21:55:41 + * cisreg.h * - * The contents of this file are subject to the Mozilla Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License - * at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - * the License for the specific language governing rights and - * limitations under the License. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. * * The initial developer of the original code is David A. Hinds * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision by - * deleting the provisions above and replace them with the notice and - * other provisions required by the GPL. If you do not delete the - * provisions above, a recipient may use your version of this file - * under either the MPL or the GPL. + * (C) 1999 David A. Hinds */ #ifndef _LINUX_CISREG_H diff --git a/include/pcmcia/cistpl.h b/include/pcmcia/cistpl.h index 499f748c0028..c6a069554fd7 100644 --- a/include/pcmcia/cistpl.h +++ b/include/pcmcia/cistpl.h @@ -1,30 +1,15 @@ /* - * cistpl.h 1.34 2000/06/19 23:18:12 + * cistpl.h * - * The contents of this file are subject to the Mozilla Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License - * at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - * the License for the specific language governing rights and - * limitations under the License. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. * * The initial developer of the original code is David A. Hinds * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision by - * deleting the provisions above and replace them with the notice and - * other provisions required by the GPL. If you do not delete the - * provisions above, a recipient may use your version of this file - * under either the MPL or the GPL. + * (C) 1999 David A. Hinds */ #ifndef _LINUX_CISTPL_H diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index 48eddee1e554..311682a7fef0 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h @@ -1,30 +1,15 @@ /* - * cs.h 1.71 2000/08/29 00:54:20 + * cs.h * - * The contents of this file are subject to the Mozilla Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License - * at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - * the License for the specific language governing rights and - * limitations under the License. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. * * The initial developer of the original code is David A. Hinds * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision by - * deleting the provisions above and replace them with the notice and - * other provisions required by the GPL. If you do not delete the - * provisions above, a recipient may use your version of this file - * under either the MPL or the GPL. + * (C) 1999 David A. Hinds */ #ifndef _LINUX_CS_H @@ -139,7 +124,7 @@ typedef struct client_req_t { /* For RegisterClient */ typedef struct client_reg_t { dev_info_t *dev_info; - u_int Attributes; + u_int Attributes; /* UNUSED */ u_int EventMask; int (*event_handler)(event_t event, int priority, event_callback_args_t *); @@ -294,7 +279,7 @@ typedef struct win_req_t { #define WIN_BAR_MASK 0xe000 #define WIN_BAR_SHIFT 13 -/* Attributes for RegisterClient */ +/* Attributes for RegisterClient -- UNUSED -- */ #define INFO_MASTER_CLIENT 0x01 #define INFO_IO_CLIENT 0x02 #define INFO_MTD_CLIENT 0x04 @@ -315,23 +300,9 @@ typedef struct error_info_t { int retcode; } error_info_t; -/* Special stuff for binding drivers to sockets */ -typedef struct bind_req_t { - struct pcmcia_socket *Socket; - u_char Function; - dev_info_t *dev_info; -} bind_req_t; - /* Flag to bind to all functions */ #define BIND_FN_ALL 0xff -typedef struct mtd_bind_t { - struct pcmcia_socket *Socket; - u_int Attributes; - u_int CardOffset; - dev_info_t *dev_info; -} mtd_bind_t; - /* Events */ #define CS_EVENT_PRI_LOW 0 #define CS_EVENT_PRI_HIGH 1 @@ -420,6 +391,8 @@ enum service { GetFirstWindow, GetNextWindow, GetMemPage }; +struct pcmcia_socket; + int pcmcia_access_configuration_register(client_handle_t handle, conf_reg_t *reg); int pcmcia_deregister_client(client_handle_t handle); int pcmcia_get_configuration_info(client_handle_t handle, config_info_t *config); @@ -446,12 +419,8 @@ int pcmcia_eject_card(struct pcmcia_socket *skt); int pcmcia_insert_card(struct pcmcia_socket *skt); int pcmcia_report_error(client_handle_t handle, error_info_t *err); -#ifdef CONFIG_PCMCIA_OBSOLETE -int pcmcia_get_first_client(client_handle_t *handle, client_req_t *req); -int pcmcia_get_next_client(client_handle_t *handle, client_req_t *req); -int pcmcia_modify_window(window_handle_t win, modwin_t *req); -int pcmcia_set_event_mask(client_handle_t handle, eventmask_t *mask); -#endif +struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt); +void pcmcia_put_socket(struct pcmcia_socket *skt); #endif /* __KERNEL__ */ diff --git a/include/pcmcia/cs_types.h b/include/pcmcia/cs_types.h index 3a4aec08549e..b57c921998f0 100644 --- a/include/pcmcia/cs_types.h +++ b/include/pcmcia/cs_types.h @@ -1,30 +1,15 @@ /* - * cs_types.h 1.18 2000/06/12 21:55:40 + * cs_types.h * - * The contents of this file are subject to the Mozilla Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License - * at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - * the License for the specific language governing rights and - * limitations under the License. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. * * The initial developer of the original code is David A. Hinds * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision by - * deleting the provisions above and replace them with the notice and - * other provisions required by the GPL. If you do not delete the - * provisions above, a recipient may use your version of this file - * under either the MPL or the GPL. + * (C) 1999 David A. Hinds */ #ifndef _LINUX_CS_TYPES_H diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 8a22fecf1cbd..1a7a03d8623a 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -1,30 +1,16 @@ /* - * ds.h 1.56 2000/06/12 21:55:40 + * ds.h -- 16-bit PCMCIA core support * - * The contents of this file are subject to the Mozilla Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License - * at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - * the License for the specific language governing rights and - * limitations under the License. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. * * The initial developer of the original code is David A. Hinds * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision by - * deleting the provisions above and replace them with the notice and - * other provisions required by the GPL. If you do not delete the - * provisions above, a recipient may use your version of this file - * under either the MPL or the GPL. + * (C) 1999 David A. Hinds + * (C) 2003 - 2004 Dominik Brodowski */ #ifndef _LINUX_DS_H @@ -141,10 +127,11 @@ typedef struct dev_link_t { ((l) && ((l->state & ~DEV_BUSY) == (DEV_CONFIG|DEV_PRESENT))) +struct pcmcia_socket; + extern struct bus_type pcmcia_bus_type; struct pcmcia_driver { - int use_count; dev_link_t *(*attach)(void); void (*detach)(dev_link_t *); struct module *owner; @@ -155,6 +142,42 @@ struct pcmcia_driver { int pcmcia_register_driver(struct pcmcia_driver *driver); void pcmcia_unregister_driver(struct pcmcia_driver *driver); +struct pcmcia_device { + /* the socket and the device_no [for multifunction devices] + uniquely define a pcmcia_device */ + struct pcmcia_socket *socket; + + u8 device_no; + + /* the hardware "function" device; certain subdevices can + * share one hardware "function" device. */ + u8 func; + + struct list_head socket_device_list; + + /* deprecated, a cleaned up version will be moved into this + struct soon */ + dev_link_t *instance; + struct client_t { + u_short client_magic; + struct pcmcia_socket *Socket; + u_char Function; + u_int state; + event_t EventMask; + int (*event_handler) (event_t event, int priority, + event_callback_args_t *); + event_callback_args_t event_callback_args; + } client; + + struct device dev; +}; + +#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) +#define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) + +#define handle_to_pdev(handle) container_of(handle, struct pcmcia_device, client); +#define handle_to_dev(handle) ((container_of(handle, struct pcmcia_device, client))->dev) + /* error reporting */ void cs_error(client_handle_t handle, int func, int ret); diff --git a/include/pcmcia/mem_op.h b/include/pcmcia/mem_op.h index 261dd5bbbdf2..8d19b9401a5b 100644 --- a/include/pcmcia/mem_op.h +++ b/include/pcmcia/mem_op.h @@ -1,30 +1,15 @@ /* - * mem_op.h 1.13 2000/06/12 21:55:40 + * mem_op.h * - * The contents of this file are subject to the Mozilla Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License - * at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - * the License for the specific language governing rights and - * limitations under the License. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. * * The initial developer of the original code is David A. Hinds * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision by - * deleting the provisions above and replace them with the notice and - * other provisions required by the GPL. If you do not delete the - * provisions above, a recipient may use your version of this file - * under either the MPL or the GPL. + * (C) 1999 David A. Hinds */ #ifndef _LINUX_MEM_OP_H diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index 1958cda29889..70cbca2638c5 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h @@ -1,30 +1,15 @@ /* - * ss.h 1.28 2000/06/12 21:55:40 + * ss.h * - * The contents of this file are subject to the Mozilla Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License - * at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - * the License for the specific language governing rights and - * limitations under the License. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. * * The initial developer of the original code is David A. Hinds * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License version 2 (the "GPL"), in which - * case the provisions of the GPL are applicable instead of the - * above. If you wish to allow the use of your version of this file - * only under the terms of the GPL and not to allow others to use - * your version of this file under the MPL, indicate your decision by - * deleting the provisions above and replace them with the notice and - * other provisions required by the GPL. If you do not delete the - * provisions above, a recipient may use your version of this file - * under either the MPL or the GPL. + * (C) 1999 David A. Hinds */ #ifndef _LINUX_SS_H @@ -130,6 +115,28 @@ struct pccard_operations { int (*set_mem_map)(struct pcmcia_socket *sock, struct pccard_mem_map *mem); }; +struct pccard_resource_ops { + void (*validate_mem) (struct pcmcia_socket *s); + int (*adjust_io_region) (struct resource *res, + unsigned long r_start, + unsigned long r_end, + struct pcmcia_socket *s); + struct resource* (*find_io) (unsigned long base, int num, + unsigned long align, + struct pcmcia_socket *s); + struct resource* (*find_mem) (unsigned long base, unsigned long num, + unsigned long align, int low, + struct pcmcia_socket *s); + int (*adjust_resource) (struct pcmcia_socket *s, + adjust_t *adj); + int (*init) (struct pcmcia_socket *s); + void (*exit) (struct pcmcia_socket *s); +}; +/* SS_CAP_STATIC_MAP */ +extern struct pccard_resource_ops pccard_static_ops; +/* !SS_CAP_STATIC_MAP */ +extern struct pccard_resource_ops pccard_nonstatic_ops; + /* * Calls to set up low-level "Socket Services" drivers */ @@ -159,6 +166,8 @@ typedef struct window_t { struct config_t; struct region_t; +struct pcmcia_callback; + struct pcmcia_socket { struct module *owner; @@ -167,7 +176,6 @@ struct pcmcia_socket { u_int state; u_short functions; u_short lock_count; - client_handle_t clients; pccard_mem_map cis_mem; void __iomem *cis_virt; struct config_t *config; @@ -199,6 +207,8 @@ struct pcmcia_socket { /* socket operations */ struct pccard_operations * ops; + struct pccard_resource_ops * resource_ops; + void * resource_data; /* Zoom video behaviour is so chip specific its not worth adding this to _ops */ @@ -215,6 +225,7 @@ struct pcmcia_socket { /* pcmcia (16-bit) */ struct pcmcia_bus_socket *pcmcia; + struct pcmcia_callback *callback; /* cardbus (32-bit) */ #ifdef CONFIG_CARDBUS diff --git a/include/scsi/scsi_dbg.h b/include/scsi/scsi_dbg.h index 38fbb68c9b87..12e90934a7a8 100644 --- a/include/scsi/scsi_dbg.h +++ b/include/scsi/scsi_dbg.h @@ -8,6 +8,9 @@ extern void scsi_print_command(struct scsi_cmnd *); extern void __scsi_print_command(unsigned char *); extern void scsi_print_sense(const char *, struct scsi_cmnd *); extern void scsi_print_req_sense(const char *, struct scsi_request *); +extern void __scsi_print_sense(const char *name, + const unsigned char *sense_buffer, + int sense_len); extern void scsi_print_driverbyte(int); extern void scsi_print_hostbyte(int); extern void scsi_print_status(unsigned char); diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 6afc72fba7dc..8678132e3947 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -172,6 +172,8 @@ extern struct scsi_device *scsi_device_lookup(struct Scsi_Host *, uint, uint, uint); extern struct scsi_device *__scsi_device_lookup(struct Scsi_Host *, uint, uint, uint); +extern void starget_for_each_device(struct scsi_target *, void *, + void (*fn)(struct scsi_device *, void *)); /* only exposed to implement shost_for_each_device */ extern struct scsi_device *__scsi_iterate_devices(struct Scsi_Host *, diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index 3b7128327791..1d4adfd6d3e9 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h @@ -185,6 +185,8 @@ struct fc_host_statistics { #define FC_FC4_LIST_SIZE 32 #define FC_SYMBOLIC_NAME_SIZE 256 +#define FC_VERSION_STRING_SIZE 64 +#define FC_SERIAL_NUMBER_SIZE 80 struct fc_host_attrs { /* Fixed Attributes */ @@ -195,6 +197,11 @@ struct fc_host_attrs { char symbolic_name[FC_SYMBOLIC_NAME_SIZE]; u32 supported_speeds; u32 maxframe_size; + char hardware_version[FC_VERSION_STRING_SIZE]; + char firmware_version[FC_VERSION_STRING_SIZE]; + char serial_number[FC_SERIAL_NUMBER_SIZE]; + char opt_rom_version[FC_VERSION_STRING_SIZE]; + char driver_version[FC_VERSION_STRING_SIZE]; /* Dynamic Attributes */ u32 port_id; @@ -226,6 +233,16 @@ struct fc_host_attrs { (((struct fc_host_attrs *)(x)->shost_data)->supported_speeds) #define fc_host_maxframe_size(x) \ (((struct fc_host_attrs *)(x)->shost_data)->maxframe_size) +#define fc_host_hardware_version(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->hardware_version) +#define fc_host_firmware_version(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->firmware_version) +#define fc_host_serial_number(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->serial_number) +#define fc_host_opt_rom_version(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->opt_rom_version) +#define fc_host_driver_version(x) \ + (((struct fc_host_attrs *)(x)->shost_data)->driver_version) #define fc_host_port_id(x) \ (((struct fc_host_attrs *)(x)->shost_data)->port_id) #define fc_host_port_type(x) \ @@ -285,6 +302,11 @@ struct fc_function_template { unsigned long show_host_symbolic_name:1; unsigned long show_host_supported_speeds:1; unsigned long show_host_maxframe_size:1; + unsigned long show_host_hardware_version:1; + unsigned long show_host_firmware_version:1; + unsigned long show_host_serial_number:1; + unsigned long show_host_opt_rom_version:1; + unsigned long show_host_driver_version:1; /* host dynamic attributes */ unsigned long show_host_port_id:1; unsigned long show_host_port_type:1; |
