diff options
Diffstat (limited to 'include/asm-arm')
-rw-r--r-- | include/asm-arm/arch-pxa/hardware.h | 18 | ||||
-rw-r--r-- | include/asm-arm/arch-pxa/i2c.h | 70 | ||||
-rw-r--r-- | include/asm-arm/arch-pxa/mmc.h | 1 | ||||
-rw-r--r-- | include/asm-arm/arch-pxa/pxafb.h | 1 | ||||
-rw-r--r-- | include/asm-arm/arch-s3c2410/fb.h | 69 | ||||
-rw-r--r-- | include/asm-arm/arch-s3c2410/regs-lcd.h | 17 | ||||
-rw-r--r-- | include/asm-arm/arch-sa1100/hardware.h | 18 | ||||
-rw-r--r-- | include/asm-arm/cacheflush.h | 7 | ||||
-rw-r--r-- | include/asm-arm/pci.h | 13 | ||||
-rw-r--r-- | include/asm-arm/spinlock.h | 50 | ||||
-rw-r--r-- | include/asm-arm/spinlock_types.h | 20 | ||||
-rw-r--r-- | include/asm-arm/unistd.h | 3 |
12 files changed, 222 insertions, 65 deletions
diff --git a/include/asm-arm/arch-pxa/hardware.h b/include/asm-arm/arch-pxa/hardware.h index 72b04d846a23..cf35721cfa45 100644 --- a/include/asm-arm/arch-pxa/hardware.h +++ b/include/asm-arm/arch-pxa/hardware.h | |||
@@ -44,24 +44,12 @@ | |||
44 | 44 | ||
45 | #ifndef __ASSEMBLY__ | 45 | #ifndef __ASSEMBLY__ |
46 | 46 | ||
47 | #if 0 | 47 | # define __REG(x) (*((volatile unsigned long *)io_p2v(x))) |
48 | # define __REG(x) (*((volatile u32 *)io_p2v(x))) | ||
49 | #else | ||
50 | /* | ||
51 | * This __REG() version gives the same results as the one above, except | ||
52 | * that we are fooling gcc somehow so it generates far better and smaller | ||
53 | * assembly code for access to contigous registers. It's a shame that gcc | ||
54 | * doesn't guess this by itself. | ||
55 | */ | ||
56 | #include <asm/types.h> | ||
57 | typedef struct { volatile u32 offset[4096]; } __regbase; | ||
58 | # define __REGP(x) ((__regbase *)((x)&~4095))->offset[((x)&4095)>>2] | ||
59 | # define __REG(x) __REGP(io_p2v(x)) | ||
60 | #endif | ||
61 | 48 | ||
62 | /* With indexed regs we don't want to feed the index through io_p2v() | 49 | /* With indexed regs we don't want to feed the index through io_p2v() |
63 | especially if it is a variable, otherwise horrible code will result. */ | 50 | especially if it is a variable, otherwise horrible code will result. */ |
64 | # define __REG2(x,y) (*(volatile u32 *)((u32)&__REG(x) + (y))) | 51 | # define __REG2(x,y) \ |
52 | (*(volatile unsigned long *)((unsigned long)&__REG(x) + (y))) | ||
65 | 53 | ||
66 | # define __PREG(x) (io_v2p((u32)&(x))) | 54 | # define __PREG(x) (io_v2p((u32)&(x))) |
67 | 55 | ||
diff --git a/include/asm-arm/arch-pxa/i2c.h b/include/asm-arm/arch-pxa/i2c.h new file mode 100644 index 000000000000..46ec2243974a --- /dev/null +++ b/include/asm-arm/arch-pxa/i2c.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | * i2c_pxa.h | ||
3 | * | ||
4 | * Copyright (C) 2002 Intrinsyc Software Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | */ | ||
11 | #ifndef _I2C_PXA_H_ | ||
12 | #define _I2C_PXA_H_ | ||
13 | |||
14 | #if 0 | ||
15 | #define DEF_TIMEOUT 3 | ||
16 | #else | ||
17 | /* need a longer timeout if we're dealing with the fact we may well be | ||
18 | * looking at a multi-master environment | ||
19 | */ | ||
20 | #define DEF_TIMEOUT 32 | ||
21 | #endif | ||
22 | |||
23 | #define BUS_ERROR (-EREMOTEIO) | ||
24 | #define XFER_NAKED (-ECONNREFUSED) | ||
25 | #define I2C_RETRY (-2000) /* an error has occurred retry transmit */ | ||
26 | |||
27 | /* ICR initialize bit values | ||
28 | * | ||
29 | * 15. FM 0 (100 Khz operation) | ||
30 | * 14. UR 0 (No unit reset) | ||
31 | * 13. SADIE 0 (Disables the unit from interrupting on slave addresses | ||
32 | * matching its slave address) | ||
33 | * 12. ALDIE 0 (Disables the unit from interrupt when it loses arbitration | ||
34 | * in master mode) | ||
35 | * 11. SSDIE 0 (Disables interrupts from a slave stop detected, in slave mode) | ||
36 | * 10. BEIE 1 (Enable interrupts from detected bus errors, no ACK sent) | ||
37 | * 9. IRFIE 1 (Enable interrupts from full buffer received) | ||
38 | * 8. ITEIE 1 (Enables the I2C unit to interrupt when transmit buffer empty) | ||
39 | * 7. GCD 1 (Disables i2c unit response to general call messages as a slave) | ||
40 | * 6. IUE 0 (Disable unit until we change settings) | ||
41 | * 5. SCLE 1 (Enables the i2c clock output for master mode (drives SCL) | ||
42 | * 4. MA 0 (Only send stop with the ICR stop bit) | ||
43 | * 3. TB 0 (We are not transmitting a byte initially) | ||
44 | * 2. ACKNAK 0 (Send an ACK after the unit receives a byte) | ||
45 | * 1. STOP 0 (Do not send a STOP) | ||
46 | * 0. START 0 (Do not send a START) | ||
47 | * | ||
48 | */ | ||
49 | #define I2C_ICR_INIT (ICR_BEIE | ICR_IRFIE | ICR_ITEIE | ICR_GCD | ICR_SCLE) | ||
50 | |||
51 | /* I2C status register init values | ||
52 | * | ||
53 | * 10. BED 1 (Clear bus error detected) | ||
54 | * 9. SAD 1 (Clear slave address detected) | ||
55 | * 7. IRF 1 (Clear IDBR Receive Full) | ||
56 | * 6. ITE 1 (Clear IDBR Transmit Empty) | ||
57 | * 5. ALD 1 (Clear Arbitration Loss Detected) | ||
58 | * 4. SSD 1 (Clear Slave Stop Detected) | ||
59 | */ | ||
60 | #define I2C_ISR_INIT 0x7FF /* status register init */ | ||
61 | |||
62 | struct i2c_slave_client; | ||
63 | |||
64 | struct i2c_pxa_platform_data { | ||
65 | unsigned int slave_addr; | ||
66 | struct i2c_slave_client *slave; | ||
67 | }; | ||
68 | |||
69 | extern void pxa_set_i2c_info(struct i2c_pxa_platform_data *info); | ||
70 | #endif | ||
diff --git a/include/asm-arm/arch-pxa/mmc.h b/include/asm-arm/arch-pxa/mmc.h index 9718063a2119..88c17dd02ed2 100644 --- a/include/asm-arm/arch-pxa/mmc.h +++ b/include/asm-arm/arch-pxa/mmc.h | |||
@@ -9,6 +9,7 @@ struct mmc_host; | |||
9 | 9 | ||
10 | struct pxamci_platform_data { | 10 | struct pxamci_platform_data { |
11 | unsigned int ocr_mask; /* available voltages */ | 11 | unsigned int ocr_mask; /* available voltages */ |
12 | unsigned long detect_delay; /* delay in jiffies before detecting cards after interrupt */ | ||
12 | int (*init)(struct device *, irqreturn_t (*)(int, void *, struct pt_regs *), void *); | 13 | int (*init)(struct device *, irqreturn_t (*)(int, void *, struct pt_regs *), void *); |
13 | int (*get_ro)(struct device *); | 14 | int (*get_ro)(struct device *); |
14 | void (*setpower)(struct device *, unsigned int); | 15 | void (*setpower)(struct device *, unsigned int); |
diff --git a/include/asm-arm/arch-pxa/pxafb.h b/include/asm-arm/arch-pxa/pxafb.h index 27d71e9d413b..21c0e16dce5f 100644 --- a/include/asm-arm/arch-pxa/pxafb.h +++ b/include/asm-arm/arch-pxa/pxafb.h | |||
@@ -66,3 +66,4 @@ struct pxafb_mach_info { | |||
66 | 66 | ||
67 | }; | 67 | }; |
68 | void set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info); | 68 | void set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info); |
69 | unsigned long pxafb_get_hsync_time(struct device *dev); | ||
diff --git a/include/asm-arm/arch-s3c2410/fb.h b/include/asm-arm/arch-s3c2410/fb.h new file mode 100644 index 000000000000..ac57bc887d82 --- /dev/null +++ b/include/asm-arm/arch-s3c2410/fb.h | |||
@@ -0,0 +1,69 @@ | |||
1 | /* linux/include/asm/arch-s3c2410/fb.h | ||
2 | * | ||
3 | * Copyright (c) 2004 Arnaud Patard <arnaud.patard@rtp-net.org> | ||
4 | * | ||
5 | * Inspired by pxafb.h | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * | ||
12 | * Changelog: | ||
13 | * 07-Sep-2004 RTP Created file | ||
14 | * 03-Nov-2004 BJD Updated and minor cleanups | ||
15 | * 03-Aug-2005 RTP Renamed to fb.h | ||
16 | */ | ||
17 | |||
18 | #ifndef __ASM_ARM_FB_H | ||
19 | #define __ASM_ARM_FB_H | ||
20 | |||
21 | #include <asm/arch/regs-lcd.h> | ||
22 | |||
23 | struct s3c2410fb_val { | ||
24 | unsigned int defval; | ||
25 | unsigned int min; | ||
26 | unsigned int max; | ||
27 | }; | ||
28 | |||
29 | struct s3c2410fb_hw { | ||
30 | unsigned long lcdcon1; | ||
31 | unsigned long lcdcon2; | ||
32 | unsigned long lcdcon3; | ||
33 | unsigned long lcdcon4; | ||
34 | unsigned long lcdcon5; | ||
35 | }; | ||
36 | |||
37 | struct s3c2410fb_mach_info { | ||
38 | unsigned char fixed_syncs; /* do not update sync/border */ | ||
39 | |||
40 | /* Screen size */ | ||
41 | int width; | ||
42 | int height; | ||
43 | |||
44 | /* Screen info */ | ||
45 | struct s3c2410fb_val xres; | ||
46 | struct s3c2410fb_val yres; | ||
47 | struct s3c2410fb_val bpp; | ||
48 | |||
49 | /* lcd configuration registers */ | ||
50 | struct s3c2410fb_hw regs; | ||
51 | |||
52 | /* GPIOs */ | ||
53 | |||
54 | unsigned long gpcup; | ||
55 | unsigned long gpcup_mask; | ||
56 | unsigned long gpccon; | ||
57 | unsigned long gpccon_mask; | ||
58 | unsigned long gpdup; | ||
59 | unsigned long gpdup_mask; | ||
60 | unsigned long gpdcon; | ||
61 | unsigned long gpdcon_mask; | ||
62 | |||
63 | /* lpc3600 control register */ | ||
64 | unsigned long lpcsel; | ||
65 | }; | ||
66 | |||
67 | void __init set_s3c2410fb_info(struct s3c2410fb_mach_info *hard_s3c2410fb_info); | ||
68 | |||
69 | #endif /* __ASM_ARM_FB_H */ | ||
diff --git a/include/asm-arm/arch-s3c2410/regs-lcd.h b/include/asm-arm/arch-s3c2410/regs-lcd.h index 7f882ea92b2a..b6b1b4e8bbeb 100644 --- a/include/asm-arm/arch-s3c2410/regs-lcd.h +++ b/include/asm-arm/arch-s3c2410/regs-lcd.h | |||
@@ -51,21 +51,32 @@ | |||
51 | 51 | ||
52 | #define S3C2410_LCDCON1_ENVID (1) | 52 | #define S3C2410_LCDCON1_ENVID (1) |
53 | 53 | ||
54 | #define S3C2410_LCDCON1_MODEMASK 0x1E | ||
55 | |||
54 | #define S3C2410_LCDCON2_VBPD(x) ((x) << 24) | 56 | #define S3C2410_LCDCON2_VBPD(x) ((x) << 24) |
55 | #define S3C2410_LCDCON2_LINEVAL(x) ((x) << 14) | 57 | #define S3C2410_LCDCON2_LINEVAL(x) ((x) << 14) |
56 | #define S3C2410_LCDCON2_VFPD(x) ((x) << 6) | 58 | #define S3C2410_LCDCON2_VFPD(x) ((x) << 6) |
57 | #define S3C2410_LCDCON2_VSPW(x) ((x) << 0) | 59 | #define S3C2410_LCDCON2_VSPW(x) ((x) << 0) |
58 | 60 | ||
61 | #define S3C2410_LCDCON2_GET_VBPD(x) ( ((x) >> 24) & 0xFF) | ||
62 | #define S3C2410_LCDCON2_GET_VFPD(x) ( ((x) >> 6) & 0xFF) | ||
63 | #define S3C2410_LCDCON2_GET_VSPW(x) ( ((x) >> 0) & 0x3F) | ||
64 | |||
59 | #define S3C2410_LCDCON3_HBPD(x) ((x) << 19) | 65 | #define S3C2410_LCDCON3_HBPD(x) ((x) << 19) |
60 | #define S3C2410_LCDCON3_WDLY(x) ((x) << 19) | 66 | #define S3C2410_LCDCON3_WDLY(x) ((x) << 19) |
61 | #define S3C2410_LCDCON3_HOZVAL(x) ((x) << 8) | 67 | #define S3C2410_LCDCON3_HOZVAL(x) ((x) << 8) |
62 | #define S3C2410_LCDCON3_HFPD(x) ((x) << 0) | 68 | #define S3C2410_LCDCON3_HFPD(x) ((x) << 0) |
63 | #define S3C2410_LCDCON3_LINEBLANK(x)((x) << 0) | 69 | #define S3C2410_LCDCON3_LINEBLANK(x)((x) << 0) |
64 | 70 | ||
71 | #define S3C2410_LCDCON3_GET_HBPD(x) ( ((x) >> 19) & 0x7F) | ||
72 | #define S3C2410_LCDCON3_GET_HFPD(x) ( ((x) >> 0) & 0xFF) | ||
73 | |||
65 | #define S3C2410_LCDCON4_MVAL(x) ((x) << 8) | 74 | #define S3C2410_LCDCON4_MVAL(x) ((x) << 8) |
66 | #define S3C2410_LCDCON4_HSPW(x) ((x) << 0) | 75 | #define S3C2410_LCDCON4_HSPW(x) ((x) << 0) |
67 | #define S3C2410_LCDCON4_WLH(x) ((x) << 0) | 76 | #define S3C2410_LCDCON4_WLH(x) ((x) << 0) |
68 | 77 | ||
78 | #define S3C2410_LCDCON4_GET_HSPW(x) ( ((x) >> 0) & 0xFF) | ||
79 | |||
69 | #define S3C2410_LCDCON5_BPP24BL (1<<12) | 80 | #define S3C2410_LCDCON5_BPP24BL (1<<12) |
70 | #define S3C2410_LCDCON5_FRM565 (1<<11) | 81 | #define S3C2410_LCDCON5_FRM565 (1<<11) |
71 | #define S3C2410_LCDCON5_INVVCLK (1<<10) | 82 | #define S3C2410_LCDCON5_INVVCLK (1<<10) |
@@ -100,10 +111,16 @@ | |||
100 | #define S3C2410_DITHMODE S3C2410_LCDREG(0x4C) | 111 | #define S3C2410_DITHMODE S3C2410_LCDREG(0x4C) |
101 | #define S3C2410_TPAL S3C2410_LCDREG(0x50) | 112 | #define S3C2410_TPAL S3C2410_LCDREG(0x50) |
102 | 113 | ||
114 | #define S3C2410_TPAL_EN (1<<24) | ||
115 | |||
103 | /* interrupt info */ | 116 | /* interrupt info */ |
104 | #define S3C2410_LCDINTPND S3C2410_LCDREG(0x54) | 117 | #define S3C2410_LCDINTPND S3C2410_LCDREG(0x54) |
105 | #define S3C2410_LCDSRCPND S3C2410_LCDREG(0x58) | 118 | #define S3C2410_LCDSRCPND S3C2410_LCDREG(0x58) |
106 | #define S3C2410_LCDINTMSK S3C2410_LCDREG(0x5C) | 119 | #define S3C2410_LCDINTMSK S3C2410_LCDREG(0x5C) |
120 | #define S3C2410_LCDINT_FIWSEL (1<<2) | ||
121 | #define S3C2410_LCDINT_FRSYNC (1<<1) | ||
122 | #define S3C2410_LCDINT_FICNT (1<<0) | ||
123 | |||
107 | #define S3C2410_LPCSEL S3C2410_LCDREG(0x60) | 124 | #define S3C2410_LPCSEL S3C2410_LCDREG(0x60) |
108 | 125 | ||
109 | #define S3C2410_TFTPAL(x) S3C2410_LCDREG((0x400 + (x)*4)) | 126 | #define S3C2410_TFTPAL(x) S3C2410_LCDREG((0x400 + (x)*4)) |
diff --git a/include/asm-arm/arch-sa1100/hardware.h b/include/asm-arm/arch-sa1100/hardware.h index 10c62db34362..19c3b1e186bb 100644 --- a/include/asm-arm/arch-sa1100/hardware.h +++ b/include/asm-arm/arch-sa1100/hardware.h | |||
@@ -49,23 +49,9 @@ | |||
49 | ( (((x)&0x00ffffff) | (((x)&(0x30000000>>VIO_SHIFT))<<VIO_SHIFT)) + PIO_START ) | 49 | ( (((x)&0x00ffffff) | (((x)&(0x30000000>>VIO_SHIFT))<<VIO_SHIFT)) + PIO_START ) |
50 | 50 | ||
51 | #ifndef __ASSEMBLY__ | 51 | #ifndef __ASSEMBLY__ |
52 | #include <asm/types.h> | ||
53 | 52 | ||
54 | #if 0 | 53 | # define __REG(x) (*((volatile unsigned long *)io_p2v(x))) |
55 | # define __REG(x) (*((volatile u32 *)io_p2v(x))) | 54 | # define __PREG(x) (io_v2p((unsigned long)&(x))) |
56 | #else | ||
57 | /* | ||
58 | * This __REG() version gives the same results as the one above, except | ||
59 | * that we are fooling gcc somehow so it generates far better and smaller | ||
60 | * assembly code for access to contigous registers. It's a shame that gcc | ||
61 | * doesn't guess this by itself. | ||
62 | */ | ||
63 | typedef struct { volatile u32 offset[4096]; } __regbase; | ||
64 | # define __REGP(x) ((__regbase *)((x)&~4095))->offset[((x)&4095)>>2] | ||
65 | # define __REG(x) __REGP(io_p2v(x)) | ||
66 | #endif | ||
67 | |||
68 | # define __PREG(x) (io_v2p((u32)&(x))) | ||
69 | 55 | ||
70 | #else | 56 | #else |
71 | 57 | ||
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h index 035cdcff43d2..e81baff4f54b 100644 --- a/include/asm-arm/cacheflush.h +++ b/include/asm-arm/cacheflush.h | |||
@@ -256,7 +256,7 @@ extern void dmac_flush_range(unsigned long, unsigned long); | |||
256 | * Convert calls to our calling convention. | 256 | * Convert calls to our calling convention. |
257 | */ | 257 | */ |
258 | #define flush_cache_all() __cpuc_flush_kern_all() | 258 | #define flush_cache_all() __cpuc_flush_kern_all() |
259 | 259 | #ifndef CONFIG_CPU_CACHE_VIPT | |
260 | static inline void flush_cache_mm(struct mm_struct *mm) | 260 | static inline void flush_cache_mm(struct mm_struct *mm) |
261 | { | 261 | { |
262 | if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask)) | 262 | if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask)) |
@@ -279,6 +279,11 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned l | |||
279 | __cpuc_flush_user_range(addr, addr + PAGE_SIZE, vma->vm_flags); | 279 | __cpuc_flush_user_range(addr, addr + PAGE_SIZE, vma->vm_flags); |
280 | } | 280 | } |
281 | } | 281 | } |
282 | #else | ||
283 | extern void flush_cache_mm(struct mm_struct *mm); | ||
284 | extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end); | ||
285 | extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn); | ||
286 | #endif | ||
282 | 287 | ||
283 | /* | 288 | /* |
284 | * flush_cache_user_range is used when we want to ensure that the | 289 | * flush_cache_user_range is used when we want to ensure that the |
diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h index 38ea5899a580..ead3ced38cb8 100644 --- a/include/asm-arm/pci.h +++ b/include/asm-arm/pci.h | |||
@@ -64,6 +64,19 @@ extern void | |||
64 | pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | 64 | pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, |
65 | struct pci_bus_region *region); | 65 | struct pci_bus_region *region); |
66 | 66 | ||
67 | static inline struct resource * | ||
68 | pcibios_select_root(struct pci_dev *pdev, struct resource *res) | ||
69 | { | ||
70 | struct resource *root = NULL; | ||
71 | |||
72 | if (res->flags & IORESOURCE_IO) | ||
73 | root = &ioport_resource; | ||
74 | if (res->flags & IORESOURCE_MEM) | ||
75 | root = &iomem_resource; | ||
76 | |||
77 | return root; | ||
78 | } | ||
79 | |||
67 | static inline void pcibios_add_platform_entries(struct pci_dev *dev) | 80 | static inline void pcibios_add_platform_entries(struct pci_dev *dev) |
68 | { | 81 | { |
69 | } | 82 | } |
diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h index 1f906d09b688..cb4906b45555 100644 --- a/include/asm-arm/spinlock.h +++ b/include/asm-arm/spinlock.h | |||
@@ -16,21 +16,14 @@ | |||
16 | * Unlocked value: 0 | 16 | * Unlocked value: 0 |
17 | * Locked value: 1 | 17 | * Locked value: 1 |
18 | */ | 18 | */ |
19 | typedef struct { | ||
20 | volatile unsigned int lock; | ||
21 | #ifdef CONFIG_PREEMPT | ||
22 | unsigned int break_lock; | ||
23 | #endif | ||
24 | } spinlock_t; | ||
25 | 19 | ||
26 | #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 } | 20 | #define __raw_spin_is_locked(x) ((x)->lock != 0) |
21 | #define __raw_spin_unlock_wait(lock) \ | ||
22 | do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0) | ||
27 | 23 | ||
28 | #define spin_lock_init(x) do { *(x) = SPIN_LOCK_UNLOCKED; } while (0) | 24 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) |
29 | #define spin_is_locked(x) ((x)->lock != 0) | ||
30 | #define spin_unlock_wait(x) do { barrier(); } while (spin_is_locked(x)) | ||
31 | #define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock) | ||
32 | 25 | ||
33 | static inline void _raw_spin_lock(spinlock_t *lock) | 26 | static inline void __raw_spin_lock(raw_spinlock_t *lock) |
34 | { | 27 | { |
35 | unsigned long tmp; | 28 | unsigned long tmp; |
36 | 29 | ||
@@ -47,7 +40,7 @@ static inline void _raw_spin_lock(spinlock_t *lock) | |||
47 | smp_mb(); | 40 | smp_mb(); |
48 | } | 41 | } |
49 | 42 | ||
50 | static inline int _raw_spin_trylock(spinlock_t *lock) | 43 | static inline int __raw_spin_trylock(raw_spinlock_t *lock) |
51 | { | 44 | { |
52 | unsigned long tmp; | 45 | unsigned long tmp; |
53 | 46 | ||
@@ -67,7 +60,7 @@ static inline int _raw_spin_trylock(spinlock_t *lock) | |||
67 | } | 60 | } |
68 | } | 61 | } |
69 | 62 | ||
70 | static inline void _raw_spin_unlock(spinlock_t *lock) | 63 | static inline void __raw_spin_unlock(raw_spinlock_t *lock) |
71 | { | 64 | { |
72 | smp_mb(); | 65 | smp_mb(); |
73 | 66 | ||
@@ -80,23 +73,14 @@ static inline void _raw_spin_unlock(spinlock_t *lock) | |||
80 | 73 | ||
81 | /* | 74 | /* |
82 | * RWLOCKS | 75 | * RWLOCKS |
83 | */ | 76 | * |
84 | typedef struct { | 77 | * |
85 | volatile unsigned int lock; | ||
86 | #ifdef CONFIG_PREEMPT | ||
87 | unsigned int break_lock; | ||
88 | #endif | ||
89 | } rwlock_t; | ||
90 | |||
91 | #define RW_LOCK_UNLOCKED (rwlock_t) { 0 } | ||
92 | #define rwlock_init(x) do { *(x) = RW_LOCK_UNLOCKED; } while (0) | ||
93 | #define rwlock_is_locked(x) (*((volatile unsigned int *)(x)) != 0) | ||
94 | |||
95 | /* | ||
96 | * Write locks are easy - we just set bit 31. When unlocking, we can | 78 | * Write locks are easy - we just set bit 31. When unlocking, we can |
97 | * just write zero since the lock is exclusively held. | 79 | * just write zero since the lock is exclusively held. |
98 | */ | 80 | */ |
99 | static inline void _raw_write_lock(rwlock_t *rw) | 81 | #define rwlock_is_locked(x) (*((volatile unsigned int *)(x)) != 0) |
82 | |||
83 | static inline void __raw_write_lock(rwlock_t *rw) | ||
100 | { | 84 | { |
101 | unsigned long tmp; | 85 | unsigned long tmp; |
102 | 86 | ||
@@ -113,7 +97,7 @@ static inline void _raw_write_lock(rwlock_t *rw) | |||
113 | smp_mb(); | 97 | smp_mb(); |
114 | } | 98 | } |
115 | 99 | ||
116 | static inline int _raw_write_trylock(rwlock_t *rw) | 100 | static inline int __raw_write_trylock(rwlock_t *rw) |
117 | { | 101 | { |
118 | unsigned long tmp; | 102 | unsigned long tmp; |
119 | 103 | ||
@@ -133,7 +117,7 @@ static inline int _raw_write_trylock(rwlock_t *rw) | |||
133 | } | 117 | } |
134 | } | 118 | } |
135 | 119 | ||
136 | static inline void _raw_write_unlock(rwlock_t *rw) | 120 | static inline void __raw_write_unlock(raw_rwlock_t *rw) |
137 | { | 121 | { |
138 | smp_mb(); | 122 | smp_mb(); |
139 | 123 | ||
@@ -156,7 +140,7 @@ static inline void _raw_write_unlock(rwlock_t *rw) | |||
156 | * currently active. However, we know we won't have any write | 140 | * currently active. However, we know we won't have any write |
157 | * locks. | 141 | * locks. |
158 | */ | 142 | */ |
159 | static inline void _raw_read_lock(rwlock_t *rw) | 143 | static inline void __raw_read_lock(raw_rwlock_t *rw) |
160 | { | 144 | { |
161 | unsigned long tmp, tmp2; | 145 | unsigned long tmp, tmp2; |
162 | 146 | ||
@@ -173,7 +157,7 @@ static inline void _raw_read_lock(rwlock_t *rw) | |||
173 | smp_mb(); | 157 | smp_mb(); |
174 | } | 158 | } |
175 | 159 | ||
176 | static inline void _raw_read_unlock(rwlock_t *rw) | 160 | static inline void __raw_read_unlock(rwlock_t *rw) |
177 | { | 161 | { |
178 | unsigned long tmp, tmp2; | 162 | unsigned long tmp, tmp2; |
179 | 163 | ||
@@ -190,6 +174,6 @@ static inline void _raw_read_unlock(rwlock_t *rw) | |||
190 | : "cc"); | 174 | : "cc"); |
191 | } | 175 | } |
192 | 176 | ||
193 | #define _raw_read_trylock(lock) generic_raw_read_trylock(lock) | 177 | #define __raw_read_trylock(lock) generic__raw_read_trylock(lock) |
194 | 178 | ||
195 | #endif /* __ASM_SPINLOCK_H */ | 179 | #endif /* __ASM_SPINLOCK_H */ |
diff --git a/include/asm-arm/spinlock_types.h b/include/asm-arm/spinlock_types.h new file mode 100644 index 000000000000..43e83f6d2ee5 --- /dev/null +++ b/include/asm-arm/spinlock_types.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef __ASM_SPINLOCK_TYPES_H | ||
2 | #define __ASM_SPINLOCK_TYPES_H | ||
3 | |||
4 | #ifndef __LINUX_SPINLOCK_TYPES_H | ||
5 | # error "please don't include this file directly" | ||
6 | #endif | ||
7 | |||
8 | typedef struct { | ||
9 | volatile unsigned int lock; | ||
10 | } raw_spinlock_t; | ||
11 | |||
12 | #define __RAW_SPIN_LOCK_UNLOCKED { 0 } | ||
13 | |||
14 | typedef struct { | ||
15 | volatile unsigned int lock; | ||
16 | } raw_rwlock_t; | ||
17 | |||
18 | #define __RAW_RW_LOCK_UNLOCKED { 0 } | ||
19 | |||
20 | #endif | ||
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h index 278de61224d1..c49df635a80f 100644 --- a/include/asm-arm/unistd.h +++ b/include/asm-arm/unistd.h | |||
@@ -355,6 +355,9 @@ | |||
355 | #define __NR_inotify_init (__NR_SYSCALL_BASE+316) | 355 | #define __NR_inotify_init (__NR_SYSCALL_BASE+316) |
356 | #define __NR_inotify_add_watch (__NR_SYSCALL_BASE+317) | 356 | #define __NR_inotify_add_watch (__NR_SYSCALL_BASE+317) |
357 | #define __NR_inotify_rm_watch (__NR_SYSCALL_BASE+318) | 357 | #define __NR_inotify_rm_watch (__NR_SYSCALL_BASE+318) |
358 | #define __NR_mbind (__NR_SYSCALL_BASE+319) | ||
359 | #define __NR_get_mempolicy (__NR_SYSCALL_BASE+320) | ||
360 | #define __NR_set_mempolicy (__NR_SYSCALL_BASE+321) | ||
358 | 361 | ||
359 | /* | 362 | /* |
360 | * The following SWIs are ARM private. | 363 | * The following SWIs are ARM private. |