diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-12 15:24:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-12 15:24:29 -0400 |
commit | 6917b51dee54f21816706af2278517b7af218f9a (patch) | |
tree | a7f94bae96cbf4382a6639668262c4c76dcfc6e1 | |
parent | 10fbd36e362a0f367e34a7cd876a81295d8fc5ca (diff) | |
parent | 254a0f4135482dc02701562a38e10675a48c8ddf (diff) |
Merge tag 'cris-for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/jesper/cris
Pull CRIS updates from Jesper Nilsson:
"Mostly removal of old cruft of which we can use a generic version, or
fixes for code not commonly run in the cris port, but also additions
to enable some good debug"
* tag 'cris-for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/jesper/cris: (25 commits)
CRISv10: delete unused lib/dmacopy.c
CRISv10: delete unused lib/old_checksum.c
CRIS: fix switch_mm() lockdep splat
CRISv32: enable LOCKDEP_SUPPORT
CRIS: add STACKTRACE_SUPPORT
CRISv32: annotate irq enable in idle loop
CRISv32: add support for irqflags tracing
CRIS: UAPI: use generic types.h
CRIS: UAPI: use generic shmbuf.h
CRIS: UAPI: use generic msgbuf.h
CRIS: UAPI: use generic socket.h
CRIS: UAPI: use generic sembuf.h
CRIS: UAPI: use generic sockios.h
CRIS: UAPI: use generic auxvec.h
CRIS: UAPI: use generic headers via Kbuild
CRIS: UAPI: fix elf.h export
CRIS: don't make asm/elf.h depend on asm/user.h
CRIS: UAPI: fix ptrace.h
CRISv32: Squash compile warnings for axisflashmap
CRISv32: Add GPIO driver to the default configs
...
50 files changed, 220 insertions, 421 deletions
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 0314e325a669..8da5653bd895 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig | |||
@@ -36,6 +36,17 @@ config FORCE_MAX_ZONEORDER | |||
36 | int | 36 | int |
37 | default 6 | 37 | default 6 |
38 | 38 | ||
39 | config TRACE_IRQFLAGS_SUPPORT | ||
40 | depends on ETRAX_ARCH_V32 | ||
41 | def_bool y | ||
42 | |||
43 | config STACKTRACE_SUPPORT | ||
44 | def_bool y | ||
45 | |||
46 | config LOCKDEP_SUPPORT | ||
47 | depends on ETRAX_ARCH_V32 | ||
48 | def_bool y | ||
49 | |||
39 | config CRIS | 50 | config CRIS |
40 | bool | 51 | bool |
41 | default y | 52 | default y |
@@ -58,6 +69,7 @@ config CRIS | |||
58 | select CLKSRC_MMIO if ETRAX_ARCH_V32 | 69 | select CLKSRC_MMIO if ETRAX_ARCH_V32 |
59 | select GENERIC_CLOCKEVENTS if ETRAX_ARCH_V32 | 70 | select GENERIC_CLOCKEVENTS if ETRAX_ARCH_V32 |
60 | select GENERIC_SCHED_CLOCK if ETRAX_ARCH_V32 | 71 | select GENERIC_SCHED_CLOCK if ETRAX_ARCH_V32 |
72 | select HAVE_DEBUG_BUGVERBOSE if ETRAX_ARCH_V32 | ||
61 | 73 | ||
62 | config HZ | 74 | config HZ |
63 | int | 75 | int |
diff --git a/arch/cris/arch-v10/kernel/entry.S b/arch/cris/arch-v10/kernel/entry.S index 81570fcd0412..b5622521dad5 100644 --- a/arch/cris/arch-v10/kernel/entry.S +++ b/arch/cris/arch-v10/kernel/entry.S | |||
@@ -955,6 +955,14 @@ sys_call_table: | |||
955 | .long sys_process_vm_writev | 955 | .long sys_process_vm_writev |
956 | .long sys_kcmp /* 350 */ | 956 | .long sys_kcmp /* 350 */ |
957 | .long sys_finit_module | 957 | .long sys_finit_module |
958 | .long sys_sched_setattr | ||
959 | .long sys_sched_getattr | ||
960 | .long sys_renameat2 | ||
961 | .long sys_seccomp /* 355 */ | ||
962 | .long sys_getrandom | ||
963 | .long sys_memfd_create | ||
964 | .long sys_bpf | ||
965 | .long sys_execveat | ||
958 | 966 | ||
959 | /* | 967 | /* |
960 | * NOTE!! This doesn't have to be exact - we just have | 968 | * NOTE!! This doesn't have to be exact - we just have |
diff --git a/arch/cris/arch-v10/lib/dmacopy.c b/arch/cris/arch-v10/lib/dmacopy.c deleted file mode 100644 index 49f5b8ca5b47..000000000000 --- a/arch/cris/arch-v10/lib/dmacopy.c +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | /* | ||
2 | * memcpy for large blocks, using memory-memory DMA channels 6 and 7 in Etrax | ||
3 | */ | ||
4 | |||
5 | #include <asm/svinto.h> | ||
6 | #include <asm/io.h> | ||
7 | |||
8 | #define D(x) | ||
9 | |||
10 | void *dma_memcpy(void *pdst, | ||
11 | const void *psrc, | ||
12 | unsigned int pn) | ||
13 | { | ||
14 | static etrax_dma_descr indma, outdma; | ||
15 | |||
16 | D(printk(KERN_DEBUG "dma_memcpy %d bytes... ", pn)); | ||
17 | |||
18 | #if 0 | ||
19 | *R_GEN_CONFIG = genconfig_shadow = | ||
20 | (genconfig_shadow & ~0x3c0000) | | ||
21 | IO_STATE(R_GEN_CONFIG, dma6, intdma7) | | ||
22 | IO_STATE(R_GEN_CONFIG, dma7, intdma6); | ||
23 | #endif | ||
24 | indma.sw_len = outdma.sw_len = pn; | ||
25 | indma.ctrl = d_eol | d_eop; | ||
26 | outdma.ctrl = d_eol; | ||
27 | indma.buf = psrc; | ||
28 | outdma.buf = pdst; | ||
29 | |||
30 | *R_DMA_CH6_FIRST = &indma; | ||
31 | *R_DMA_CH7_FIRST = &outdma; | ||
32 | *R_DMA_CH6_CMD = IO_STATE(R_DMA_CH6_CMD, cmd, start); | ||
33 | *R_DMA_CH7_CMD = IO_STATE(R_DMA_CH7_CMD, cmd, start); | ||
34 | |||
35 | while (*R_DMA_CH7_CMD == 1) | ||
36 | /* wait for completion */; | ||
37 | |||
38 | D(printk(KERN_DEBUG "done\n")); | ||
39 | } | ||
40 | |||
41 | |||
42 | |||
diff --git a/arch/cris/arch-v10/lib/old_checksum.c b/arch/cris/arch-v10/lib/old_checksum.c deleted file mode 100644 index 8f79163f1394..000000000000 --- a/arch/cris/arch-v10/lib/old_checksum.c +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | /* | ||
2 | * INET An implementation of the TCP/IP protocol suite for the LINUX | ||
3 | * operating system. INET is implemented using the BSD Socket | ||
4 | * interface as the means of communication with the user level. | ||
5 | * | ||
6 | * IP/TCP/UDP checksumming routines | ||
7 | * | ||
8 | * Authors: Jorge Cwik, <jorge@laser.satlink.net> | ||
9 | * Arnt Gulbrandsen, <agulbra@nvg.unit.no> | ||
10 | * Tom May, <ftom@netcom.com> | ||
11 | * Lots of code moved from tcp.c and ip.c; see those files | ||
12 | * for more names. | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or | ||
15 | * modify it under the terms of the GNU General Public License | ||
16 | * as published by the Free Software Foundation; either version | ||
17 | * 2 of the License, or (at your option) any later version. | ||
18 | */ | ||
19 | |||
20 | #include <net/checksum.h> | ||
21 | #include <net/module.h> | ||
22 | |||
23 | #undef PROFILE_CHECKSUM | ||
24 | |||
25 | #ifdef PROFILE_CHECKSUM | ||
26 | /* these are just for profiling the checksum code with an oscillioscope.. uh */ | ||
27 | #if 0 | ||
28 | #define BITOFF *((unsigned char *)0xb0000030) = 0xff | ||
29 | #define BITON *((unsigned char *)0xb0000030) = 0x0 | ||
30 | #endif | ||
31 | #include <asm/io.h> | ||
32 | #define CBITON LED_ACTIVE_SET(1) | ||
33 | #define CBITOFF LED_ACTIVE_SET(0) | ||
34 | #define BITOFF | ||
35 | #define BITON | ||
36 | #else | ||
37 | #define BITOFF | ||
38 | #define BITON | ||
39 | #define CBITOFF | ||
40 | #define CBITON | ||
41 | #endif | ||
42 | |||
43 | /* | ||
44 | * computes a partial checksum, e.g. for TCP/UDP fragments | ||
45 | */ | ||
46 | |||
47 | #include <asm/delay.h> | ||
48 | |||
49 | __wsum csum_partial(const void *p, int len, __wsum __sum) | ||
50 | { | ||
51 | u32 sum = (__force u32)__sum; | ||
52 | const u16 *buff = p; | ||
53 | /* | ||
54 | * Experiments with ethernet and slip connections show that buff | ||
55 | * is aligned on either a 2-byte or 4-byte boundary. | ||
56 | */ | ||
57 | const void *endMarker = p + len; | ||
58 | const void *marker = endMarker - (len % 16); | ||
59 | #if 0 | ||
60 | if((int)buff & 0x3) | ||
61 | printk("unaligned buff %p\n", buff); | ||
62 | __delay(900); /* extra delay of 90 us to test performance hit */ | ||
63 | #endif | ||
64 | BITON; | ||
65 | while (buff < marker) { | ||
66 | sum += *buff++; | ||
67 | sum += *buff++; | ||
68 | sum += *buff++; | ||
69 | sum += *buff++; | ||
70 | sum += *buff++; | ||
71 | sum += *buff++; | ||
72 | sum += *buff++; | ||
73 | sum += *buff++; | ||
74 | } | ||
75 | marker = endMarker - (len % 2); | ||
76 | while (buff < marker) | ||
77 | sum += *buff++; | ||
78 | |||
79 | if (endMarker > buff) | ||
80 | sum += *(const u8 *)buff; /* add extra byte separately */ | ||
81 | |||
82 | BITOFF; | ||
83 | return (__force __wsum)sum; | ||
84 | } | ||
85 | |||
86 | EXPORT_SYMBOL(csum_partial); | ||
diff --git a/arch/cris/arch-v32/drivers/Kconfig b/arch/cris/arch-v32/drivers/Kconfig index 4fc16b44fff2..e6c523cc40bc 100644 --- a/arch/cris/arch-v32/drivers/Kconfig +++ b/arch/cris/arch-v32/drivers/Kconfig | |||
@@ -202,7 +202,7 @@ config ETRAX_PA_CHANGEABLE_DIR | |||
202 | default "0x00" if ETRAXFS | 202 | default "0x00" if ETRAXFS |
203 | default "0x00000000" if !ETRAXFS | 203 | default "0x00000000" if !ETRAXFS |
204 | help | 204 | help |
205 | This is a bitmask (8 bits) with information of what bits in PA that a | 205 | This is a bitmask with information of what bits in PA that a |
206 | user can change direction on using ioctl's. | 206 | user can change direction on using ioctl's. |
207 | Bit set = changeable. | 207 | Bit set = changeable. |
208 | You probably want 0 here, but it depends on your hardware. | 208 | You probably want 0 here, but it depends on your hardware. |
@@ -213,7 +213,7 @@ config ETRAX_PA_CHANGEABLE_BITS | |||
213 | default "0x00" if ETRAXFS | 213 | default "0x00" if ETRAXFS |
214 | default "0x00000000" if !ETRAXFS | 214 | default "0x00000000" if !ETRAXFS |
215 | help | 215 | help |
216 | This is a bitmask (8 bits) with information of what bits in PA | 216 | This is a bitmask with information of what bits in PA |
217 | that a user can change the value on using ioctl's. | 217 | that a user can change the value on using ioctl's. |
218 | Bit set = changeable. | 218 | Bit set = changeable. |
219 | 219 | ||
@@ -223,7 +223,7 @@ config ETRAX_PB_CHANGEABLE_DIR | |||
223 | default "0x00000" if ETRAXFS | 223 | default "0x00000" if ETRAXFS |
224 | default "0x00000000" if !ETRAXFS | 224 | default "0x00000000" if !ETRAXFS |
225 | help | 225 | help |
226 | This is a bitmask (18 bits) with information of what bits in PB | 226 | This is a bitmask with information of what bits in PB |
227 | that a user can change direction on using ioctl's. | 227 | that a user can change direction on using ioctl's. |
228 | Bit set = changeable. | 228 | Bit set = changeable. |
229 | You probably want 0 here, but it depends on your hardware. | 229 | You probably want 0 here, but it depends on your hardware. |
@@ -234,7 +234,7 @@ config ETRAX_PB_CHANGEABLE_BITS | |||
234 | default "0x00000" if ETRAXFS | 234 | default "0x00000" if ETRAXFS |
235 | default "0x00000000" if !ETRAXFS | 235 | default "0x00000000" if !ETRAXFS |
236 | help | 236 | help |
237 | This is a bitmask (18 bits) with information of what bits in PB | 237 | This is a bitmask with information of what bits in PB |
238 | that a user can change the value on using ioctl's. | 238 | that a user can change the value on using ioctl's. |
239 | Bit set = changeable. | 239 | Bit set = changeable. |
240 | 240 | ||
@@ -244,7 +244,7 @@ config ETRAX_PC_CHANGEABLE_DIR | |||
244 | default "0x00000" if ETRAXFS | 244 | default "0x00000" if ETRAXFS |
245 | default "0x00000000" if !ETRAXFS | 245 | default "0x00000000" if !ETRAXFS |
246 | help | 246 | help |
247 | This is a bitmask (18 bits) with information of what bits in PC | 247 | This is a bitmask with information of what bits in PC |
248 | that a user can change direction on using ioctl's. | 248 | that a user can change direction on using ioctl's. |
249 | Bit set = changeable. | 249 | Bit set = changeable. |
250 | You probably want 0 here, but it depends on your hardware. | 250 | You probably want 0 here, but it depends on your hardware. |
@@ -253,9 +253,9 @@ config ETRAX_PC_CHANGEABLE_BITS | |||
253 | hex "PC user changeable bits mask" | 253 | hex "PC user changeable bits mask" |
254 | depends on ETRAX_GPIO | 254 | depends on ETRAX_GPIO |
255 | default "0x00000" if ETRAXFS | 255 | default "0x00000" if ETRAXFS |
256 | default "0x00000000" if ETRAXFS | 256 | default "0x00000000" if !ETRAXFS |
257 | help | 257 | help |
258 | This is a bitmask (18 bits) with information of what bits in PC | 258 | This is a bitmask with information of what bits in PC |
259 | that a user can change the value on using ioctl's. | 259 | that a user can change the value on using ioctl's. |
260 | Bit set = changeable. | 260 | Bit set = changeable. |
261 | 261 | ||
@@ -264,7 +264,7 @@ config ETRAX_PD_CHANGEABLE_DIR | |||
264 | depends on ETRAX_GPIO && ETRAXFS | 264 | depends on ETRAX_GPIO && ETRAXFS |
265 | default "0x00000" | 265 | default "0x00000" |
266 | help | 266 | help |
267 | This is a bitmask (18 bits) with information of what bits in PD | 267 | This is a bitmask with information of what bits in PD |
268 | that a user can change direction on using ioctl's. | 268 | that a user can change direction on using ioctl's. |
269 | Bit set = changeable. | 269 | Bit set = changeable. |
270 | You probably want 0x00000 here, but it depends on your hardware. | 270 | You probably want 0x00000 here, but it depends on your hardware. |
diff --git a/arch/cris/arch-v32/drivers/axisflashmap.c b/arch/cris/arch-v32/drivers/axisflashmap.c index 28dd77144e8f..5387424683cc 100644 --- a/arch/cris/arch-v32/drivers/axisflashmap.c +++ b/arch/cris/arch-v32/drivers/axisflashmap.c | |||
@@ -313,6 +313,7 @@ static int __init init_axis_flash(void) | |||
313 | size_t len; | 313 | size_t len; |
314 | int ram_rootfs_partition = -1; /* -1 => no RAM rootfs partition */ | 314 | int ram_rootfs_partition = -1; /* -1 => no RAM rootfs partition */ |
315 | int part; | 315 | int part; |
316 | struct mtd_partition *partition; | ||
316 | 317 | ||
317 | /* We need a root fs. If it resides in RAM, we need to use an | 318 | /* We need a root fs. If it resides in RAM, we need to use an |
318 | * MTDRAM device, so it must be enabled in the kernel config, | 319 | * MTDRAM device, so it must be enabled in the kernel config, |
@@ -329,7 +330,7 @@ static int __init init_axis_flash(void) | |||
329 | 330 | ||
330 | main_mtd = flash_probe(); | 331 | main_mtd = flash_probe(); |
331 | if (main_mtd) | 332 | if (main_mtd) |
332 | printk(KERN_INFO "%s: 0x%08x bytes of NOR flash memory.\n", | 333 | printk(KERN_INFO "%s: 0x%08llx bytes of NOR flash memory.\n", |
333 | main_mtd->name, main_mtd->size); | 334 | main_mtd->name, main_mtd->size); |
334 | 335 | ||
335 | #ifdef CONFIG_ETRAX_NANDFLASH | 336 | #ifdef CONFIG_ETRAX_NANDFLASH |
@@ -388,10 +389,10 @@ static int __init init_axis_flash(void) | |||
388 | #endif | 389 | #endif |
389 | 390 | ||
390 | if (main_mtd) { | 391 | if (main_mtd) { |
392 | loff_t ptable_sector = CONFIG_ETRAX_PTABLE_SECTOR; | ||
391 | main_mtd->owner = THIS_MODULE; | 393 | main_mtd->owner = THIS_MODULE; |
392 | axisflash_mtd = main_mtd; | 394 | axisflash_mtd = main_mtd; |
393 | 395 | ||
394 | loff_t ptable_sector = CONFIG_ETRAX_PTABLE_SECTOR; | ||
395 | 396 | ||
396 | /* First partition (rescue) is always set to the default. */ | 397 | /* First partition (rescue) is always set to the default. */ |
397 | pidx++; | 398 | pidx++; |
@@ -517,7 +518,7 @@ static int __init init_axis_flash(void) | |||
517 | /* Decide whether to use default partition table. */ | 518 | /* Decide whether to use default partition table. */ |
518 | /* Only use default table if we actually have a device (main_mtd) */ | 519 | /* Only use default table if we actually have a device (main_mtd) */ |
519 | 520 | ||
520 | struct mtd_partition *partition = &axis_partitions[0]; | 521 | partition = &axis_partitions[0]; |
521 | if (main_mtd && !ptable_ok) { | 522 | if (main_mtd && !ptable_ok) { |
522 | memcpy(axis_partitions, axis_default_partitions, | 523 | memcpy(axis_partitions, axis_default_partitions, |
523 | sizeof(axis_default_partitions)); | 524 | sizeof(axis_default_partitions)); |
@@ -580,7 +581,7 @@ static int __init init_axis_flash(void) | |||
580 | printk(KERN_INFO "axisflashmap: Adding RAM partition " | 581 | printk(KERN_INFO "axisflashmap: Adding RAM partition " |
581 | "for rootfs image.\n"); | 582 | "for rootfs image.\n"); |
582 | err = mtdram_init_device(mtd_ram, | 583 | err = mtdram_init_device(mtd_ram, |
583 | (void *)partition[part].offset, | 584 | (void *)(u_int32_t)partition[part].offset, |
584 | partition[part].size, | 585 | partition[part].size, |
585 | partition[part].name); | 586 | partition[part].name); |
586 | if (err) | 587 | if (err) |
diff --git a/arch/cris/arch-v32/drivers/mach-a3/gpio.c b/arch/cris/arch-v32/drivers/mach-a3/gpio.c index 74f9fe80940c..c92e1da3684d 100644 --- a/arch/cris/arch-v32/drivers/mach-a3/gpio.c +++ b/arch/cris/arch-v32/drivers/mach-a3/gpio.c | |||
@@ -957,7 +957,7 @@ static void __init virtual_gpio_init(void) | |||
957 | 957 | ||
958 | static int __init gpio_init(void) | 958 | static int __init gpio_init(void) |
959 | { | 959 | { |
960 | int res; | 960 | int res, res2; |
961 | 961 | ||
962 | printk(KERN_INFO "ETRAX FS GPIO driver v2.7, (c) 2003-2008 " | 962 | printk(KERN_INFO "ETRAX FS GPIO driver v2.7, (c) 2003-2008 " |
963 | "Axis Communications AB\n"); | 963 | "Axis Communications AB\n"); |
@@ -977,7 +977,7 @@ static int __init gpio_init(void) | |||
977 | CRIS_LED_DISK_READ(0); | 977 | CRIS_LED_DISK_READ(0); |
978 | CRIS_LED_DISK_WRITE(0); | 978 | CRIS_LED_DISK_WRITE(0); |
979 | 979 | ||
980 | int res2 = request_irq(GIO_INTR_VECT, gpio_interrupt, | 980 | res2 = request_irq(GIO_INTR_VECT, gpio_interrupt, |
981 | IRQF_SHARED, "gpio", &alarmlist); | 981 | IRQF_SHARED, "gpio", &alarmlist); |
982 | if (res2) { | 982 | if (res2) { |
983 | printk(KERN_ERR "err: irq for gpio\n"); | 983 | printk(KERN_ERR "err: irq for gpio\n"); |
diff --git a/arch/cris/arch-v32/drivers/mach-fs/gpio.c b/arch/cris/arch-v32/drivers/mach-fs/gpio.c index 009f4ee1bd09..72968fbf814b 100644 --- a/arch/cris/arch-v32/drivers/mach-fs/gpio.c +++ b/arch/cris/arch-v32/drivers/mach-fs/gpio.c | |||
@@ -425,12 +425,11 @@ gpio_open(struct inode *inode, struct file *filp) | |||
425 | if (p > GPIO_MINOR_LAST) | 425 | if (p > GPIO_MINOR_LAST) |
426 | return -EINVAL; | 426 | return -EINVAL; |
427 | 427 | ||
428 | priv = kmalloc(sizeof(struct gpio_private), GFP_KERNEL); | 428 | priv = kzalloc(sizeof(struct gpio_private), GFP_KERNEL); |
429 | if (!priv) | 429 | if (!priv) |
430 | return -ENOMEM; | 430 | return -ENOMEM; |
431 | 431 | ||
432 | mutex_lock(&gpio_mutex); | 432 | mutex_lock(&gpio_mutex); |
433 | memset(priv, 0, sizeof(*priv)); | ||
434 | 433 | ||
435 | priv->minor = p; | 434 | priv->minor = p; |
436 | 435 | ||
diff --git a/arch/cris/arch-v32/kernel/entry.S b/arch/cris/arch-v32/kernel/entry.S index 026a0b21b8f0..b17a20999f87 100644 --- a/arch/cris/arch-v32/kernel/entry.S +++ b/arch/cris/arch-v32/kernel/entry.S | |||
@@ -240,6 +240,17 @@ ret_from_sys_call: | |||
240 | 240 | ||
241 | .type _Rexit,@function | 241 | .type _Rexit,@function |
242 | _Rexit: | 242 | _Rexit: |
243 | #if defined(CONFIG_TRACE_IRQFLAGS) | ||
244 | addoq +PT_ccs, $sp, $acr | ||
245 | move.d [$acr], $r0 | ||
246 | btstq 15, $r0 ; I1 | ||
247 | bpl 1f | ||
248 | nop | ||
249 | jsr trace_hardirqs_on | ||
250 | nop | ||
251 | 1: | ||
252 | #endif | ||
253 | |||
243 | ;; This epilogue MUST match the prologues in multiple_interrupt, irq.h | 254 | ;; This epilogue MUST match the prologues in multiple_interrupt, irq.h |
244 | ;; and ptregs.h. | 255 | ;; and ptregs.h. |
245 | addq 4, $sp ; Skip orig_r10. | 256 | addq 4, $sp ; Skip orig_r10. |
@@ -875,6 +886,14 @@ sys_call_table: | |||
875 | .long sys_process_vm_writev | 886 | .long sys_process_vm_writev |
876 | .long sys_kcmp /* 350 */ | 887 | .long sys_kcmp /* 350 */ |
877 | .long sys_finit_module | 888 | .long sys_finit_module |
889 | .long sys_sched_setattr | ||
890 | .long sys_sched_getattr | ||
891 | .long sys_renameat2 | ||
892 | .long sys_seccomp /* 355 */ | ||
893 | .long sys_getrandom | ||
894 | .long sys_memfd_create | ||
895 | .long sys_bpf | ||
896 | .long sys_execveat | ||
878 | 897 | ||
879 | /* | 898 | /* |
880 | * NOTE!! This doesn't have to be exact - we just have | 899 | * NOTE!! This doesn't have to be exact - we just have |
diff --git a/arch/cris/arch-v32/kernel/process.c b/arch/cris/arch-v32/kernel/process.c index cebd32e2a8fb..c7ce784a393c 100644 --- a/arch/cris/arch-v32/kernel/process.c +++ b/arch/cris/arch-v32/kernel/process.c | |||
@@ -23,9 +23,9 @@ extern void stop_watchdog(void); | |||
23 | /* We use this if we don't have any better idle routine. */ | 23 | /* We use this if we don't have any better idle routine. */ |
24 | void default_idle(void) | 24 | void default_idle(void) |
25 | { | 25 | { |
26 | local_irq_enable(); | ||
26 | /* Halt until exception. */ | 27 | /* Halt until exception. */ |
27 | __asm__ volatile("ei \n\t" | 28 | __asm__ volatile("halt"); |
28 | "halt "); | ||
29 | } | 29 | } |
30 | 30 | ||
31 | /* | 31 | /* |
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c index 3a36ae6b79d5..150d1d76c29d 100644 --- a/arch/cris/arch-v32/kernel/signal.c +++ b/arch/cris/arch-v32/kernel/signal.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <asm/processor.h> | 19 | #include <asm/processor.h> |
20 | #include <asm/ucontext.h> | 20 | #include <asm/ucontext.h> |
21 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
22 | #include <arch/ptrace.h> | ||
23 | #include <arch/hwregs/cpu_vect.h> | 22 | #include <arch/hwregs/cpu_vect.h> |
24 | 23 | ||
25 | extern unsigned long cris_signal_return_page; | 24 | extern unsigned long cris_signal_return_page; |
diff --git a/arch/cris/arch-v32/mach-fs/pinmux.c b/arch/cris/arch-v32/mach-fs/pinmux.c index 05a04708b8eb..d8a3a3c439dd 100644 --- a/arch/cris/arch-v32/mach-fs/pinmux.c +++ b/arch/cris/arch-v32/mach-fs/pinmux.c | |||
@@ -46,6 +46,8 @@ static int __crisv32_pinmux_alloc(int port, int first_pin, int last_pin, | |||
46 | pins[port][i] = mode; | 46 | pins[port][i] = mode; |
47 | 47 | ||
48 | crisv32_pinmux_set(port); | 48 | crisv32_pinmux_set(port); |
49 | |||
50 | return 0; | ||
49 | } | 51 | } |
50 | 52 | ||
51 | static int crisv32_pinmux_init(void) | 53 | static int crisv32_pinmux_init(void) |
@@ -93,6 +95,7 @@ int crisv32_pinmux_alloc_fixed(enum fixed_function function) | |||
93 | int ret = -EINVAL; | 95 | int ret = -EINVAL; |
94 | char saved[sizeof pins]; | 96 | char saved[sizeof pins]; |
95 | unsigned long flags; | 97 | unsigned long flags; |
98 | reg_pinmux_rw_hwprot hwprot; | ||
96 | 99 | ||
97 | spin_lock_irqsave(&pinmux_lock, flags); | 100 | spin_lock_irqsave(&pinmux_lock, flags); |
98 | 101 | ||
@@ -101,7 +104,7 @@ int crisv32_pinmux_alloc_fixed(enum fixed_function function) | |||
101 | 104 | ||
102 | crisv32_pinmux_init(); /* Must be done before we read rw_hwprot */ | 105 | crisv32_pinmux_init(); /* Must be done before we read rw_hwprot */ |
103 | 106 | ||
104 | reg_pinmux_rw_hwprot hwprot = REG_RD(pinmux, regi_pinmux, rw_hwprot); | 107 | hwprot = REG_RD(pinmux, regi_pinmux, rw_hwprot); |
105 | 108 | ||
106 | switch (function) { | 109 | switch (function) { |
107 | case pinmux_ser1: | 110 | case pinmux_ser1: |
@@ -227,6 +230,7 @@ int crisv32_pinmux_dealloc_fixed(enum fixed_function function) | |||
227 | int ret = -EINVAL; | 230 | int ret = -EINVAL; |
228 | char saved[sizeof pins]; | 231 | char saved[sizeof pins]; |
229 | unsigned long flags; | 232 | unsigned long flags; |
233 | reg_pinmux_rw_hwprot hwprot; | ||
230 | 234 | ||
231 | spin_lock_irqsave(&pinmux_lock, flags); | 235 | spin_lock_irqsave(&pinmux_lock, flags); |
232 | 236 | ||
@@ -235,7 +239,7 @@ int crisv32_pinmux_dealloc_fixed(enum fixed_function function) | |||
235 | 239 | ||
236 | crisv32_pinmux_init(); /* Must be done before we read rw_hwprot */ | 240 | crisv32_pinmux_init(); /* Must be done before we read rw_hwprot */ |
237 | 241 | ||
238 | reg_pinmux_rw_hwprot hwprot = REG_RD(pinmux, regi_pinmux, rw_hwprot); | 242 | hwprot = REG_RD(pinmux, regi_pinmux, rw_hwprot); |
239 | 243 | ||
240 | switch (function) { | 244 | switch (function) { |
241 | case pinmux_ser1: | 245 | case pinmux_ser1: |
diff --git a/arch/cris/configs/artpec_3_defconfig b/arch/cris/configs/artpec_3_defconfig index 71854d41c5a0..70e497e0b03e 100644 --- a/arch/cris/configs/artpec_3_defconfig +++ b/arch/cris/configs/artpec_3_defconfig | |||
@@ -12,10 +12,6 @@ CONFIG_ETRAX_FAST_TIMER=y | |||
12 | CONFIG_CRIS_MACH_ARTPEC3=y | 12 | CONFIG_CRIS_MACH_ARTPEC3=y |
13 | CONFIG_ETRAX_DRAM_SIZE=32 | 13 | CONFIG_ETRAX_DRAM_SIZE=32 |
14 | CONFIG_ETRAX_FLASH1_SIZE=4 | 14 | CONFIG_ETRAX_FLASH1_SIZE=4 |
15 | CONFIG_ETRAX_DEF_GIO_PA_OE=1c | ||
16 | CONFIG_ETRAX_DEF_GIO_PA_OUT=00 | ||
17 | CONFIG_ETRAX_DEF_GIO_PB_OE=00000 | ||
18 | CONFIG_ETRAX_DEF_GIO_PB_OUT=00000 | ||
19 | CONFIG_NET=y | 15 | CONFIG_NET=y |
20 | CONFIG_PACKET=y | 16 | CONFIG_PACKET=y |
21 | CONFIG_UNIX=y | 17 | CONFIG_UNIX=y |
@@ -42,3 +38,4 @@ CONFIG_JFFS2_FS=y | |||
42 | CONFIG_CRAMFS=y | 38 | CONFIG_CRAMFS=y |
43 | CONFIG_NFS_FS=y | 39 | CONFIG_NFS_FS=y |
44 | CONFIG_NFS_V3=y | 40 | CONFIG_NFS_V3=y |
41 | CONFIG_ETRAX_GPIO=y | ||
diff --git a/arch/cris/configs/etraxfs_defconfig b/arch/cris/configs/etraxfs_defconfig index 87c7227fecb2..91232680d6c8 100644 --- a/arch/cris/configs/etraxfs_defconfig +++ b/arch/cris/configs/etraxfs_defconfig | |||
@@ -38,3 +38,4 @@ CONFIG_JFFS2_FS=y | |||
38 | CONFIG_CRAMFS=y | 38 | CONFIG_CRAMFS=y |
39 | CONFIG_NFS_FS=y | 39 | CONFIG_NFS_FS=y |
40 | CONFIG_NFS_V3=y | 40 | CONFIG_NFS_V3=y |
41 | CONFIG_ETRAX_GPIO=y | ||
diff --git a/arch/cris/include/arch-v32/arch/bug.h b/arch/cris/include/arch-v32/arch/bug.h index 0f211e135248..fb59faaaae0a 100644 --- a/arch/cris/include/arch-v32/arch/bug.h +++ b/arch/cris/include/arch-v32/arch/bug.h | |||
@@ -10,6 +10,7 @@ | |||
10 | * All other stuff is done out-of-band with exception handlers. | 10 | * All other stuff is done out-of-band with exception handlers. |
11 | */ | 11 | */ |
12 | #define BUG() \ | 12 | #define BUG() \ |
13 | do { \ | ||
13 | __asm__ __volatile__ ("0: break 14\n\t" \ | 14 | __asm__ __volatile__ ("0: break 14\n\t" \ |
14 | ".section .fixup,\"ax\"\n" \ | 15 | ".section .fixup,\"ax\"\n" \ |
15 | "1:\n\t" \ | 16 | "1:\n\t" \ |
@@ -21,9 +22,15 @@ | |||
21 | ".section __ex_table,\"a\"\n\t" \ | 22 | ".section __ex_table,\"a\"\n\t" \ |
22 | ".dword 0b, 1b\n\t" \ | 23 | ".dword 0b, 1b\n\t" \ |
23 | ".previous\n\t" \ | 24 | ".previous\n\t" \ |
24 | : : "ri" (__FILE__), "i" (__LINE__)) | 25 | : : "ri" (__FILE__), "i" (__LINE__)); \ |
26 | unreachable(); \ | ||
27 | } while (0) | ||
25 | #else | 28 | #else |
26 | #define BUG() __asm__ __volatile__ ("break 14\n\t") | 29 | #define BUG() \ |
30 | do { \ | ||
31 | __asm__ __volatile__ ("break 14\n\t"); \ | ||
32 | unreachable(); \ | ||
33 | } while (0) | ||
27 | #endif | 34 | #endif |
28 | 35 | ||
29 | #define HAVE_ARCH_BUG | 36 | #define HAVE_ARCH_BUG |
diff --git a/arch/cris/include/arch-v32/arch/irqflags.h b/arch/cris/include/arch-v32/arch/irqflags.h index 041851f8ec6f..5f6fddf99509 100644 --- a/arch/cris/include/arch-v32/arch/irqflags.h +++ b/arch/cris/include/arch-v32/arch/irqflags.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define __ASM_CRIS_ARCH_IRQFLAGS_H | 2 | #define __ASM_CRIS_ARCH_IRQFLAGS_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <arch/ptrace.h> | 5 | #include <asm/ptrace.h> |
6 | 6 | ||
7 | static inline unsigned long arch_local_save_flags(void) | 7 | static inline unsigned long arch_local_save_flags(void) |
8 | { | 8 | { |
diff --git a/arch/cris/include/asm/Kbuild b/arch/cris/include/asm/Kbuild index ad2244f35bca..b7f68192d15b 100644 --- a/arch/cris/include/asm/Kbuild +++ b/arch/cris/include/asm/Kbuild | |||
@@ -1,14 +1,20 @@ | |||
1 | generic-y += atomic.h | 1 | generic-y += atomic.h |
2 | generic-y += auxvec.h | ||
2 | generic-y += barrier.h | 3 | generic-y += barrier.h |
4 | generic-y += bitsperlong.h | ||
3 | generic-y += clkdev.h | 5 | generic-y += clkdev.h |
4 | generic-y += cmpxchg.h | 6 | generic-y += cmpxchg.h |
5 | generic-y += cputime.h | 7 | generic-y += cputime.h |
6 | generic-y += device.h | 8 | generic-y += device.h |
7 | generic-y += div64.h | 9 | generic-y += div64.h |
10 | generic-y += errno.h | ||
8 | generic-y += exec.h | 11 | generic-y += exec.h |
9 | generic-y += emergency-restart.h | 12 | generic-y += emergency-restart.h |
13 | generic-y += fcntl.h | ||
10 | generic-y += futex.h | 14 | generic-y += futex.h |
11 | generic-y += hardirq.h | 15 | generic-y += hardirq.h |
16 | generic-y += ioctl.h | ||
17 | generic-y += ipcbuf.h | ||
12 | generic-y += irq_regs.h | 18 | generic-y += irq_regs.h |
13 | generic-y += irq_work.h | 19 | generic-y += irq_work.h |
14 | generic-y += kdebug.h | 20 | generic-y += kdebug.h |
@@ -19,11 +25,22 @@ generic-y += local.h | |||
19 | generic-y += local64.h | 25 | generic-y += local64.h |
20 | generic-y += mcs_spinlock.h | 26 | generic-y += mcs_spinlock.h |
21 | generic-y += mm-arch-hooks.h | 27 | generic-y += mm-arch-hooks.h |
28 | generic-y += mman.h | ||
22 | generic-y += module.h | 29 | generic-y += module.h |
30 | generic-y += msgbuf.h | ||
23 | generic-y += percpu.h | 31 | generic-y += percpu.h |
32 | generic-y += poll.h | ||
24 | generic-y += preempt.h | 33 | generic-y += preempt.h |
34 | generic-y += resource.h | ||
25 | generic-y += sections.h | 35 | generic-y += sections.h |
36 | generic-y += sembuf.h | ||
37 | generic-y += shmbuf.h | ||
38 | generic-y += siginfo.h | ||
39 | generic-y += socket.h | ||
40 | generic-y += sockios.h | ||
41 | generic-y += statfs.h | ||
26 | generic-y += topology.h | 42 | generic-y += topology.h |
27 | generic-y += trace_clock.h | 43 | generic-y += trace_clock.h |
44 | generic-y += types.h | ||
28 | generic-y += vga.h | 45 | generic-y += vga.h |
29 | generic-y += xor.h | 46 | generic-y += xor.h |
diff --git a/arch/cris/include/asm/mmu_context.h b/arch/cris/include/asm/mmu_context.h index 1d45fd6365b7..349acfd25d2f 100644 --- a/arch/cris/include/asm/mmu_context.h +++ b/arch/cris/include/asm/mmu_context.h | |||
@@ -11,7 +11,14 @@ extern void switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
11 | 11 | ||
12 | #define deactivate_mm(tsk,mm) do { } while (0) | 12 | #define deactivate_mm(tsk,mm) do { } while (0) |
13 | 13 | ||
14 | #define activate_mm(prev,next) switch_mm((prev),(next),NULL) | 14 | static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next) |
15 | { | ||
16 | unsigned long flags; | ||
17 | |||
18 | local_irq_save(flags); | ||
19 | switch_mm(prev, next, NULL); | ||
20 | local_irq_restore(flags); | ||
21 | } | ||
15 | 22 | ||
16 | /* current active pgd - this is similar to other processors pgd | 23 | /* current active pgd - this is similar to other processors pgd |
17 | * registers like cr3 on the i386 | 24 | * registers like cr3 on the i386 |
diff --git a/arch/cris/include/asm/stacktrace.h b/arch/cris/include/asm/stacktrace.h new file mode 100644 index 000000000000..2d90856943ad --- /dev/null +++ b/arch/cris/include/asm/stacktrace.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef __CRIS_STACKTRACE_H | ||
2 | #define __CRIS_STACKTRACE_H | ||
3 | |||
4 | void walk_stackframe(unsigned long sp, | ||
5 | int (*fn)(unsigned long addr, void *data), | ||
6 | void *data); | ||
7 | |||
8 | #endif | ||
diff --git a/arch/cris/include/asm/types.h b/arch/cris/include/asm/types.h deleted file mode 100644 index a3cac7757c7f..000000000000 --- a/arch/cris/include/asm/types.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | #ifndef _ETRAX_TYPES_H | ||
2 | #define _ETRAX_TYPES_H | ||
3 | |||
4 | #include <uapi/asm/types.h> | ||
5 | |||
6 | /* | ||
7 | * These aren't exported outside the kernel to avoid name space clashes | ||
8 | */ | ||
9 | |||
10 | #define BITS_PER_LONG 32 | ||
11 | |||
12 | #endif | ||
diff --git a/arch/cris/include/asm/unistd.h b/arch/cris/include/asm/unistd.h index 0f40fed1ba25..9c23535821c0 100644 --- a/arch/cris/include/asm/unistd.h +++ b/arch/cris/include/asm/unistd.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #include <uapi/asm/unistd.h> | 4 | #include <uapi/asm/unistd.h> |
5 | 5 | ||
6 | 6 | ||
7 | #define NR_syscalls 360 | 7 | #define NR_syscalls 365 |
8 | 8 | ||
9 | #include <arch/unistd.h> | 9 | #include <arch/unistd.h> |
10 | 10 | ||
diff --git a/arch/cris/include/uapi/asm/Kbuild b/arch/cris/include/uapi/asm/Kbuild index 01f66b8f15e5..d5564a0ae66a 100644 --- a/arch/cris/include/uapi/asm/Kbuild +++ b/arch/cris/include/uapi/asm/Kbuild | |||
@@ -6,6 +6,9 @@ header-y += ../arch-v32/arch/ | |||
6 | header-y += auxvec.h | 6 | header-y += auxvec.h |
7 | header-y += bitsperlong.h | 7 | header-y += bitsperlong.h |
8 | header-y += byteorder.h | 8 | header-y += byteorder.h |
9 | header-y += elf.h | ||
10 | header-y += elf_v10.h | ||
11 | header-y += elf_v32.h | ||
9 | header-y += errno.h | 12 | header-y += errno.h |
10 | header-y += ethernet.h | 13 | header-y += ethernet.h |
11 | header-y += etraxgpio.h | 14 | header-y += etraxgpio.h |
@@ -19,6 +22,8 @@ header-y += param.h | |||
19 | header-y += poll.h | 22 | header-y += poll.h |
20 | header-y += posix_types.h | 23 | header-y += posix_types.h |
21 | header-y += ptrace.h | 24 | header-y += ptrace.h |
25 | header-y += ptrace_v10.h | ||
26 | header-y += ptrace_v32.h | ||
22 | header-y += resource.h | 27 | header-y += resource.h |
23 | header-y += rs485.h | 28 | header-y += rs485.h |
24 | header-y += sembuf.h | 29 | header-y += sembuf.h |
diff --git a/arch/cris/include/uapi/asm/auxvec.h b/arch/cris/include/uapi/asm/auxvec.h deleted file mode 100644 index cb30b01bf19f..000000000000 --- a/arch/cris/include/uapi/asm/auxvec.h +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | #ifndef __ASMCRIS_AUXVEC_H | ||
2 | #define __ASMCRIS_AUXVEC_H | ||
3 | |||
4 | #endif | ||
diff --git a/arch/cris/include/uapi/asm/bitsperlong.h b/arch/cris/include/uapi/asm/bitsperlong.h deleted file mode 100644 index 6dc0bb0c13b2..000000000000 --- a/arch/cris/include/uapi/asm/bitsperlong.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/bitsperlong.h> | ||
diff --git a/arch/cris/include/asm/elf.h b/arch/cris/include/uapi/asm/elf.h index c2a394ff55ff..a5df05bfee66 100644 --- a/arch/cris/include/asm/elf.h +++ b/arch/cris/include/uapi/asm/elf.h | |||
@@ -5,7 +5,11 @@ | |||
5 | * ELF register definitions.. | 5 | * ELF register definitions.. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include <asm/user.h> | 8 | #ifdef __arch_v32 |
9 | #include <asm/elf_v32.h> | ||
10 | #else | ||
11 | #include <asm/elf_v10.h> | ||
12 | #endif | ||
9 | 13 | ||
10 | #define R_CRIS_NONE 0 | 14 | #define R_CRIS_NONE 0 |
11 | #define R_CRIS_8 1 | 15 | #define R_CRIS_8 1 |
@@ -32,7 +36,6 @@ typedef unsigned long elf_greg_t; | |||
32 | 36 | ||
33 | /* Note that NGREG is defined to ELF_NGREG in include/linux/elfcore.h, and is | 37 | /* Note that NGREG is defined to ELF_NGREG in include/linux/elfcore.h, and is |
34 | thus exposed to user-space. */ | 38 | thus exposed to user-space. */ |
35 | #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) | ||
36 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | 39 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; |
37 | 40 | ||
38 | /* A placeholder; CRIS does not have any fp regs. */ | 41 | /* A placeholder; CRIS does not have any fp regs. */ |
@@ -45,8 +48,6 @@ typedef unsigned long elf_fpregset_t; | |||
45 | #define ELF_DATA ELFDATA2LSB | 48 | #define ELF_DATA ELFDATA2LSB |
46 | #define ELF_ARCH EM_CRIS | 49 | #define ELF_ARCH EM_CRIS |
47 | 50 | ||
48 | #include <arch/elf.h> | ||
49 | |||
50 | /* The master for these definitions is {binutils}/include/elf/cris.h: */ | 51 | /* The master for these definitions is {binutils}/include/elf/cris.h: */ |
51 | /* User symbols in this file have a leading underscore. */ | 52 | /* User symbols in this file have a leading underscore. */ |
52 | #define EF_CRIS_UNDERSCORE 0x00000001 | 53 | #define EF_CRIS_UNDERSCORE 0x00000001 |
diff --git a/arch/cris/include/arch-v10/arch/elf.h b/arch/cris/include/uapi/asm/elf_v10.h index 1eb638aeddb4..3ea65cef529d 100644 --- a/arch/cris/include/arch-v10/arch/elf.h +++ b/arch/cris/include/uapi/asm/elf_v10.h | |||
@@ -1,10 +1,11 @@ | |||
1 | #ifndef __ASMCRIS_ARCH_ELF_H | 1 | #ifndef __ASMCRIS_ARCH_ELF_H |
2 | #define __ASMCRIS_ARCH_ELF_H | 2 | #define __ASMCRIS_ARCH_ELF_H |
3 | 3 | ||
4 | #include <arch/system.h> | ||
5 | |||
6 | #define ELF_MACH EF_CRIS_VARIANT_ANY_V0_V10 | 4 | #define ELF_MACH EF_CRIS_VARIANT_ANY_V0_V10 |
7 | 5 | ||
6 | /* Matches struct user_regs_struct */ | ||
7 | #define ELF_NGREG 35 | ||
8 | |||
8 | /* | 9 | /* |
9 | * This is used to ensure we don't load something for the wrong architecture. | 10 | * This is used to ensure we don't load something for the wrong architecture. |
10 | */ | 11 | */ |
diff --git a/arch/cris/include/arch-v32/arch/elf.h b/arch/cris/include/uapi/asm/elf_v32.h index c46d58291166..f09fe49005c0 100644 --- a/arch/cris/include/arch-v32/arch/elf.h +++ b/arch/cris/include/uapi/asm/elf_v32.h | |||
@@ -1,10 +1,11 @@ | |||
1 | #ifndef _ASM_CRIS_ELF_H | 1 | #ifndef _ASM_CRIS_ELF_H |
2 | #define _ASM_CRIS_ELF_H | 2 | #define _ASM_CRIS_ELF_H |
3 | 3 | ||
4 | #include <arch/system.h> | ||
5 | |||
6 | #define ELF_CORE_EFLAGS EF_CRIS_VARIANT_V32 | 4 | #define ELF_CORE_EFLAGS EF_CRIS_VARIANT_V32 |
7 | 5 | ||
6 | /* Matches struct user_regs_struct */ | ||
7 | #define ELF_NGREG 32 | ||
8 | |||
8 | /* | 9 | /* |
9 | * This is used to ensure we don't load something for the wrong architecture. | 10 | * This is used to ensure we don't load something for the wrong architecture. |
10 | */ | 11 | */ |
diff --git a/arch/cris/include/uapi/asm/errno.h b/arch/cris/include/uapi/asm/errno.h deleted file mode 100644 index 2bf5eb5fa773..000000000000 --- a/arch/cris/include/uapi/asm/errno.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _CRIS_ERRNO_H | ||
2 | #define _CRIS_ERRNO_H | ||
3 | |||
4 | #include <asm-generic/errno.h> | ||
5 | |||
6 | #endif | ||
diff --git a/arch/cris/include/uapi/asm/fcntl.h b/arch/cris/include/uapi/asm/fcntl.h deleted file mode 100644 index 46ab12db5739..000000000000 --- a/arch/cris/include/uapi/asm/fcntl.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/fcntl.h> | ||
diff --git a/arch/cris/include/uapi/asm/ioctl.h b/arch/cris/include/uapi/asm/ioctl.h deleted file mode 100644 index b279fe06dfe5..000000000000 --- a/arch/cris/include/uapi/asm/ioctl.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/ioctl.h> | ||
diff --git a/arch/cris/include/uapi/asm/ipcbuf.h b/arch/cris/include/uapi/asm/ipcbuf.h deleted file mode 100644 index 84c7e51cb6d0..000000000000 --- a/arch/cris/include/uapi/asm/ipcbuf.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/ipcbuf.h> | ||
diff --git a/arch/cris/include/uapi/asm/kvm_para.h b/arch/cris/include/uapi/asm/kvm_para.h deleted file mode 100644 index 14fab8f0b957..000000000000 --- a/arch/cris/include/uapi/asm/kvm_para.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/kvm_para.h> | ||
diff --git a/arch/cris/include/uapi/asm/mman.h b/arch/cris/include/uapi/asm/mman.h deleted file mode 100644 index 8eebf89f5ab1..000000000000 --- a/arch/cris/include/uapi/asm/mman.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/mman.h> | ||
diff --git a/arch/cris/include/uapi/asm/msgbuf.h b/arch/cris/include/uapi/asm/msgbuf.h deleted file mode 100644 index ada63df1d574..000000000000 --- a/arch/cris/include/uapi/asm/msgbuf.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | #ifndef _CRIS_MSGBUF_H | ||
2 | #define _CRIS_MSGBUF_H | ||
3 | |||
4 | /* verbatim copy of asm-i386 version */ | ||
5 | |||
6 | /* | ||
7 | * The msqid64_ds structure for CRIS architecture. | ||
8 | * Note extra padding because this structure is passed back and forth | ||
9 | * between kernel and user space. | ||
10 | * | ||
11 | * Pad space is left for: | ||
12 | * - 64-bit time_t to solve y2038 problem | ||
13 | * - 2 miscellaneous 32-bit values | ||
14 | */ | ||
15 | |||
16 | struct msqid64_ds { | ||
17 | struct ipc64_perm msg_perm; | ||
18 | __kernel_time_t msg_stime; /* last msgsnd time */ | ||
19 | unsigned long __unused1; | ||
20 | __kernel_time_t msg_rtime; /* last msgrcv time */ | ||
21 | unsigned long __unused2; | ||
22 | __kernel_time_t msg_ctime; /* last change time */ | ||
23 | unsigned long __unused3; | ||
24 | unsigned long msg_cbytes; /* current number of bytes on queue */ | ||
25 | unsigned long msg_qnum; /* number of messages in queue */ | ||
26 | unsigned long msg_qbytes; /* max number of bytes on queue */ | ||
27 | __kernel_pid_t msg_lspid; /* pid of last msgsnd */ | ||
28 | __kernel_pid_t msg_lrpid; /* last receive pid */ | ||
29 | unsigned long __unused4; | ||
30 | unsigned long __unused5; | ||
31 | }; | ||
32 | |||
33 | #endif /* _CRIS_MSGBUF_H */ | ||
diff --git a/arch/cris/include/uapi/asm/poll.h b/arch/cris/include/uapi/asm/poll.h deleted file mode 100644 index c98509d3149e..000000000000 --- a/arch/cris/include/uapi/asm/poll.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/poll.h> | ||
diff --git a/arch/cris/include/uapi/asm/ptrace.h b/arch/cris/include/uapi/asm/ptrace.h index c689c9bbbe50..bd8946f83ed3 100644 --- a/arch/cris/include/uapi/asm/ptrace.h +++ b/arch/cris/include/uapi/asm/ptrace.h | |||
@@ -1 +1,5 @@ | |||
1 | #include <arch/ptrace.h> | 1 | #ifdef __arch_v32 |
2 | #include <asm/ptrace_v32.h> | ||
3 | #else | ||
4 | #include <asm/ptrace_v10.h> | ||
5 | #endif | ||
diff --git a/arch/cris/include/arch-v10/arch/ptrace.h b/arch/cris/include/uapi/asm/ptrace_v10.h index 1a232739565e..1a232739565e 100644 --- a/arch/cris/include/arch-v10/arch/ptrace.h +++ b/arch/cris/include/uapi/asm/ptrace_v10.h | |||
diff --git a/arch/cris/include/arch-v32/arch/ptrace.h b/arch/cris/include/uapi/asm/ptrace_v32.h index 19773d3bd4c4..19773d3bd4c4 100644 --- a/arch/cris/include/arch-v32/arch/ptrace.h +++ b/arch/cris/include/uapi/asm/ptrace_v32.h | |||
diff --git a/arch/cris/include/uapi/asm/resource.h b/arch/cris/include/uapi/asm/resource.h deleted file mode 100644 index b5d29448de4e..000000000000 --- a/arch/cris/include/uapi/asm/resource.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _CRIS_RESOURCE_H | ||
2 | #define _CRIS_RESOURCE_H | ||
3 | |||
4 | #include <asm-generic/resource.h> | ||
5 | |||
6 | #endif | ||
diff --git a/arch/cris/include/uapi/asm/sembuf.h b/arch/cris/include/uapi/asm/sembuf.h deleted file mode 100644 index 7fed9843796d..000000000000 --- a/arch/cris/include/uapi/asm/sembuf.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | #ifndef _CRIS_SEMBUF_H | ||
2 | #define _CRIS_SEMBUF_H | ||
3 | |||
4 | /* | ||
5 | * The semid64_ds structure for CRIS architecture. | ||
6 | * Note extra padding because this structure is passed back and forth | ||
7 | * between kernel and user space. | ||
8 | * | ||
9 | * Pad space is left for: | ||
10 | * - 64-bit time_t to solve y2038 problem | ||
11 | * - 2 miscellaneous 32-bit values | ||
12 | */ | ||
13 | |||
14 | struct semid64_ds { | ||
15 | struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ | ||
16 | __kernel_time_t sem_otime; /* last semop time */ | ||
17 | unsigned long __unused1; | ||
18 | __kernel_time_t sem_ctime; /* last change time */ | ||
19 | unsigned long __unused2; | ||
20 | unsigned long sem_nsems; /* no. of semaphores in array */ | ||
21 | unsigned long __unused3; | ||
22 | unsigned long __unused4; | ||
23 | }; | ||
24 | |||
25 | #endif /* _CRIS_SEMBUF_H */ | ||
diff --git a/arch/cris/include/uapi/asm/shmbuf.h b/arch/cris/include/uapi/asm/shmbuf.h deleted file mode 100644 index 3239e3f000e8..000000000000 --- a/arch/cris/include/uapi/asm/shmbuf.h +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | #ifndef _CRIS_SHMBUF_H | ||
2 | #define _CRIS_SHMBUF_H | ||
3 | |||
4 | /* | ||
5 | * The shmid64_ds structure for CRIS architecture (same as for i386) | ||
6 | * Note extra padding because this structure is passed back and forth | ||
7 | * between kernel and user space. | ||
8 | * | ||
9 | * Pad space is left for: | ||
10 | * - 64-bit time_t to solve y2038 problem | ||
11 | * - 2 miscellaneous 32-bit values | ||
12 | */ | ||
13 | |||
14 | struct shmid64_ds { | ||
15 | struct ipc64_perm shm_perm; /* operation perms */ | ||
16 | size_t shm_segsz; /* size of segment (bytes) */ | ||
17 | __kernel_time_t shm_atime; /* last attach time */ | ||
18 | unsigned long __unused1; | ||
19 | __kernel_time_t shm_dtime; /* last detach time */ | ||
20 | unsigned long __unused2; | ||
21 | __kernel_time_t shm_ctime; /* last change time */ | ||
22 | unsigned long __unused3; | ||
23 | __kernel_pid_t shm_cpid; /* pid of creator */ | ||
24 | __kernel_pid_t shm_lpid; /* pid of last operator */ | ||
25 | unsigned long shm_nattch; /* no. of current attaches */ | ||
26 | unsigned long __unused4; | ||
27 | unsigned long __unused5; | ||
28 | }; | ||
29 | |||
30 | struct shminfo64 { | ||
31 | unsigned long shmmax; | ||
32 | unsigned long shmmin; | ||
33 | unsigned long shmmni; | ||
34 | unsigned long shmseg; | ||
35 | unsigned long shmall; | ||
36 | unsigned long __unused1; | ||
37 | unsigned long __unused2; | ||
38 | unsigned long __unused3; | ||
39 | unsigned long __unused4; | ||
40 | }; | ||
41 | |||
42 | #endif /* _CRIS_SHMBUF_H */ | ||
diff --git a/arch/cris/include/uapi/asm/siginfo.h b/arch/cris/include/uapi/asm/siginfo.h deleted file mode 100644 index c1cd6d16928b..000000000000 --- a/arch/cris/include/uapi/asm/siginfo.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _CRIS_SIGINFO_H | ||
2 | #define _CRIS_SIGINFO_H | ||
3 | |||
4 | #include <asm-generic/siginfo.h> | ||
5 | |||
6 | #endif | ||
diff --git a/arch/cris/include/uapi/asm/socket.h b/arch/cris/include/uapi/asm/socket.h deleted file mode 100644 index e2503d9f1869..000000000000 --- a/arch/cris/include/uapi/asm/socket.h +++ /dev/null | |||
@@ -1,92 +0,0 @@ | |||
1 | #ifndef _ASM_SOCKET_H | ||
2 | #define _ASM_SOCKET_H | ||
3 | |||
4 | /* almost the same as asm-i386/socket.h */ | ||
5 | |||
6 | #include <asm/sockios.h> | ||
7 | |||
8 | /* For setsockoptions(2) */ | ||
9 | #define SOL_SOCKET 1 | ||
10 | |||
11 | #define SO_DEBUG 1 | ||
12 | #define SO_REUSEADDR 2 | ||
13 | #define SO_TYPE 3 | ||
14 | #define SO_ERROR 4 | ||
15 | #define SO_DONTROUTE 5 | ||
16 | #define SO_BROADCAST 6 | ||
17 | #define SO_SNDBUF 7 | ||
18 | #define SO_RCVBUF 8 | ||
19 | #define SO_SNDBUFFORCE 32 | ||
20 | #define SO_RCVBUFFORCE 33 | ||
21 | #define SO_KEEPALIVE 9 | ||
22 | #define SO_OOBINLINE 10 | ||
23 | #define SO_NO_CHECK 11 | ||
24 | #define SO_PRIORITY 12 | ||
25 | #define SO_LINGER 13 | ||
26 | #define SO_BSDCOMPAT 14 | ||
27 | #define SO_REUSEPORT 15 | ||
28 | #define SO_PASSCRED 16 | ||
29 | #define SO_PEERCRED 17 | ||
30 | #define SO_RCVLOWAT 18 | ||
31 | #define SO_SNDLOWAT 19 | ||
32 | #define SO_RCVTIMEO 20 | ||
33 | #define SO_SNDTIMEO 21 | ||
34 | |||
35 | /* Security levels - as per NRL IPv6 - don't actually do anything */ | ||
36 | #define SO_SECURITY_AUTHENTICATION 22 | ||
37 | #define SO_SECURITY_ENCRYPTION_TRANSPORT 23 | ||
38 | #define SO_SECURITY_ENCRYPTION_NETWORK 24 | ||
39 | |||
40 | #define SO_BINDTODEVICE 25 | ||
41 | |||
42 | /* Socket filtering */ | ||
43 | #define SO_ATTACH_FILTER 26 | ||
44 | #define SO_DETACH_FILTER 27 | ||
45 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
46 | |||
47 | #define SO_PEERNAME 28 | ||
48 | #define SO_TIMESTAMP 29 | ||
49 | #define SCM_TIMESTAMP SO_TIMESTAMP | ||
50 | |||
51 | #define SO_ACCEPTCONN 30 | ||
52 | |||
53 | #define SO_PEERSEC 31 | ||
54 | #define SO_PASSSEC 34 | ||
55 | #define SO_TIMESTAMPNS 35 | ||
56 | #define SCM_TIMESTAMPNS SO_TIMESTAMPNS | ||
57 | |||
58 | #define SO_MARK 36 | ||
59 | |||
60 | #define SO_TIMESTAMPING 37 | ||
61 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
62 | |||
63 | #define SO_PROTOCOL 38 | ||
64 | #define SO_DOMAIN 39 | ||
65 | |||
66 | #define SO_RXQ_OVFL 40 | ||
67 | |||
68 | #define SO_WIFI_STATUS 41 | ||
69 | #define SCM_WIFI_STATUS SO_WIFI_STATUS | ||
70 | #define SO_PEEK_OFF 42 | ||
71 | |||
72 | /* Instruct lower device to use last 4-bytes of skb data as FCS */ | ||
73 | #define SO_NOFCS 43 | ||
74 | |||
75 | #define SO_LOCK_FILTER 44 | ||
76 | |||
77 | #define SO_SELECT_ERR_QUEUE 45 | ||
78 | |||
79 | #define SO_BUSY_POLL 46 | ||
80 | |||
81 | #define SO_MAX_PACING_RATE 47 | ||
82 | |||
83 | #define SO_BPF_EXTENSIONS 48 | ||
84 | |||
85 | #define SO_INCOMING_CPU 49 | ||
86 | |||
87 | #define SO_ATTACH_BPF 50 | ||
88 | #define SO_DETACH_BPF SO_DETACH_FILTER | ||
89 | |||
90 | #endif /* _ASM_SOCKET_H */ | ||
91 | |||
92 | |||
diff --git a/arch/cris/include/uapi/asm/sockios.h b/arch/cris/include/uapi/asm/sockios.h deleted file mode 100644 index cfe7bfecf599..000000000000 --- a/arch/cris/include/uapi/asm/sockios.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | #ifndef __ARCH_CRIS_SOCKIOS__ | ||
2 | #define __ARCH_CRIS_SOCKIOS__ | ||
3 | |||
4 | /* Socket-level I/O control calls. */ | ||
5 | #define FIOSETOWN 0x8901 | ||
6 | #define SIOCSPGRP 0x8902 | ||
7 | #define FIOGETOWN 0x8903 | ||
8 | #define SIOCGPGRP 0x8904 | ||
9 | #define SIOCATMARK 0x8905 | ||
10 | #define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ | ||
11 | #define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ | ||
12 | |||
13 | #endif | ||
diff --git a/arch/cris/include/uapi/asm/statfs.h b/arch/cris/include/uapi/asm/statfs.h deleted file mode 100644 index fdaf921844bc..000000000000 --- a/arch/cris/include/uapi/asm/statfs.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _CRIS_STATFS_H | ||
2 | #define _CRIS_STATFS_H | ||
3 | |||
4 | #include <asm-generic/statfs.h> | ||
5 | |||
6 | #endif | ||
diff --git a/arch/cris/include/uapi/asm/types.h b/arch/cris/include/uapi/asm/types.h deleted file mode 100644 index 9ec9d4c5ac4d..000000000000 --- a/arch/cris/include/uapi/asm/types.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/int-ll64.h> | ||
diff --git a/arch/cris/include/uapi/asm/unistd.h b/arch/cris/include/uapi/asm/unistd.h index f3287face443..062b648b27e1 100644 --- a/arch/cris/include/uapi/asm/unistd.h +++ b/arch/cris/include/uapi/asm/unistd.h | |||
@@ -356,5 +356,13 @@ | |||
356 | #define __NR_process_vm_writev 349 | 356 | #define __NR_process_vm_writev 349 |
357 | #define __NR_kcmp 350 | 357 | #define __NR_kcmp 350 |
358 | #define __NR_finit_module 351 | 358 | #define __NR_finit_module 351 |
359 | #define __NR_sched_setattr 352 | ||
360 | #define __NR_sched_getattr 353 | ||
361 | #define __NR_renameat2 354 | ||
362 | #define __NR_seccomp 355 | ||
363 | #define __NR_getrandom 356 | ||
364 | #define __NR_memfd_create 357 | ||
365 | #define __NR_bpf 358 | ||
366 | #define __NR_execveat 359 | ||
359 | 367 | ||
360 | #endif /* _UAPI_ASM_CRIS_UNISTD_H_ */ | 368 | #endif /* _UAPI_ASM_CRIS_UNISTD_H_ */ |
diff --git a/arch/cris/kernel/Makefile b/arch/cris/kernel/Makefile index edef71f12bb8..5fae398ca915 100644 --- a/arch/cris/kernel/Makefile +++ b/arch/cris/kernel/Makefile | |||
@@ -8,6 +8,7 @@ extra-y := vmlinux.lds | |||
8 | 8 | ||
9 | obj-y := process.o traps.o irq.o ptrace.o setup.o time.o sys_cris.o | 9 | obj-y := process.o traps.o irq.o ptrace.o setup.o time.o sys_cris.o |
10 | obj-y += devicetree.o | 10 | obj-y += devicetree.o |
11 | obj-y += stacktrace.o | ||
11 | 12 | ||
12 | obj-$(CONFIG_MODULES) += crisksyms.o | 13 | obj-$(CONFIG_MODULES) += crisksyms.o |
13 | obj-$(CONFIG_MODULES) += module.o | 14 | obj-$(CONFIG_MODULES) += module.o |
diff --git a/arch/cris/kernel/irq.c b/arch/cris/kernel/irq.c index dd0be5de55d5..694850e8f077 100644 --- a/arch/cris/kernel/irq.c +++ b/arch/cris/kernel/irq.c | |||
@@ -45,7 +45,11 @@ | |||
45 | asmlinkage void do_IRQ(int irq, struct pt_regs * regs) | 45 | asmlinkage void do_IRQ(int irq, struct pt_regs * regs) |
46 | { | 46 | { |
47 | unsigned long sp; | 47 | unsigned long sp; |
48 | struct pt_regs *old_regs = set_irq_regs(regs); | 48 | struct pt_regs *old_regs; |
49 | |||
50 | trace_hardirqs_off(); | ||
51 | |||
52 | old_regs = set_irq_regs(regs); | ||
49 | irq_enter(); | 53 | irq_enter(); |
50 | sp = rdsp(); | 54 | sp = rdsp(); |
51 | if (unlikely((sp & (PAGE_SIZE - 1)) < (PAGE_SIZE/8))) { | 55 | if (unlikely((sp & (PAGE_SIZE - 1)) < (PAGE_SIZE/8))) { |
diff --git a/arch/cris/kernel/stacktrace.c b/arch/cris/kernel/stacktrace.c new file mode 100644 index 000000000000..99838c74456d --- /dev/null +++ b/arch/cris/kernel/stacktrace.c | |||
@@ -0,0 +1,76 @@ | |||
1 | #include <linux/sched.h> | ||
2 | #include <linux/stacktrace.h> | ||
3 | #include <linux/stacktrace.h> | ||
4 | #include <asm/stacktrace.h> | ||
5 | |||
6 | void walk_stackframe(unsigned long sp, | ||
7 | int (*fn)(unsigned long addr, void *data), | ||
8 | void *data) | ||
9 | { | ||
10 | unsigned long high = ALIGN(sp, THREAD_SIZE); | ||
11 | |||
12 | for (; sp <= high - 4; sp += 4) { | ||
13 | unsigned long addr = *(unsigned long *) sp; | ||
14 | |||
15 | if (!kernel_text_address(addr)) | ||
16 | continue; | ||
17 | |||
18 | if (fn(addr, data)) | ||
19 | break; | ||
20 | } | ||
21 | } | ||
22 | |||
23 | struct stack_trace_data { | ||
24 | struct stack_trace *trace; | ||
25 | unsigned int no_sched_functions; | ||
26 | unsigned int skip; | ||
27 | }; | ||
28 | |||
29 | #ifdef CONFIG_STACKTRACE | ||
30 | |||
31 | static int save_trace(unsigned long addr, void *d) | ||
32 | { | ||
33 | struct stack_trace_data *data = d; | ||
34 | struct stack_trace *trace = data->trace; | ||
35 | |||
36 | if (data->no_sched_functions && in_sched_functions(addr)) | ||
37 | return 0; | ||
38 | |||
39 | if (data->skip) { | ||
40 | data->skip--; | ||
41 | return 0; | ||
42 | } | ||
43 | |||
44 | trace->entries[trace->nr_entries++] = addr; | ||
45 | |||
46 | return trace->nr_entries >= trace->max_entries; | ||
47 | } | ||
48 | |||
49 | void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) | ||
50 | { | ||
51 | struct stack_trace_data data; | ||
52 | unsigned long sp; | ||
53 | |||
54 | data.trace = trace; | ||
55 | data.skip = trace->skip; | ||
56 | |||
57 | if (tsk != current) { | ||
58 | data.no_sched_functions = 1; | ||
59 | sp = tsk->thread.ksp; | ||
60 | } else { | ||
61 | data.no_sched_functions = 0; | ||
62 | sp = rdsp(); | ||
63 | } | ||
64 | |||
65 | walk_stackframe(sp, save_trace, &data); | ||
66 | if (trace->nr_entries < trace->max_entries) | ||
67 | trace->entries[trace->nr_entries++] = ULONG_MAX; | ||
68 | } | ||
69 | |||
70 | void save_stack_trace(struct stack_trace *trace) | ||
71 | { | ||
72 | save_stack_trace_tsk(current, trace); | ||
73 | } | ||
74 | EXPORT_SYMBOL_GPL(save_stack_trace); | ||
75 | |||
76 | #endif /* CONFIG_STACKTRACE */ | ||