Commit 8a60ba0a authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32

Pull AVR32 updates from Hans-Christian Egtvedt.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32:
  avr32: uapi: be sure of "_UAPI" prefix for all guard macros
  avr32: add kprobe_ctlblk memory struct
  avr32: fix out-of-range jump in large kernels
  avr32: setup crt for early panic()
parents af2e2f32 e7f2c8c1
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/thread_info.h>
#include <asm/sysreg.h>
/* /*
* The kernel is loaded where we want it to be and all caches * The kernel is loaded where we want it to be and all caches
...@@ -20,11 +22,6 @@ ...@@ -20,11 +22,6 @@
.section .init.text,"ax" .section .init.text,"ax"
.global _start .global _start
_start: _start:
/* Check if the boot loader actually provided a tag table */
lddpc r0, magic_number
cp.w r12, r0
brne no_tag_table
/* Initialize .bss */ /* Initialize .bss */
lddpc r2, bss_start_addr lddpc r2, bss_start_addr
lddpc r3, end_addr lddpc r3, end_addr
...@@ -34,6 +31,25 @@ _start: ...@@ -34,6 +31,25 @@ _start:
cp r2, r3 cp r2, r3
brlo 1b brlo 1b
/* Initialize status register */
lddpc r0, init_sr
mtsr SYSREG_SR, r0
/* Set initial stack pointer */
lddpc sp, stack_addr
sub sp, -THREAD_SIZE
#ifdef CONFIG_FRAME_POINTER
/* Mark last stack frame */
mov lr, 0
mov r7, 0
#endif
/* Check if the boot loader actually provided a tag table */
lddpc r0, magic_number
cp.w r12, r0
brne no_tag_table
/* /*
* Save the tag table address for later use. This must be done * Save the tag table address for later use. This must be done
* _after_ .bss has been initialized... * _after_ .bss has been initialized...
...@@ -53,8 +69,15 @@ bss_start_addr: ...@@ -53,8 +69,15 @@ bss_start_addr:
.long __bss_start .long __bss_start
end_addr: end_addr:
.long _end .long _end
init_sr:
.long 0x007f0000 /* Supervisor mode, everything masked */
stack_addr:
.long init_thread_union
panic_addr:
.long panic
no_tag_table: no_tag_table:
sub r12, pc, (. - 2f) sub r12, pc, (. - 2f)
bral panic /* branch to panic() which can be far away with that construct */
lddpc pc, panic_addr
2: .asciz "Boot loader didn't provide correct magic number\n" 2: .asciz "Boot loader didn't provide correct magic number\n"
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
typedef u16 kprobe_opcode_t; typedef u16 kprobe_opcode_t;
#define BREAKPOINT_INSTRUCTION 0xd673 /* breakpoint */ #define BREAKPOINT_INSTRUCTION 0xd673 /* breakpoint */
#define MAX_INSN_SIZE 2 #define MAX_INSN_SIZE 2
#define MAX_STACK_SIZE 64 /* 32 would probably be OK */
#define kretprobe_blacklist_size 0 #define kretprobe_blacklist_size 0
...@@ -26,6 +27,19 @@ struct arch_specific_insn { ...@@ -26,6 +27,19 @@ struct arch_specific_insn {
kprobe_opcode_t insn[MAX_INSN_SIZE]; kprobe_opcode_t insn[MAX_INSN_SIZE];
}; };
struct prev_kprobe {
struct kprobe *kp;
unsigned int status;
};
/* per-cpu kprobe control block */
struct kprobe_ctlblk {
unsigned int kprobe_status;
struct prev_kprobe prev_kprobe;
struct pt_regs jprobe_saved_regs;
char jprobes_stack[MAX_STACK_SIZE];
};
extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
extern int kprobe_exceptions_notify(struct notifier_block *self, extern int kprobe_exceptions_notify(struct notifier_block *self,
unsigned long val, void *data); unsigned long val, void *data);
......
...@@ -2,35 +2,35 @@ ...@@ -2,35 +2,35 @@
include include/uapi/asm-generic/Kbuild.asm include include/uapi/asm-generic/Kbuild.asm
header-y += auxvec.h header-y += auxvec.h
header-y += bitsperlong.h
header-y += byteorder.h header-y += byteorder.h
header-y += cachectl.h header-y += cachectl.h
header-y += errno.h
header-y += fcntl.h
header-y += ioctl.h
header-y += ioctls.h
header-y += ipcbuf.h
header-y += kvm_para.h
header-y += mman.h
header-y += msgbuf.h header-y += msgbuf.h
header-y += param.h header-y += param.h
header-y += poll.h
header-y += posix_types.h header-y += posix_types.h
header-y += ptrace.h header-y += ptrace.h
header-y += resource.h
header-y += sembuf.h header-y += sembuf.h
header-y += setup.h header-y += setup.h
header-y += shmbuf.h header-y += shmbuf.h
header-y += sigcontext.h header-y += sigcontext.h
header-y += siginfo.h
header-y += signal.h header-y += signal.h
header-y += socket.h header-y += socket.h
header-y += sockios.h header-y += sockios.h
header-y += stat.h header-y += stat.h
header-y += statfs.h
header-y += swab.h header-y += swab.h
header-y += termbits.h header-y += termbits.h
header-y += termios.h header-y += termios.h
header-y += types.h header-y += types.h
header-y += unistd.h header-y += unistd.h
generic-y += bitsperlong.h
generic-y += errno.h
generic-y += fcntl.h
generic-y += ioctl.h
generic-y += ioctls.h
generic-y += ipcbuf.h
generic-y += kvm_para.h
generic-y += mman.h
generic-y += param.h generic-y += param.h
generic-y += poll.h
generic-y += resource.h
generic-y += siginfo.h
generic-y += statfs.h
#ifndef __ASM_AVR32_AUXVEC_H #ifndef _UAPI__ASM_AVR32_AUXVEC_H
#define __ASM_AVR32_AUXVEC_H #define _UAPI__ASM_AVR32_AUXVEC_H
#endif /* __ASM_AVR32_AUXVEC_H */ #endif /* _UAPI__ASM_AVR32_AUXVEC_H */
#include <asm-generic/bitsperlong.h>
/* /*
* AVR32 endian-conversion functions. * AVR32 endian-conversion functions.
*/ */
#ifndef __ASM_AVR32_BYTEORDER_H #ifndef _UAPI__ASM_AVR32_BYTEORDER_H
#define __ASM_AVR32_BYTEORDER_H #define _UAPI__ASM_AVR32_BYTEORDER_H
#include <linux/byteorder/big_endian.h> #include <linux/byteorder/big_endian.h>
#endif /* __ASM_AVR32_BYTEORDER_H */ #endif /* _UAPI__ASM_AVR32_BYTEORDER_H */
#ifndef __ASM_AVR32_CACHECTL_H #ifndef _UAPI__ASM_AVR32_CACHECTL_H
#define __ASM_AVR32_CACHECTL_H #define _UAPI__ASM_AVR32_CACHECTL_H
/* /*
* Operations that can be performed through the cacheflush system call * Operations that can be performed through the cacheflush system call
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
/* Clean the data cache, then invalidate the icache */ /* Clean the data cache, then invalidate the icache */
#define CACHE_IFLUSH 0 #define CACHE_IFLUSH 0
#endif /* __ASM_AVR32_CACHECTL_H */ #endif /* _UAPI__ASM_AVR32_CACHECTL_H */
#ifndef __ASM_AVR32_ERRNO_H
#define __ASM_AVR32_ERRNO_H
#include <asm-generic/errno.h>
#endif /* __ASM_AVR32_ERRNO_H */
#ifndef __ASM_AVR32_FCNTL_H
#define __ASM_AVR32_FCNTL_H
#include <asm-generic/fcntl.h>
#endif /* __ASM_AVR32_FCNTL_H */
#ifndef __ASM_AVR32_IOCTL_H
#define __ASM_AVR32_IOCTL_H
#include <asm-generic/ioctl.h>
#endif /* __ASM_AVR32_IOCTL_H */
#ifndef __ASM_AVR32_IOCTLS_H
#define __ASM_AVR32_IOCTLS_H
#include <asm-generic/ioctls.h>
#endif /* __ASM_AVR32_IOCTLS_H */
#include <asm-generic/ipcbuf.h>
#include <asm-generic/kvm_para.h>
#ifndef __ASM_AVR32_MSGBUF_H #ifndef _UAPI__ASM_AVR32_MSGBUF_H
#define __ASM_AVR32_MSGBUF_H #define _UAPI__ASM_AVR32_MSGBUF_H
/* /*
* The msqid64_ds structure for i386 architecture. * The msqid64_ds structure for i386 architecture.
...@@ -28,4 +28,4 @@ struct msqid64_ds { ...@@ -28,4 +28,4 @@ struct msqid64_ds {
unsigned long __unused5; unsigned long __unused5;
}; };
#endif /* __ASM_AVR32_MSGBUF_H */ #endif /* _UAPI__ASM_AVR32_MSGBUF_H */
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#ifndef __ASM_AVR32_POSIX_TYPES_H #ifndef _UAPI__ASM_AVR32_POSIX_TYPES_H
#define __ASM_AVR32_POSIX_TYPES_H #define _UAPI__ASM_AVR32_POSIX_TYPES_H
/* /*
* This file is generally used by user-level software, so you need to * This file is generally used by user-level software, so you need to
...@@ -34,4 +34,4 @@ typedef unsigned short __kernel_old_dev_t; ...@@ -34,4 +34,4 @@ typedef unsigned short __kernel_old_dev_t;
#include <asm-generic/posix_types.h> #include <asm-generic/posix_types.h>
#endif /* __ASM_AVR32_POSIX_TYPES_H */ #endif /* _UAPI__ASM_AVR32_POSIX_TYPES_H */
#ifndef __ASM_AVR32_RESOURCE_H
#define __ASM_AVR32_RESOURCE_H
#include <asm-generic/resource.h>
#endif /* __ASM_AVR32_RESOURCE_H */
#ifndef __ASM_AVR32_SEMBUF_H #ifndef _UAPI__ASM_AVR32_SEMBUF_H
#define __ASM_AVR32_SEMBUF_H #define _UAPI__ASM_AVR32_SEMBUF_H
/* /*
* The semid64_ds structure for AVR32 architecture. * The semid64_ds structure for AVR32 architecture.
...@@ -22,4 +22,4 @@ struct semid64_ds { ...@@ -22,4 +22,4 @@ struct semid64_ds {
unsigned long __unused4; unsigned long __unused4;
}; };
#endif /* __ASM_AVR32_SEMBUF_H */ #endif /* _UAPI__ASM_AVR32_SEMBUF_H */
...@@ -13,5 +13,4 @@ ...@@ -13,5 +13,4 @@
#define COMMAND_LINE_SIZE 256 #define COMMAND_LINE_SIZE 256
#endif /* _UAPI__ASM_AVR32_SETUP_H__ */ #endif /* _UAPI__ASM_AVR32_SETUP_H__ */
#ifndef __ASM_AVR32_SHMBUF_H #ifndef _UAPI__ASM_AVR32_SHMBUF_H
#define __ASM_AVR32_SHMBUF_H #define _UAPI__ASM_AVR32_SHMBUF_H
/* /*
* The shmid64_ds structure for i386 architecture. * The shmid64_ds structure for i386 architecture.
...@@ -39,4 +39,4 @@ struct shminfo64 { ...@@ -39,4 +39,4 @@ struct shminfo64 {
unsigned long __unused4; unsigned long __unused4;
}; };
#endif /* __ASM_AVR32_SHMBUF_H */ #endif /* _UAPI__ASM_AVR32_SHMBUF_H */
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#ifndef __ASM_AVR32_SIGCONTEXT_H #ifndef _UAPI__ASM_AVR32_SIGCONTEXT_H
#define __ASM_AVR32_SIGCONTEXT_H #define _UAPI__ASM_AVR32_SIGCONTEXT_H
struct sigcontext { struct sigcontext {
unsigned long oldmask; unsigned long oldmask;
...@@ -31,4 +31,4 @@ struct sigcontext { ...@@ -31,4 +31,4 @@ struct sigcontext {
unsigned long r0; unsigned long r0;
}; };
#endif /* __ASM_AVR32_SIGCONTEXT_H */ #endif /* _UAPI__ASM_AVR32_SIGCONTEXT_H */
#ifndef _AVR32_SIGINFO_H
#define _AVR32_SIGINFO_H
#include <asm-generic/siginfo.h>
#endif
...@@ -118,5 +118,4 @@ typedef struct sigaltstack { ...@@ -118,5 +118,4 @@ typedef struct sigaltstack {
size_t ss_size; size_t ss_size;
} stack_t; } stack_t;
#endif /* _UAPI__ASM_AVR32_SIGNAL_H */ #endif /* _UAPI__ASM_AVR32_SIGNAL_H */
#ifndef __ASM_AVR32_SOCKET_H #ifndef _UAPI__ASM_AVR32_SOCKET_H
#define __ASM_AVR32_SOCKET_H #define _UAPI__ASM_AVR32_SOCKET_H
#include <asm/sockios.h> #include <asm/sockios.h>
...@@ -78,4 +78,4 @@ ...@@ -78,4 +78,4 @@
#define SO_MAX_PACING_RATE 47 #define SO_MAX_PACING_RATE 47
#endif /* __ASM_AVR32_SOCKET_H */ #endif /* _UAPI__ASM_AVR32_SOCKET_H */
#ifndef __ASM_AVR32_SOCKIOS_H #ifndef _UAPI__ASM_AVR32_SOCKIOS_H
#define __ASM_AVR32_SOCKIOS_H #define _UAPI__ASM_AVR32_SOCKIOS_H
/* Socket-level I/O control calls. */ /* Socket-level I/O control calls. */
#define FIOSETOWN 0x8901 #define FIOSETOWN 0x8901
...@@ -10,4 +10,4 @@ ...@@ -10,4 +10,4 @@
#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ #define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ #define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
#endif /* __ASM_AVR32_SOCKIOS_H */ #endif /* _UAPI__ASM_AVR32_SOCKIOS_H */
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#ifndef __ASM_AVR32_STAT_H #ifndef _UAPI__ASM_AVR32_STAT_H
#define __ASM_AVR32_STAT_H #define _UAPI__ASM_AVR32_STAT_H
struct __old_kernel_stat { struct __old_kernel_stat {
unsigned short st_dev; unsigned short st_dev;
...@@ -76,4 +76,4 @@ struct stat64 { ...@@ -76,4 +76,4 @@ struct stat64 {
unsigned long __unused2; unsigned long __unused2;
}; };
#endif /* __ASM_AVR32_STAT_H */ #endif /* _UAPI__ASM_AVR32_STAT_H */
#ifndef __ASM_AVR32_STATFS_H
#define __ASM_AVR32_STATFS_H
#include <asm-generic/statfs.h>
#endif /* __ASM_AVR32_STATFS_H */
/* /*
* AVR32 byteswapping functions. * AVR32 byteswapping functions.
*/ */
#ifndef __ASM_AVR32_SWAB_H #ifndef _UAPI__ASM_AVR32_SWAB_H
#define __ASM_AVR32_SWAB_H #define _UAPI__ASM_AVR32_SWAB_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/compiler.h> #include <linux/compiler.h>
...@@ -32,4 +32,4 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 val) ...@@ -32,4 +32,4 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
#define __arch_swab32 __arch_swab32 #define __arch_swab32 __arch_swab32
#endif #endif
#endif /* __ASM_AVR32_SWAB_H */ #endif /* _UAPI__ASM_AVR32_SWAB_H */
#ifndef __ASM_AVR32_TERMBITS_H #ifndef _UAPI__ASM_AVR32_TERMBITS_H
#define __ASM_AVR32_TERMBITS_H #define _UAPI__ASM_AVR32_TERMBITS_H
#include <linux/posix_types.h> #include <linux/posix_types.h>
...@@ -193,4 +193,4 @@ struct ktermios { ...@@ -193,4 +193,4 @@ struct ktermios {
#define TCSADRAIN 1 #define TCSADRAIN 1
#define TCSAFLUSH 2 #define TCSAFLUSH 2
#endif /* __ASM_AVR32_TERMBITS_H */ #endif /* _UAPI__ASM_AVR32_TERMBITS_H */
...@@ -46,5 +46,4 @@ struct termio { ...@@ -46,5 +46,4 @@ struct termio {
/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
#endif /* _UAPI__ASM_AVR32_TERMIOS_H */ #endif /* _UAPI__ASM_AVR32_TERMIOS_H */
...@@ -5,4 +5,9 @@ ...@@ -5,4 +5,9 @@
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#ifndef _UAPI__ASM_AVR32_TYPES_H
#define _UAPI__ASM_AVR32_TYPES_H
#include <asm-generic/int-ll64.h> #include <asm-generic/int-ll64.h>
#endif /* _UAPI__ASM_AVR32_TYPES_H */
...@@ -301,5 +301,4 @@ ...@@ -301,5 +301,4 @@
#define __NR_eventfd 281 #define __NR_eventfd 281
#define __NR_setns 283 #define __NR_setns 283
#endif /* _UAPI__ASM_AVR32_UNISTD_H */ #endif /* _UAPI__ASM_AVR32_UNISTD_H */
...@@ -401,9 +401,10 @@ handle_critical: ...@@ -401,9 +401,10 @@ handle_critical:
/* We should never get here... */ /* We should never get here... */
bad_return: bad_return:
sub r12, pc, (. - 1f) sub r12, pc, (. - 1f)
bral panic lddpc pc, 2f
.align 2 .align 2
1: .asciz "Return from critical exception!" 1: .asciz "Return from critical exception!"
2: .long panic
.align 1 .align 1
do_bus_error_write: do_bus_error_write:
......
...@@ -10,33 +10,13 @@ ...@@ -10,33 +10,13 @@
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/thread_info.h>
#include <asm/sysreg.h>
.section .init.text,"ax" .section .init.text,"ax"
.global kernel_entry .global kernel_entry
kernel_entry: kernel_entry:
/* Initialize status register */
lddpc r0, init_sr
mtsr SYSREG_SR, r0
/* Set initial stack pointer */
lddpc sp, stack_addr
sub sp, -THREAD_SIZE
#ifdef CONFIG_FRAME_POINTER
/* Mark last stack frame */
mov lr, 0
mov r7, 0
#endif
/* Start the show */ /* Start the show */
lddpc pc, kernel_start_addr lddpc pc, kernel_start_addr
.align 2 .align 2
init_sr:
.long 0x007f0000 /* Supervisor mode, everything masked */
stack_addr:
.long init_thread_union
kernel_start_addr: kernel_start_addr:
.long start_kernel .long start_kernel
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment