Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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
...

+220 -421
+12
arch/cris/Kconfig
··· 36 36 int 37 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 50 config CRIS 40 51 bool 41 52 default y ··· 69 58 select CLKSRC_MMIO if ETRAX_ARCH_V32 70 59 select GENERIC_CLOCKEVENTS if ETRAX_ARCH_V32 71 60 select GENERIC_SCHED_CLOCK if ETRAX_ARCH_V32 61 + select HAVE_DEBUG_BUGVERBOSE if ETRAX_ARCH_V32 72 62 73 63 config HZ 74 64 int
+8
arch/cris/arch-v10/kernel/entry.S
··· 955 955 .long sys_process_vm_writev 956 956 .long sys_kcmp /* 350 */ 957 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 968 * NOTE!! This doesn't have to be exact - we just have
-42
arch/cris/arch-v10/lib/dmacopy.c
··· 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 -
-86
arch/cris/arch-v10/lib/old_checksum.c
··· 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);
+8 -8
arch/cris/arch-v32/drivers/Kconfig
··· 202 202 default "0x00" if ETRAXFS 203 203 default "0x00000000" if !ETRAXFS 204 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 206 user can change direction on using ioctl's. 207 207 Bit set = changeable. 208 208 You probably want 0 here, but it depends on your hardware. ··· 213 213 default "0x00" if ETRAXFS 214 214 default "0x00000000" if !ETRAXFS 215 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 217 that a user can change the value on using ioctl's. 218 218 Bit set = changeable. 219 219 ··· 223 223 default "0x00000" if ETRAXFS 224 224 default "0x00000000" if !ETRAXFS 225 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 227 that a user can change direction on using ioctl's. 228 228 Bit set = changeable. 229 229 You probably want 0 here, but it depends on your hardware. ··· 234 234 default "0x00000" if ETRAXFS 235 235 default "0x00000000" if !ETRAXFS 236 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 238 that a user can change the value on using ioctl's. 239 239 Bit set = changeable. 240 240 ··· 244 244 default "0x00000" if ETRAXFS 245 245 default "0x00000000" if !ETRAXFS 246 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 248 that a user can change direction on using ioctl's. 249 249 Bit set = changeable. 250 250 You probably want 0 here, but it depends on your hardware. ··· 253 253 hex "PC user changeable bits mask" 254 254 depends on ETRAX_GPIO 255 255 default "0x00000" if ETRAXFS 256 - default "0x00000000" if ETRAXFS 256 + default "0x00000000" if !ETRAXFS 257 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 259 that a user can change the value on using ioctl's. 260 260 Bit set = changeable. 261 261 ··· 264 264 depends on ETRAX_GPIO && ETRAXFS 265 265 default "0x00000" 266 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 268 that a user can change direction on using ioctl's. 269 269 Bit set = changeable. 270 270 You probably want 0x00000 here, but it depends on your hardware.
+5 -4
arch/cris/arch-v32/drivers/axisflashmap.c
··· 313 313 size_t len; 314 314 int ram_rootfs_partition = -1; /* -1 => no RAM rootfs partition */ 315 315 int part; 316 + struct mtd_partition *partition; 316 317 317 318 /* We need a root fs. If it resides in RAM, we need to use an 318 319 * MTDRAM device, so it must be enabled in the kernel config, ··· 330 329 331 330 main_mtd = flash_probe(); 332 331 if (main_mtd) 333 - printk(KERN_INFO "%s: 0x%08x bytes of NOR flash memory.\n", 332 + printk(KERN_INFO "%s: 0x%08llx bytes of NOR flash memory.\n", 334 333 main_mtd->name, main_mtd->size); 335 334 336 335 #ifdef CONFIG_ETRAX_NANDFLASH ··· 389 388 #endif 390 389 391 390 if (main_mtd) { 391 + loff_t ptable_sector = CONFIG_ETRAX_PTABLE_SECTOR; 392 392 main_mtd->owner = THIS_MODULE; 393 393 axisflash_mtd = main_mtd; 394 394 395 - loff_t ptable_sector = CONFIG_ETRAX_PTABLE_SECTOR; 396 395 397 396 /* First partition (rescue) is always set to the default. */ 398 397 pidx++; ··· 518 517 /* Decide whether to use default partition table. */ 519 518 /* Only use default table if we actually have a device (main_mtd) */ 520 519 521 - struct mtd_partition *partition = &axis_partitions[0]; 520 + partition = &axis_partitions[0]; 522 521 if (main_mtd && !ptable_ok) { 523 522 memcpy(axis_partitions, axis_default_partitions, 524 523 sizeof(axis_default_partitions)); ··· 581 580 printk(KERN_INFO "axisflashmap: Adding RAM partition " 582 581 "for rootfs image.\n"); 583 582 err = mtdram_init_device(mtd_ram, 584 - (void *)partition[part].offset, 583 + (void *)(u_int32_t)partition[part].offset, 585 584 partition[part].size, 586 585 partition[part].name); 587 586 if (err)
+2 -2
arch/cris/arch-v32/drivers/mach-a3/gpio.c
··· 957 957 958 958 static int __init gpio_init(void) 959 959 { 960 - int res; 960 + int res, res2; 961 961 962 962 printk(KERN_INFO "ETRAX FS GPIO driver v2.7, (c) 2003-2008 " 963 963 "Axis Communications AB\n"); ··· 977 977 CRIS_LED_DISK_READ(0); 978 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 981 IRQF_SHARED, "gpio", &alarmlist); 982 982 if (res2) { 983 983 printk(KERN_ERR "err: irq for gpio\n");
+1 -2
arch/cris/arch-v32/drivers/mach-fs/gpio.c
··· 425 425 if (p > GPIO_MINOR_LAST) 426 426 return -EINVAL; 427 427 428 - priv = kmalloc(sizeof(struct gpio_private), GFP_KERNEL); 428 + priv = kzalloc(sizeof(struct gpio_private), GFP_KERNEL); 429 429 if (!priv) 430 430 return -ENOMEM; 431 431 432 432 mutex_lock(&gpio_mutex); 433 - memset(priv, 0, sizeof(*priv)); 434 433 435 434 priv->minor = p; 436 435
+19
arch/cris/arch-v32/kernel/entry.S
··· 240 240 241 241 .type _Rexit,@function 242 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 254 ;; This epilogue MUST match the prologues in multiple_interrupt, irq.h 244 255 ;; and ptregs.h. 245 256 addq 4, $sp ; Skip orig_r10. ··· 886 875 .long sys_process_vm_writev 887 876 .long sys_kcmp /* 350 */ 888 877 .long sys_finit_module 878 + .long sys_sched_setattr 879 + .long sys_sched_getattr 880 + .long sys_renameat2 881 + .long sys_seccomp /* 355 */ 882 + .long sys_getrandom 883 + .long sys_memfd_create 884 + .long sys_bpf 885 + .long sys_execveat 889 886 890 887 /* 891 888 * NOTE!! This doesn't have to be exact - we just have
+2 -2
arch/cris/arch-v32/kernel/process.c
··· 23 23 /* We use this if we don't have any better idle routine. */ 24 24 void default_idle(void) 25 25 { 26 + local_irq_enable(); 26 27 /* Halt until exception. */ 27 - __asm__ volatile("ei \n\t" 28 - "halt "); 28 + __asm__ volatile("halt"); 29 29 } 30 30 31 31 /*
-1
arch/cris/arch-v32/kernel/signal.c
··· 19 19 #include <asm/processor.h> 20 20 #include <asm/ucontext.h> 21 21 #include <asm/uaccess.h> 22 - #include <arch/ptrace.h> 23 22 #include <arch/hwregs/cpu_vect.h> 24 23 25 24 extern unsigned long cris_signal_return_page;
+6 -2
arch/cris/arch-v32/mach-fs/pinmux.c
··· 46 46 pins[port][i] = mode; 47 47 48 48 crisv32_pinmux_set(port); 49 + 50 + return 0; 49 51 } 50 52 51 53 static int crisv32_pinmux_init(void) ··· 95 93 int ret = -EINVAL; 96 94 char saved[sizeof pins]; 97 95 unsigned long flags; 96 + reg_pinmux_rw_hwprot hwprot; 98 97 99 98 spin_lock_irqsave(&pinmux_lock, flags); 100 99 ··· 104 101 105 102 crisv32_pinmux_init(); /* Must be done before we read rw_hwprot */ 106 103 107 - reg_pinmux_rw_hwprot hwprot = REG_RD(pinmux, regi_pinmux, rw_hwprot); 104 + hwprot = REG_RD(pinmux, regi_pinmux, rw_hwprot); 108 105 109 106 switch (function) { 110 107 case pinmux_ser1: ··· 230 227 int ret = -EINVAL; 231 228 char saved[sizeof pins]; 232 229 unsigned long flags; 230 + reg_pinmux_rw_hwprot hwprot; 233 231 234 232 spin_lock_irqsave(&pinmux_lock, flags); 235 233 ··· 239 235 240 236 crisv32_pinmux_init(); /* Must be done before we read rw_hwprot */ 241 237 242 - reg_pinmux_rw_hwprot hwprot = REG_RD(pinmux, regi_pinmux, rw_hwprot); 238 + hwprot = REG_RD(pinmux, regi_pinmux, rw_hwprot); 243 239 244 240 switch (function) { 245 241 case pinmux_ser1:
+1 -4
arch/cris/configs/artpec_3_defconfig
··· 12 12 CONFIG_CRIS_MACH_ARTPEC3=y 13 13 CONFIG_ETRAX_DRAM_SIZE=32 14 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 15 CONFIG_NET=y 20 16 CONFIG_PACKET=y 21 17 CONFIG_UNIX=y ··· 38 42 CONFIG_CRAMFS=y 39 43 CONFIG_NFS_FS=y 40 44 CONFIG_NFS_V3=y 45 + CONFIG_ETRAX_GPIO=y
+1
arch/cris/configs/etraxfs_defconfig
··· 38 38 CONFIG_CRAMFS=y 39 39 CONFIG_NFS_FS=y 40 40 CONFIG_NFS_V3=y 41 + CONFIG_ETRAX_GPIO=y
+3 -2
arch/cris/include/arch-v10/arch/elf.h arch/cris/include/uapi/asm/elf_v10.h
··· 1 1 #ifndef __ASMCRIS_ARCH_ELF_H 2 2 #define __ASMCRIS_ARCH_ELF_H 3 3 4 - #include <arch/system.h> 5 - 6 4 #define ELF_MACH EF_CRIS_VARIANT_ANY_V0_V10 5 + 6 + /* Matches struct user_regs_struct */ 7 + #define ELF_NGREG 35 7 8 8 9 /* 9 10 * This is used to ensure we don't load something for the wrong architecture.
arch/cris/include/arch-v10/arch/ptrace.h arch/cris/include/uapi/asm/ptrace_v10.h
+9 -2
arch/cris/include/arch-v32/arch/bug.h
··· 10 10 * All other stuff is done out-of-band with exception handlers. 11 11 */ 12 12 #define BUG() \ 13 + do { \ 13 14 __asm__ __volatile__ ("0: break 14\n\t" \ 14 15 ".section .fixup,\"ax\"\n" \ 15 16 "1:\n\t" \ ··· 22 21 ".section __ex_table,\"a\"\n\t" \ 23 22 ".dword 0b, 1b\n\t" \ 24 23 ".previous\n\t" \ 25 - : : "ri" (__FILE__), "i" (__LINE__)) 24 + : : "ri" (__FILE__), "i" (__LINE__)); \ 25 + unreachable(); \ 26 + } while (0) 26 27 #else 27 - #define BUG() __asm__ __volatile__ ("break 14\n\t") 28 + #define BUG() \ 29 + do { \ 30 + __asm__ __volatile__ ("break 14\n\t"); \ 31 + unreachable(); \ 32 + } while (0) 28 33 #endif 29 34 30 35 #define HAVE_ARCH_BUG
+3 -2
arch/cris/include/arch-v32/arch/elf.h arch/cris/include/uapi/asm/elf_v32.h
··· 1 1 #ifndef _ASM_CRIS_ELF_H 2 2 #define _ASM_CRIS_ELF_H 3 3 4 - #include <arch/system.h> 5 - 6 4 #define ELF_CORE_EFLAGS EF_CRIS_VARIANT_V32 5 + 6 + /* Matches struct user_regs_struct */ 7 + #define ELF_NGREG 32 7 8 8 9 /* 9 10 * This is used to ensure we don't load something for the wrong architecture.
+1 -1
arch/cris/include/arch-v32/arch/irqflags.h
··· 2 2 #define __ASM_CRIS_ARCH_IRQFLAGS_H 3 3 4 4 #include <linux/types.h> 5 - #include <arch/ptrace.h> 5 + #include <asm/ptrace.h> 6 6 7 7 static inline unsigned long arch_local_save_flags(void) 8 8 {
arch/cris/include/arch-v32/arch/ptrace.h arch/cris/include/uapi/asm/ptrace_v32.h
+17
arch/cris/include/asm/Kbuild
··· 1 1 generic-y += atomic.h 2 + generic-y += auxvec.h 2 3 generic-y += barrier.h 4 + generic-y += bitsperlong.h 3 5 generic-y += clkdev.h 4 6 generic-y += cmpxchg.h 5 7 generic-y += cputime.h 6 8 generic-y += device.h 7 9 generic-y += div64.h 10 + generic-y += errno.h 8 11 generic-y += exec.h 9 12 generic-y += emergency-restart.h 13 + generic-y += fcntl.h 10 14 generic-y += futex.h 11 15 generic-y += hardirq.h 16 + generic-y += ioctl.h 17 + generic-y += ipcbuf.h 12 18 generic-y += irq_regs.h 13 19 generic-y += irq_work.h 14 20 generic-y += kdebug.h ··· 25 19 generic-y += local64.h 26 20 generic-y += mcs_spinlock.h 27 21 generic-y += mm-arch-hooks.h 22 + generic-y += mman.h 28 23 generic-y += module.h 24 + generic-y += msgbuf.h 29 25 generic-y += percpu.h 26 + generic-y += poll.h 30 27 generic-y += preempt.h 28 + generic-y += resource.h 31 29 generic-y += sections.h 30 + generic-y += sembuf.h 31 + generic-y += shmbuf.h 32 + generic-y += siginfo.h 33 + generic-y += socket.h 34 + generic-y += sockios.h 35 + generic-y += statfs.h 32 36 generic-y += topology.h 33 37 generic-y += trace_clock.h 38 + generic-y += types.h 34 39 generic-y += vga.h 35 40 generic-y += xor.h
+5 -4
arch/cris/include/asm/elf.h arch/cris/include/uapi/asm/elf.h
··· 5 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 14 #define R_CRIS_NONE 0 11 15 #define R_CRIS_8 1 ··· 36 32 37 33 /* Note that NGREG is defined to ELF_NGREG in include/linux/elfcore.h, and is 38 34 thus exposed to user-space. */ 39 - #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) 40 35 typedef elf_greg_t elf_gregset_t[ELF_NGREG]; 41 36 42 37 /* A placeholder; CRIS does not have any fp regs. */ ··· 47 44 #define ELF_CLASS ELFCLASS32 48 45 #define ELF_DATA ELFDATA2LSB 49 46 #define ELF_ARCH EM_CRIS 50 - 51 - #include <arch/elf.h> 52 47 53 48 /* The master for these definitions is {binutils}/include/elf/cris.h: */ 54 49 /* User symbols in this file have a leading underscore. */
+8 -1
arch/cris/include/asm/mmu_context.h
··· 11 11 12 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 23 /* current active pgd - this is similar to other processors pgd 17 24 * registers like cr3 on the i386
+8
arch/cris/include/asm/stacktrace.h
··· 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
-12
arch/cris/include/asm/types.h
··· 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
+1 -1
arch/cris/include/asm/unistd.h
··· 4 4 #include <uapi/asm/unistd.h> 5 5 6 6 7 - #define NR_syscalls 360 7 + #define NR_syscalls 365 8 8 9 9 #include <arch/unistd.h> 10 10
+5
arch/cris/include/uapi/asm/Kbuild
··· 6 6 header-y += auxvec.h 7 7 header-y += bitsperlong.h 8 8 header-y += byteorder.h 9 + header-y += elf.h 10 + header-y += elf_v10.h 11 + header-y += elf_v32.h 9 12 header-y += errno.h 10 13 header-y += ethernet.h 11 14 header-y += etraxgpio.h ··· 22 19 header-y += poll.h 23 20 header-y += posix_types.h 24 21 header-y += ptrace.h 22 + header-y += ptrace_v10.h 23 + header-y += ptrace_v32.h 25 24 header-y += resource.h 26 25 header-y += rs485.h 27 26 header-y += sembuf.h
-4
arch/cris/include/uapi/asm/auxvec.h
··· 1 - #ifndef __ASMCRIS_AUXVEC_H 2 - #define __ASMCRIS_AUXVEC_H 3 - 4 - #endif
-1
arch/cris/include/uapi/asm/bitsperlong.h
··· 1 - #include <asm-generic/bitsperlong.h>
-6
arch/cris/include/uapi/asm/errno.h
··· 1 - #ifndef _CRIS_ERRNO_H 2 - #define _CRIS_ERRNO_H 3 - 4 - #include <asm-generic/errno.h> 5 - 6 - #endif
-1
arch/cris/include/uapi/asm/fcntl.h
··· 1 - #include <asm-generic/fcntl.h>
-1
arch/cris/include/uapi/asm/ioctl.h
··· 1 - #include <asm-generic/ioctl.h>
-1
arch/cris/include/uapi/asm/ipcbuf.h
··· 1 - #include <asm-generic/ipcbuf.h>
-1
arch/cris/include/uapi/asm/kvm_para.h
··· 1 - #include <asm-generic/kvm_para.h>
-1
arch/cris/include/uapi/asm/mman.h
··· 1 - #include <asm-generic/mman.h>
-33
arch/cris/include/uapi/asm/msgbuf.h
··· 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 */
-1
arch/cris/include/uapi/asm/poll.h
··· 1 - #include <asm-generic/poll.h>
+5 -1
arch/cris/include/uapi/asm/ptrace.h
··· 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
-6
arch/cris/include/uapi/asm/resource.h
··· 1 - #ifndef _CRIS_RESOURCE_H 2 - #define _CRIS_RESOURCE_H 3 - 4 - #include <asm-generic/resource.h> 5 - 6 - #endif
-25
arch/cris/include/uapi/asm/sembuf.h
··· 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 */
-42
arch/cris/include/uapi/asm/shmbuf.h
··· 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 */
-6
arch/cris/include/uapi/asm/siginfo.h
··· 1 - #ifndef _CRIS_SIGINFO_H 2 - #define _CRIS_SIGINFO_H 3 - 4 - #include <asm-generic/siginfo.h> 5 - 6 - #endif
-92
arch/cris/include/uapi/asm/socket.h
··· 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 -
-13
arch/cris/include/uapi/asm/sockios.h
··· 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
-6
arch/cris/include/uapi/asm/statfs.h
··· 1 - #ifndef _CRIS_STATFS_H 2 - #define _CRIS_STATFS_H 3 - 4 - #include <asm-generic/statfs.h> 5 - 6 - #endif
-1
arch/cris/include/uapi/asm/types.h
··· 1 - #include <asm-generic/int-ll64.h>
+8
arch/cris/include/uapi/asm/unistd.h
··· 356 356 #define __NR_process_vm_writev 349 357 357 #define __NR_kcmp 350 358 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 368 #endif /* _UAPI_ASM_CRIS_UNISTD_H_ */
+1
arch/cris/kernel/Makefile
··· 8 8 9 9 obj-y := process.o traps.o irq.o ptrace.o setup.o time.o sys_cris.o 10 10 obj-y += devicetree.o 11 + obj-y += stacktrace.o 11 12 12 13 obj-$(CONFIG_MODULES) += crisksyms.o 13 14 obj-$(CONFIG_MODULES) += module.o
+5 -1
arch/cris/kernel/irq.c
··· 45 45 asmlinkage void do_IRQ(int irq, struct pt_regs * regs) 46 46 { 47 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 53 irq_enter(); 50 54 sp = rdsp(); 51 55 if (unlikely((sp & (PAGE_SIZE - 1)) < (PAGE_SIZE/8))) {
+76
arch/cris/kernel/stacktrace.c
··· 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 */