diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-25 13:25:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-25 13:25:13 -0400 |
commit | 43df5eac00734436e2bc5a5c11488b1a7accecc7 (patch) | |
tree | c830ffbdea3c6ab00f31afeedc26392bd4a55d63 | |
parent | 7be426c6e3a8ad7dcc8791589cea8af7aaafdf6f (diff) | |
parent | e55c57e0b51c68d78845549505057169c6c3cba6 (diff) |
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
-rw-r--r-- | drivers/serial/sunzilog.c | 8 | ||||
-rw-r--r-- | include/asm-sparc64/termios.h | 78 |
2 files changed, 45 insertions, 41 deletions
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c index 5c4231ae295..8e65206d3d7 100644 --- a/drivers/serial/sunzilog.c +++ b/drivers/serial/sunzilog.c | |||
@@ -1071,7 +1071,7 @@ static void __init sunzilog_alloc_tables(void) | |||
1071 | */ | 1071 | */ |
1072 | static struct zilog_layout __iomem * __init get_zs_sun4u(int chip, int zsnode) | 1072 | static struct zilog_layout __iomem * __init get_zs_sun4u(int chip, int zsnode) |
1073 | { | 1073 | { |
1074 | unsigned long mapped_addr; | 1074 | void __iomem *mapped_addr; |
1075 | unsigned int sun4u_ino; | 1075 | unsigned int sun4u_ino; |
1076 | struct sbus_bus *sbus = NULL; | 1076 | struct sbus_bus *sbus = NULL; |
1077 | struct sbus_dev *sdev = NULL; | 1077 | struct sbus_dev *sdev = NULL; |
@@ -1111,9 +1111,9 @@ static struct zilog_layout __iomem * __init get_zs_sun4u(int chip, int zsnode) | |||
1111 | apply_fhc_ranges(central_bus->child, | 1111 | apply_fhc_ranges(central_bus->child, |
1112 | &zsregs[0], 1); | 1112 | &zsregs[0], 1); |
1113 | apply_central_ranges(central_bus, &zsregs[0], 1); | 1113 | apply_central_ranges(central_bus, &zsregs[0], 1); |
1114 | mapped_addr = | 1114 | mapped_addr = (void __iomem *) |
1115 | (((u64)zsregs[0].which_io)<<32UL) | | 1115 | ((((u64)zsregs[0].which_io)<<32UL) | |
1116 | ((u64)zsregs[0].phys_addr); | 1116 | ((u64)zsregs[0].phys_addr)); |
1117 | } | 1117 | } |
1118 | 1118 | ||
1119 | if (zilog_irq == -1) { | 1119 | if (zilog_irq == -1) { |
diff --git a/include/asm-sparc64/termios.h b/include/asm-sparc64/termios.h index 8effce0da08..9777a9cca88 100644 --- a/include/asm-sparc64/termios.h +++ b/include/asm-sparc64/termios.h | |||
@@ -100,16 +100,17 @@ struct winsize { | |||
100 | #define user_termio_to_kernel_termios(termios, termio) \ | 100 | #define user_termio_to_kernel_termios(termios, termio) \ |
101 | ({ \ | 101 | ({ \ |
102 | unsigned short tmp; \ | 102 | unsigned short tmp; \ |
103 | get_user(tmp, &(termio)->c_iflag); \ | 103 | int err; \ |
104 | err = get_user(tmp, &(termio)->c_iflag); \ | ||
104 | (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \ | 105 | (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \ |
105 | get_user(tmp, &(termio)->c_oflag); \ | 106 | err |= get_user(tmp, &(termio)->c_oflag); \ |
106 | (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \ | 107 | (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \ |
107 | get_user(tmp, &(termio)->c_cflag); \ | 108 | err |= get_user(tmp, &(termio)->c_cflag); \ |
108 | (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \ | 109 | (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \ |
109 | get_user(tmp, &(termio)->c_lflag); \ | 110 | err |= get_user(tmp, &(termio)->c_lflag); \ |
110 | (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \ | 111 | (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \ |
111 | copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ | 112 | err |= copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ |
112 | 0; \ | 113 | err; \ |
113 | }) | 114 | }) |
114 | 115 | ||
115 | /* | 116 | /* |
@@ -119,53 +120,56 @@ struct winsize { | |||
119 | */ | 120 | */ |
120 | #define kernel_termios_to_user_termio(termio, termios) \ | 121 | #define kernel_termios_to_user_termio(termio, termios) \ |
121 | ({ \ | 122 | ({ \ |
122 | put_user((termios)->c_iflag, &(termio)->c_iflag); \ | 123 | int err; \ |
123 | put_user((termios)->c_oflag, &(termio)->c_oflag); \ | 124 | err = put_user((termios)->c_iflag, &(termio)->c_iflag); \ |
124 | put_user((termios)->c_cflag, &(termio)->c_cflag); \ | 125 | err |= put_user((termios)->c_oflag, &(termio)->c_oflag); \ |
125 | put_user((termios)->c_lflag, &(termio)->c_lflag); \ | 126 | err |= put_user((termios)->c_cflag, &(termio)->c_cflag); \ |
126 | put_user((termios)->c_line, &(termio)->c_line); \ | 127 | err |= put_user((termios)->c_lflag, &(termio)->c_lflag); \ |
127 | copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | 128 | err |= put_user((termios)->c_line, &(termio)->c_line); \ |
129 | err |= copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ | ||
128 | if (!((termios)->c_lflag & ICANON)) { \ | 130 | if (!((termios)->c_lflag & ICANON)) { \ |
129 | put_user((termios)->c_cc[VMIN], &(termio)->c_cc[_VMIN]); \ | 131 | err |= put_user((termios)->c_cc[VMIN], &(termio)->c_cc[_VMIN]); \ |
130 | put_user((termios)->c_cc[VTIME], &(termio)->c_cc[_VTIME]); \ | 132 | err |= put_user((termios)->c_cc[VTIME], &(termio)->c_cc[_VTIME]); \ |
131 | } \ | 133 | } \ |
132 | 0; \ | 134 | err; \ |
133 | }) | 135 | }) |
134 | 136 | ||
135 | #define user_termios_to_kernel_termios(k, u) \ | 137 | #define user_termios_to_kernel_termios(k, u) \ |
136 | ({ \ | 138 | ({ \ |
137 | get_user((k)->c_iflag, &(u)->c_iflag); \ | 139 | int err; \ |
138 | get_user((k)->c_oflag, &(u)->c_oflag); \ | 140 | err = get_user((k)->c_iflag, &(u)->c_iflag); \ |
139 | get_user((k)->c_cflag, &(u)->c_cflag); \ | 141 | err |= get_user((k)->c_oflag, &(u)->c_oflag); \ |
140 | get_user((k)->c_lflag, &(u)->c_lflag); \ | 142 | err |= get_user((k)->c_cflag, &(u)->c_cflag); \ |
141 | get_user((k)->c_line, &(u)->c_line); \ | 143 | err |= get_user((k)->c_lflag, &(u)->c_lflag); \ |
142 | copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \ | 144 | err |= get_user((k)->c_line, &(u)->c_line); \ |
145 | err |= copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \ | ||
143 | if((k)->c_lflag & ICANON) { \ | 146 | if((k)->c_lflag & ICANON) { \ |
144 | get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ | 147 | err |= get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ |
145 | get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ | 148 | err |= get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ |
146 | } else { \ | 149 | } else { \ |
147 | get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ | 150 | err |= get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ |
148 | get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ | 151 | err |= get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ |
149 | } \ | 152 | } \ |
150 | 0; \ | 153 | err; \ |
151 | }) | 154 | }) |
152 | 155 | ||
153 | #define kernel_termios_to_user_termios(u, k) \ | 156 | #define kernel_termios_to_user_termios(u, k) \ |
154 | ({ \ | 157 | ({ \ |
155 | put_user((k)->c_iflag, &(u)->c_iflag); \ | 158 | int err; \ |
156 | put_user((k)->c_oflag, &(u)->c_oflag); \ | 159 | err = put_user((k)->c_iflag, &(u)->c_iflag); \ |
157 | put_user((k)->c_cflag, &(u)->c_cflag); \ | 160 | err |= put_user((k)->c_oflag, &(u)->c_oflag); \ |
158 | put_user((k)->c_lflag, &(u)->c_lflag); \ | 161 | err |= put_user((k)->c_cflag, &(u)->c_cflag); \ |
159 | put_user((k)->c_line, &(u)->c_line); \ | 162 | err |= put_user((k)->c_lflag, &(u)->c_lflag); \ |
160 | copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \ | 163 | err |= put_user((k)->c_line, &(u)->c_line); \ |
164 | err |= copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \ | ||
161 | if(!((k)->c_lflag & ICANON)) { \ | 165 | if(!((k)->c_lflag & ICANON)) { \ |
162 | put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ | 166 | err |= put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ |
163 | put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ | 167 | err |= put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ |
164 | } else { \ | 168 | } else { \ |
165 | put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ | 169 | err |= put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ |
166 | put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ | 170 | err |= put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ |
167 | } \ | 171 | } \ |
168 | 0; \ | 172 | err; \ |
169 | }) | 173 | }) |
170 | 174 | ||
171 | #endif /* __KERNEL__ */ | 175 | #endif /* __KERNEL__ */ |