diff options
Diffstat (limited to 'arch/alpha')
-rw-r--r-- | arch/alpha/include/asm/futex.h | 2 | ||||
-rw-r--r-- | arch/alpha/include/asm/socket.h | 4 | ||||
-rw-r--r-- | arch/alpha/kernel/perf_event.c | 4 | ||||
-rw-r--r-- | arch/alpha/kernel/srmcons.c | 78 |
4 files changed, 32 insertions, 56 deletions
diff --git a/arch/alpha/include/asm/futex.h b/arch/alpha/include/asm/futex.h index e8a761aee088..f939794363ac 100644 --- a/arch/alpha/include/asm/futex.h +++ b/arch/alpha/include/asm/futex.h | |||
@@ -108,7 +108,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, | |||
108 | " lda $31,3b-2b(%0)\n" | 108 | " lda $31,3b-2b(%0)\n" |
109 | " .previous\n" | 109 | " .previous\n" |
110 | : "+r"(ret), "=&r"(prev), "=&r"(cmp) | 110 | : "+r"(ret), "=&r"(prev), "=&r"(cmp) |
111 | : "r"(uaddr), "r"((long)oldval), "r"(newval) | 111 | : "r"(uaddr), "r"((long)(int)oldval), "r"(newval) |
112 | : "memory"); | 112 | : "memory"); |
113 | 113 | ||
114 | *uval = prev; | 114 | *uval = prev; |
diff --git a/arch/alpha/include/asm/socket.h b/arch/alpha/include/asm/socket.h index 082355f159e6..dcb221a4b5be 100644 --- a/arch/alpha/include/asm/socket.h +++ b/arch/alpha/include/asm/socket.h | |||
@@ -71,6 +71,10 @@ | |||
71 | 71 | ||
72 | #define SO_WIFI_STATUS 41 | 72 | #define SO_WIFI_STATUS 41 |
73 | #define SCM_WIFI_STATUS SO_WIFI_STATUS | 73 | #define SCM_WIFI_STATUS SO_WIFI_STATUS |
74 | #define SO_PEEK_OFF 42 | ||
75 | |||
76 | /* Instruct lower device to use last 4-bytes of skb data as FCS */ | ||
77 | #define SO_NOFCS 43 | ||
74 | 78 | ||
75 | /* O_NONBLOCK clashes with the bits used for socket types. Therefore we | 79 | /* O_NONBLOCK clashes with the bits used for socket types. Therefore we |
76 | * have to define SOCK_NONBLOCK to a different value here. | 80 | * have to define SOCK_NONBLOCK to a different value here. |
diff --git a/arch/alpha/kernel/perf_event.c b/arch/alpha/kernel/perf_event.c index 8143cd7cdbfb..0dae252f7a33 100644 --- a/arch/alpha/kernel/perf_event.c +++ b/arch/alpha/kernel/perf_event.c | |||
@@ -685,6 +685,10 @@ static int alpha_pmu_event_init(struct perf_event *event) | |||
685 | { | 685 | { |
686 | int err; | 686 | int err; |
687 | 687 | ||
688 | /* does not support taken branch sampling */ | ||
689 | if (has_branch_stack(event)) | ||
690 | return -EOPNOTSUPP; | ||
691 | |||
688 | switch (event->attr.type) { | 692 | switch (event->attr.type) { |
689 | case PERF_TYPE_RAW: | 693 | case PERF_TYPE_RAW: |
690 | case PERF_TYPE_HARDWARE: | 694 | case PERF_TYPE_HARDWARE: |
diff --git a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c index 783f4e50c111..3ea809430eda 100644 --- a/arch/alpha/kernel/srmcons.c +++ b/arch/alpha/kernel/srmcons.c | |||
@@ -30,10 +30,9 @@ static int srm_is_registered_console = 0; | |||
30 | #define MAX_SRM_CONSOLE_DEVICES 1 /* only support 1 console device */ | 30 | #define MAX_SRM_CONSOLE_DEVICES 1 /* only support 1 console device */ |
31 | 31 | ||
32 | struct srmcons_private { | 32 | struct srmcons_private { |
33 | struct tty_struct *tty; | 33 | struct tty_port port; |
34 | struct timer_list timer; | 34 | struct timer_list timer; |
35 | spinlock_t lock; | 35 | } srmcons_singleton; |
36 | }; | ||
37 | 36 | ||
38 | typedef union _srmcons_result { | 37 | typedef union _srmcons_result { |
39 | struct { | 38 | struct { |
@@ -68,22 +67,21 @@ static void | |||
68 | srmcons_receive_chars(unsigned long data) | 67 | srmcons_receive_chars(unsigned long data) |
69 | { | 68 | { |
70 | struct srmcons_private *srmconsp = (struct srmcons_private *)data; | 69 | struct srmcons_private *srmconsp = (struct srmcons_private *)data; |
70 | struct tty_port *port = &srmconsp->port; | ||
71 | unsigned long flags; | 71 | unsigned long flags; |
72 | int incr = 10; | 72 | int incr = 10; |
73 | 73 | ||
74 | local_irq_save(flags); | 74 | local_irq_save(flags); |
75 | if (spin_trylock(&srmcons_callback_lock)) { | 75 | if (spin_trylock(&srmcons_callback_lock)) { |
76 | if (!srmcons_do_receive_chars(srmconsp->tty)) | 76 | if (!srmcons_do_receive_chars(port->tty)) |
77 | incr = 100; | 77 | incr = 100; |
78 | spin_unlock(&srmcons_callback_lock); | 78 | spin_unlock(&srmcons_callback_lock); |
79 | } | 79 | } |
80 | 80 | ||
81 | spin_lock(&srmconsp->lock); | 81 | spin_lock(&port->lock); |
82 | if (srmconsp->tty) { | 82 | if (port->tty) |
83 | srmconsp->timer.expires = jiffies + incr; | 83 | mod_timer(&srmconsp->timer, jiffies + incr); |
84 | add_timer(&srmconsp->timer); | 84 | spin_unlock(&port->lock); |
85 | } | ||
86 | spin_unlock(&srmconsp->lock); | ||
87 | 85 | ||
88 | local_irq_restore(flags); | 86 | local_irq_restore(flags); |
89 | } | 87 | } |
@@ -156,56 +154,22 @@ srmcons_chars_in_buffer(struct tty_struct *tty) | |||
156 | } | 154 | } |
157 | 155 | ||
158 | static int | 156 | static int |
159 | srmcons_get_private_struct(struct srmcons_private **ps) | ||
160 | { | ||
161 | static struct srmcons_private *srmconsp = NULL; | ||
162 | static DEFINE_SPINLOCK(srmconsp_lock); | ||
163 | unsigned long flags; | ||
164 | int retval = 0; | ||
165 | |||
166 | if (srmconsp == NULL) { | ||
167 | srmconsp = kmalloc(sizeof(*srmconsp), GFP_KERNEL); | ||
168 | spin_lock_irqsave(&srmconsp_lock, flags); | ||
169 | |||
170 | if (srmconsp == NULL) | ||
171 | retval = -ENOMEM; | ||
172 | else { | ||
173 | srmconsp->tty = NULL; | ||
174 | spin_lock_init(&srmconsp->lock); | ||
175 | init_timer(&srmconsp->timer); | ||
176 | } | ||
177 | |||
178 | spin_unlock_irqrestore(&srmconsp_lock, flags); | ||
179 | } | ||
180 | |||
181 | *ps = srmconsp; | ||
182 | return retval; | ||
183 | } | ||
184 | |||
185 | static int | ||
186 | srmcons_open(struct tty_struct *tty, struct file *filp) | 157 | srmcons_open(struct tty_struct *tty, struct file *filp) |
187 | { | 158 | { |
188 | struct srmcons_private *srmconsp; | 159 | struct srmcons_private *srmconsp = &srmcons_singleton; |
160 | struct tty_port *port = &srmconsp->port; | ||
189 | unsigned long flags; | 161 | unsigned long flags; |
190 | int retval; | ||
191 | |||
192 | retval = srmcons_get_private_struct(&srmconsp); | ||
193 | if (retval) | ||
194 | return retval; | ||
195 | 162 | ||
196 | spin_lock_irqsave(&srmconsp->lock, flags); | 163 | spin_lock_irqsave(&port->lock, flags); |
197 | 164 | ||
198 | if (!srmconsp->tty) { | 165 | if (!port->tty) { |
199 | tty->driver_data = srmconsp; | 166 | tty->driver_data = srmconsp; |
200 | 167 | tty->port = port; | |
201 | srmconsp->tty = tty; | 168 | port->tty = tty; /* XXX proper refcounting */ |
202 | srmconsp->timer.function = srmcons_receive_chars; | 169 | mod_timer(&srmconsp->timer, jiffies + 10); |
203 | srmconsp->timer.data = (unsigned long)srmconsp; | ||
204 | srmconsp->timer.expires = jiffies + 10; | ||
205 | add_timer(&srmconsp->timer); | ||
206 | } | 170 | } |
207 | 171 | ||
208 | spin_unlock_irqrestore(&srmconsp->lock, flags); | 172 | spin_unlock_irqrestore(&port->lock, flags); |
209 | 173 | ||
210 | return 0; | 174 | return 0; |
211 | } | 175 | } |
@@ -214,16 +178,17 @@ static void | |||
214 | srmcons_close(struct tty_struct *tty, struct file *filp) | 178 | srmcons_close(struct tty_struct *tty, struct file *filp) |
215 | { | 179 | { |
216 | struct srmcons_private *srmconsp = tty->driver_data; | 180 | struct srmcons_private *srmconsp = tty->driver_data; |
181 | struct tty_port *port = &srmconsp->port; | ||
217 | unsigned long flags; | 182 | unsigned long flags; |
218 | 183 | ||
219 | spin_lock_irqsave(&srmconsp->lock, flags); | 184 | spin_lock_irqsave(&port->lock, flags); |
220 | 185 | ||
221 | if (tty->count == 1) { | 186 | if (tty->count == 1) { |
222 | srmconsp->tty = NULL; | 187 | port->tty = NULL; |
223 | del_timer(&srmconsp->timer); | 188 | del_timer(&srmconsp->timer); |
224 | } | 189 | } |
225 | 190 | ||
226 | spin_unlock_irqrestore(&srmconsp->lock, flags); | 191 | spin_unlock_irqrestore(&port->lock, flags); |
227 | } | 192 | } |
228 | 193 | ||
229 | 194 | ||
@@ -240,6 +205,9 @@ static const struct tty_operations srmcons_ops = { | |||
240 | static int __init | 205 | static int __init |
241 | srmcons_init(void) | 206 | srmcons_init(void) |
242 | { | 207 | { |
208 | tty_port_init(&srmcons_singleton.port); | ||
209 | setup_timer(&srmcons_singleton.timer, srmcons_receive_chars, | ||
210 | (unsigned long)&srmcons_singleton); | ||
243 | if (srm_is_registered_console) { | 211 | if (srm_is_registered_console) { |
244 | struct tty_driver *driver; | 212 | struct tty_driver *driver; |
245 | int err; | 213 | int err; |