aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 17:39:44 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 17:39:44 -0400
commit9cf52b2921fbe62566b6b2ee79f71203749c9e5e (patch)
tree5705ab0af0adfb7043407b5a4ffbf43fcbff42bd /include
parent952184304fbf030f0133d8b66a91b2847dce729e (diff)
parent5c45708352a040f19caceb683c78bc86aad466f6 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: [SPARC/64]: Consolidate of_register_driver [SPARC] Videopix Frame Grabber: Convert device_lock_sem to mutex [SPARC]: Support for new termios. [SPARC64]: Check of_get_property() return in pci_determine_mem_io_space(). [SPARC64]: Fix boot failures due to bootmem. [SPARC64]: Implement atomic backoff.
Diffstat (limited to 'include')
-rw-r--r--include/asm-sparc/ioctls.h4
-rw-r--r--include/asm-sparc/of_platform.h5
-rw-r--r--include/asm-sparc/termbits.h15
-rw-r--r--include/asm-sparc/termios.h48
-rw-r--r--include/asm-sparc64/backoff.h28
-rw-r--r--include/asm-sparc64/ioctls.h4
-rw-r--r--include/asm-sparc64/of_platform.h5
-rw-r--r--include/asm-sparc64/termbits.h17
-rw-r--r--include/asm-sparc64/termios.h42
-rw-r--r--include/linux/of_platform.h4
10 files changed, 159 insertions, 13 deletions
diff --git a/include/asm-sparc/ioctls.h b/include/asm-sparc/ioctls.h
index bdf77b0dfd8e..058c2064f706 100644
--- a/include/asm-sparc/ioctls.h
+++ b/include/asm-sparc/ioctls.h
@@ -15,6 +15,10 @@
15#define TCSETS _IOW('T', 9, struct termios) 15#define TCSETS _IOW('T', 9, struct termios)
16#define TCSETSW _IOW('T', 10, struct termios) 16#define TCSETSW _IOW('T', 10, struct termios)
17#define TCSETSF _IOW('T', 11, struct termios) 17#define TCSETSF _IOW('T', 11, struct termios)
18#define TCGETS2 _IOR('T', 12, struct termios2)
19#define TCSETS2 _IOW('T', 13, struct termios2)
20#define TCSETSW2 _IOW('T', 14, struct termios2)
21#define TCSETSF2 _IOW('T', 15, struct termios2)
18 22
19/* Note that all the ioctls that are not available in Linux have a 23/* Note that all the ioctls that are not available in Linux have a
20 * double underscore on the front to: a) avoid some programs to 24 * double underscore on the front to: a) avoid some programs to
diff --git a/include/asm-sparc/of_platform.h b/include/asm-sparc/of_platform.h
index 64a230064ef2..d638737ff13c 100644
--- a/include/asm-sparc/of_platform.h
+++ b/include/asm-sparc/of_platform.h
@@ -18,12 +18,9 @@
18 18
19extern struct bus_type ebus_bus_type; 19extern struct bus_type ebus_bus_type;
20extern struct bus_type sbus_bus_type; 20extern struct bus_type sbus_bus_type;
21extern struct bus_type of_platform_bus_type; 21
22#define of_bus_type of_platform_bus_type /* for compatibility */ 22#define of_bus_type of_platform_bus_type /* for compatibility */
23 23
24extern int of_register_driver(struct of_platform_driver *drv,
25 struct bus_type *bus);
26extern void of_unregister_driver(struct of_platform_driver *drv);
27extern struct of_device *of_platform_device_create(struct device_node *np, 24extern struct of_device *of_platform_device_create(struct device_node *np,
28 const char *bus_id, 25 const char *bus_id,
29 struct device *parent, 26 struct device *parent,
diff --git a/include/asm-sparc/termbits.h b/include/asm-sparc/termbits.h
index 5eb00a105d7c..90cf2210118b 100644
--- a/include/asm-sparc/termbits.h
+++ b/include/asm-sparc/termbits.h
@@ -31,6 +31,18 @@ struct termios {
31#endif 31#endif
32}; 32};
33 33
34struct termios2 {
35 tcflag_t c_iflag; /* input mode flags */
36 tcflag_t c_oflag; /* output mode flags */
37 tcflag_t c_cflag; /* control mode flags */
38 tcflag_t c_lflag; /* local mode flags */
39 cc_t c_line; /* line discipline */
40 cc_t c_cc[NCCS]; /* control characters */
41 cc_t _x_cc[2]; /* padding to match ktermios */
42 speed_t c_ispeed; /* input speed */
43 speed_t c_ospeed; /* output speed */
44};
45
34struct ktermios { 46struct ktermios {
35 tcflag_t c_iflag; /* input mode flags */ 47 tcflag_t c_iflag; /* input mode flags */
36 tcflag_t c_oflag; /* output mode flags */ 48 tcflag_t c_oflag; /* output mode flags */
@@ -160,6 +172,7 @@ struct ktermios {
160#define CLOCAL 0x00000800 172#define CLOCAL 0x00000800
161#define CBAUDEX 0x00001000 173#define CBAUDEX 0x00001000
162/* We'll never see these speeds with the Zilogs, but for completeness... */ 174/* We'll never see these speeds with the Zilogs, but for completeness... */
175#define BOTHER 0x00001000
163#define B57600 0x00001001 176#define B57600 0x00001001
164#define B115200 0x00001002 177#define B115200 0x00001002
165#define B230400 0x00001003 178#define B230400 0x00001003
@@ -189,6 +202,8 @@ struct ktermios {
189#define CMSPAR 0x40000000 /* mark or space (stick) parity */ 202#define CMSPAR 0x40000000 /* mark or space (stick) parity */
190#define CRTSCTS 0x80000000 /* flow control */ 203#define CRTSCTS 0x80000000 /* flow control */
191 204
205#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
206
192/* c_lflag bits */ 207/* c_lflag bits */
193#define ISIG 0x00000001 208#define ISIG 0x00000001
194#define ICANON 0x00000002 209#define ICANON 0x00000002
diff --git a/include/asm-sparc/termios.h b/include/asm-sparc/termios.h
index d767f206ab33..4333232abb9f 100644
--- a/include/asm-sparc/termios.h
+++ b/include/asm-sparc/termios.h
@@ -108,13 +108,55 @@ struct winsize {
108 108
109#define user_termios_to_kernel_termios(k, u) \ 109#define user_termios_to_kernel_termios(k, u) \
110({ \ 110({ \
111 int err; \
112 err = get_user((k)->c_iflag, &(u)->c_iflag); \
113 err |= get_user((k)->c_oflag, &(u)->c_oflag); \
114 err |= get_user((k)->c_cflag, &(u)->c_cflag); \
115 err |= get_user((k)->c_lflag, &(u)->c_lflag); \
116 err |= get_user((k)->c_line, &(u)->c_line); \
117 err |= copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \
118 if ((k)->c_lflag & ICANON) { \
119 err |= get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
120 err |= get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
121 } else { \
122 err |= get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \
123 err |= get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
124 } \
125 err |= get_user((k)->c_ispeed, &(u)->c_ispeed); \
126 err |= get_user((k)->c_ospeed, &(u)->c_ospeed); \
127 err; \
128})
129
130#define kernel_termios_to_user_termios(u, k) \
131({ \
132 int err; \
133 err = put_user((k)->c_iflag, &(u)->c_iflag); \
134 err |= put_user((k)->c_oflag, &(u)->c_oflag); \
135 err |= put_user((k)->c_cflag, &(u)->c_cflag); \
136 err |= put_user((k)->c_lflag, &(u)->c_lflag); \
137 err |= put_user((k)->c_line, &(u)->c_line); \
138 err |= copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \
139 if (!((k)->c_lflag & ICANON)) { \
140 err |= put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \
141 err |= put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
142 } else { \
143 err |= put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
144 err |= put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
145 } \
146 err |= put_user((k)->c_ispeed, &(u)->c_ispeed); \
147 err |= put_user((k)->c_ospeed, &(u)->c_ospeed); \
148 err; \
149})
150
151#define user_termios_to_kernel_termios_1(k, u) \
152({ \
111 get_user((k)->c_iflag, &(u)->c_iflag); \ 153 get_user((k)->c_iflag, &(u)->c_iflag); \
112 get_user((k)->c_oflag, &(u)->c_oflag); \ 154 get_user((k)->c_oflag, &(u)->c_oflag); \
113 get_user((k)->c_cflag, &(u)->c_cflag); \ 155 get_user((k)->c_cflag, &(u)->c_cflag); \
114 get_user((k)->c_lflag, &(u)->c_lflag); \ 156 get_user((k)->c_lflag, &(u)->c_lflag); \
115 get_user((k)->c_line, &(u)->c_line); \ 157 get_user((k)->c_line, &(u)->c_line); \
116 copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \ 158 copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \
117 if((k)->c_lflag & ICANON) { \ 159 if ((k)->c_lflag & ICANON) { \
118 get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ 160 get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
119 get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ 161 get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
120 } else { \ 162 } else { \
@@ -124,7 +166,7 @@ struct winsize {
124 0; \ 166 0; \
125}) 167})
126 168
127#define kernel_termios_to_user_termios(u, k) \ 169#define kernel_termios_to_user_termios_1(u, k) \
128({ \ 170({ \
129 put_user((k)->c_iflag, &(u)->c_iflag); \ 171 put_user((k)->c_iflag, &(u)->c_iflag); \
130 put_user((k)->c_oflag, &(u)->c_oflag); \ 172 put_user((k)->c_oflag, &(u)->c_oflag); \
@@ -132,7 +174,7 @@ struct winsize {
132 put_user((k)->c_lflag, &(u)->c_lflag); \ 174 put_user((k)->c_lflag, &(u)->c_lflag); \
133 put_user((k)->c_line, &(u)->c_line); \ 175 put_user((k)->c_line, &(u)->c_line); \
134 copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \ 176 copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \
135 if(!((k)->c_lflag & ICANON)) { \ 177 if (!((k)->c_lflag & ICANON)) { \
136 put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ 178 put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \
137 put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ 179 put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
138 } else { \ 180 } else { \
diff --git a/include/asm-sparc64/backoff.h b/include/asm-sparc64/backoff.h
new file mode 100644
index 000000000000..0e32f8b62fd2
--- /dev/null
+++ b/include/asm-sparc64/backoff.h
@@ -0,0 +1,28 @@
1#ifndef _SPARC64_BACKOFF_H
2#define _SPARC64_BACKOFF_H
3
4#define BACKOFF_LIMIT (4 * 1024)
5
6#ifdef CONFIG_SMP
7
8#define BACKOFF_SETUP(reg) \
9 mov 1, reg
10
11#define BACKOFF_SPIN(reg, tmp, label) \
12 mov reg, tmp; \
1388: brnz,pt tmp, 88b; \
14 sub tmp, 1, tmp; \
15 cmp reg, BACKOFF_LIMIT; \
16 bg,pn %xcc, label; \
17 nop; \
18 ba,pt %xcc, label; \
19 sllx reg, 1, reg;
20
21#else
22
23#define BACKOFF_SETUP(reg)
24#define BACKOFF_SPIN(reg, tmp, label)
25
26#endif
27
28#endif /* _SPARC64_BACKOFF_H */
diff --git a/include/asm-sparc64/ioctls.h b/include/asm-sparc64/ioctls.h
index 2223b6d0e5ed..083c9a0f37de 100644
--- a/include/asm-sparc64/ioctls.h
+++ b/include/asm-sparc64/ioctls.h
@@ -16,6 +16,10 @@
16#define TCSETS _IOW('T', 9, struct termios) 16#define TCSETS _IOW('T', 9, struct termios)
17#define TCSETSW _IOW('T', 10, struct termios) 17#define TCSETSW _IOW('T', 10, struct termios)
18#define TCSETSF _IOW('T', 11, struct termios) 18#define TCSETSF _IOW('T', 11, struct termios)
19#define TCGETS2 _IOR('T', 12, struct termios2)
20#define TCSETS2 _IOW('T', 13, struct termios2)
21#define TCSETSW2 _IOW('T', 14, struct termios2)
22#define TCSETSF2 _IOW('T', 15, struct termios2)
19 23
20/* Note that all the ioctls that are not available in Linux have a 24/* Note that all the ioctls that are not available in Linux have a
21 * double underscore on the front to: a) avoid some programs to 25 * double underscore on the front to: a) avoid some programs to
diff --git a/include/asm-sparc64/of_platform.h b/include/asm-sparc64/of_platform.h
index f7c1f17c7d52..f15cfa723916 100644
--- a/include/asm-sparc64/of_platform.h
+++ b/include/asm-sparc64/of_platform.h
@@ -19,12 +19,9 @@
19extern struct bus_type isa_bus_type; 19extern struct bus_type isa_bus_type;
20extern struct bus_type ebus_bus_type; 20extern struct bus_type ebus_bus_type;
21extern struct bus_type sbus_bus_type; 21extern struct bus_type sbus_bus_type;
22extern struct bus_type of_platform_bus_type; 22
23#define of_bus_type of_platform_bus_type /* for compatibility */ 23#define of_bus_type of_platform_bus_type /* for compatibility */
24 24
25extern int of_register_driver(struct of_platform_driver *drv,
26 struct bus_type *bus);
27extern void of_unregister_driver(struct of_platform_driver *drv);
28extern struct of_device *of_platform_device_create(struct device_node *np, 25extern struct of_device *of_platform_device_create(struct device_node *np,
29 const char *bus_id, 26 const char *bus_id,
30 struct device *parent, 27 struct device *parent,
diff --git a/include/asm-sparc64/termbits.h b/include/asm-sparc64/termbits.h
index 705cd44b4173..ebe31c152f16 100644
--- a/include/asm-sparc64/termbits.h
+++ b/include/asm-sparc64/termbits.h
@@ -5,8 +5,6 @@
5 5
6typedef unsigned char cc_t; 6typedef unsigned char cc_t;
7typedef unsigned int speed_t; 7typedef unsigned int speed_t;
8
9/* XXX is this right for sparc64? it was an unsigned long... XXX */
10typedef unsigned int tcflag_t; 8typedef unsigned int tcflag_t;
11 9
12#define NCC 8 10#define NCC 8
@@ -33,6 +31,18 @@ struct termios {
33#endif 31#endif
34}; 32};
35 33
34struct termios2 {
35 tcflag_t c_iflag; /* input mode flags */
36 tcflag_t c_oflag; /* output mode flags */
37 tcflag_t c_cflag; /* control mode flags */
38 tcflag_t c_lflag; /* local mode flags */
39 cc_t c_line; /* line discipline */
40 cc_t c_cc[NCCS]; /* control characters */
41 cc_t _x_cc[2]; /* padding to match ktermios */
42 speed_t c_ispeed; /* input speed */
43 speed_t c_ospeed; /* output speed */
44};
45
36struct ktermios { 46struct ktermios {
37 tcflag_t c_iflag; /* input mode flags */ 47 tcflag_t c_iflag; /* input mode flags */
38 tcflag_t c_oflag; /* output mode flags */ 48 tcflag_t c_oflag; /* output mode flags */
@@ -161,6 +171,7 @@ struct ktermios {
161#define HUPCL 0x00000400 171#define HUPCL 0x00000400
162#define CLOCAL 0x00000800 172#define CLOCAL 0x00000800
163#define CBAUDEX 0x00001000 173#define CBAUDEX 0x00001000
174#define BOTHER 0x00001000
164#define B57600 0x00001001 175#define B57600 0x00001001
165#define B115200 0x00001002 176#define B115200 0x00001002
166#define B230400 0x00001003 177#define B230400 0x00001003
@@ -190,6 +201,8 @@ struct ktermios {
190#define CMSPAR 0x40000000 /* mark or space (stick) parity */ 201#define CMSPAR 0x40000000 /* mark or space (stick) parity */
191#define CRTSCTS 0x80000000 /* flow control */ 202#define CRTSCTS 0x80000000 /* flow control */
192 203
204#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
205
193/* c_lflag bits */ 206/* c_lflag bits */
194#define ISIG 0x00000001 207#define ISIG 0x00000001
195#define ICANON 0x00000002 208#define ICANON 0x00000002
diff --git a/include/asm-sparc64/termios.h b/include/asm-sparc64/termios.h
index f05d390993d5..ef527211f8a8 100644
--- a/include/asm-sparc64/termios.h
+++ b/include/asm-sparc64/termios.h
@@ -123,6 +123,8 @@ struct winsize {
123 err |= get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ 123 err |= get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \
124 err |= get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ 124 err |= get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
125 } \ 125 } \
126 err |= get_user((k)->c_ispeed, &(u)->c_ispeed); \
127 err |= get_user((k)->c_ospeed, &(u)->c_ospeed); \
126 err; \ 128 err; \
127}) 129})
128 130
@@ -142,6 +144,46 @@ struct winsize {
142 err |= put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ 144 err |= put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
143 err |= put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ 145 err |= put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
144 } \ 146 } \
147 err |= put_user((k)->c_ispeed, &(u)->c_ispeed); \
148 err |= put_user((k)->c_ospeed, &(u)->c_ospeed); \
149 err; \
150})
151
152#define user_termios_to_kernel_termios_1(k, u) \
153({ \
154 int err; \
155 err = get_user((k)->c_iflag, &(u)->c_iflag); \
156 err |= get_user((k)->c_oflag, &(u)->c_oflag); \
157 err |= get_user((k)->c_cflag, &(u)->c_cflag); \
158 err |= get_user((k)->c_lflag, &(u)->c_lflag); \
159 err |= get_user((k)->c_line, &(u)->c_line); \
160 err |= copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \
161 if((k)->c_lflag & ICANON) { \
162 err |= get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
163 err |= get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
164 } else { \
165 err |= get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \
166 err |= get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
167 } \
168 err; \
169})
170
171#define kernel_termios_to_user_termios_1(u, k) \
172({ \
173 int err; \
174 err = put_user((k)->c_iflag, &(u)->c_iflag); \
175 err |= put_user((k)->c_oflag, &(u)->c_oflag); \
176 err |= put_user((k)->c_cflag, &(u)->c_cflag); \
177 err |= put_user((k)->c_lflag, &(u)->c_lflag); \
178 err |= put_user((k)->c_line, &(u)->c_line); \
179 err |= copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \
180 if(!((k)->c_lflag & ICANON)) { \
181 err |= put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \
182 err |= put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
183 } else { \
184 err |= put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
185 err |= put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
186 } \
145 err; \ 187 err; \
146}) 188})
147 189
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 448f70b30a0c..a8efcfeea732 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -48,6 +48,10 @@ struct of_platform_driver
48#define to_of_platform_driver(drv) \ 48#define to_of_platform_driver(drv) \
49 container_of(drv,struct of_platform_driver, driver) 49 container_of(drv,struct of_platform_driver, driver)
50 50
51extern int of_register_driver(struct of_platform_driver *drv,
52 struct bus_type *bus);
53extern void of_unregister_driver(struct of_platform_driver *drv);
54
51#include <asm/of_platform.h> 55#include <asm/of_platform.h>
52 56
53extern struct of_device *of_find_device_by_node(struct device_node *np); 57extern struct of_device *of_find_device_by_node(struct device_node *np);