Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 119357
b: refs/heads/master
c: 59da213
h: refs/heads/master
i:
  119355: 77e73eb
v: v3
  • Loading branch information
Martin Schwidefsky committed Nov 27, 2008
1 parent fdef07b commit 96e30e2
Show file tree
Hide file tree
Showing 94 changed files with 763 additions and 767 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 95c5e1f1e6e1788cc8b9acbe9379ae395ef64958
refs/heads/master: 59da21398e680e8100625d689c8bebee6a139e93
3 changes: 1 addition & 2 deletions trunk/Documentation/input/input-programming.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ pressed or released a BUTTON_IRQ happens. The driver could look like:

static struct input_dev *button_dev;

static irqreturn_t button_interrupt(int irq, void *dummy)
static void button_interrupt(int irq, void *dummy, struct pt_regs *fp)
{
input_report_key(button_dev, BTN_0, inb(BUTTON_PORT) & 1);
input_sync(button_dev);
return IRQ_HANDLED;
}

static int __init button_init(void)
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ config HAVE_KRETPROBES
# task_pt_regs() in asm/processor.h or asm/ptrace.h
# arch_has_single_step() if there is hardware single-step support
# arch_has_block_step() if there is hardware block-step support
# arch_ptrace() and not #define __ARCH_SYS_PTRACE
# compat_arch_ptrace() and #define __ARCH_WANT_COMPAT_SYS_PTRACE
# asm/syscall.h supplying asm-generic/syscall.h interface
# linux/regset.h user_regset interfaces
# CORE_DUMP_USE_REGSET #define'd in linux/elf.h
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/alpha/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ common_swizzle(struct pci_dev *dev, u8 *pinp)
return PCI_SLOT(dev->devfn);
}

void
void __devinit
pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
struct resource *res)
{
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/alpha/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ wait_boot_cpu_to_stop(int cpuid)
/*
* Where secondaries begin a life of C.
*/
void __cpuinit
void __init
smp_callin(void)
{
int cpuid = hard_smp_processor_id();
Expand Down Expand Up @@ -198,7 +198,7 @@ wait_for_txrdy (unsigned long cpumask)
* Send a message to a secondary's console. "START" is one such
* interesting message. ;-)
*/
static void __cpuinit
static void __init
send_secondary_console_msg(char *str, int cpuid)
{
struct percpu_struct *cpu;
Expand Down Expand Up @@ -289,7 +289,7 @@ recv_secondary_console_msg(void)
/*
* Convince the console to have a secondary cpu begin execution.
*/
static int __cpuinit
static int __init
secondary_cpu_start(int cpuid, struct task_struct *idle)
{
struct percpu_struct *cpu;
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/alpha/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

static int opDEC_fix;

static void __cpuinit
static void __init
opDEC_check(void)
{
__asm__ __volatile__ (
Expand Down Expand Up @@ -1072,7 +1072,7 @@ do_entUnaUser(void __user * va, unsigned long opcode,
return;
}

void __cpuinit
void __init
trap_init(void)
{
/* Tell PAL-code what global pointer we want in the kernel. */
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/ia64/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ static inline unsigned long user_stack_pointer(struct pt_regs *regs)
#define arch_has_block_step() (1)
extern void user_enable_block_step(struct task_struct *);

#define __ARCH_WANT_COMPAT_SYS_PTRACE

#endif /* !__KERNEL__ */

/* pt_all_user_regs is used for PTRACE_GETREGS PTRACE_SETREGS */
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/ia64/sn/kernel/io_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ EXPORT_SYMBOL(sn_io_slot_fixup);
* sn_pci_controller_fixup() - This routine sets up a bus's resources
* consistent with the Linux PCI abstraction layer.
*/
static void __init
static void
sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
{
s64 status = 0;
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/m32r/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ __INITDATA
/*
* References to members of the boot_cpu_data structure.
*/
.section .text.head, "ax"
.text
.global start_kernel
.global __bss_start
.global _end
Expand Down Expand Up @@ -133,6 +133,7 @@ loop1:
/*
* AP startup routine
*/
.text
.global eit_vector
ENTRY(startup_AP)
;; setup EVB
Expand Down Expand Up @@ -229,7 +230,6 @@ ENTRY(startup_AP)
nop
#endif /* CONFIG_SMP */

.text
ENTRY(stack_start)
.long init_thread_union+8192
.long __KERNEL_DS
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/m32r/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ SECTIONS
_text = .; /* Text and read-only data */
.boot : { *(.boot) } = 0
.text : {
*(.text.head)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
Expand Down
29 changes: 9 additions & 20 deletions trunk/arch/mips/include/asm/bug.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,20 @@

#include <asm/break.h>

static inline void __noreturn BUG(void)
{
__asm__ __volatile__("break %0" : : "i" (BRK_BUG));
/* Fool GCC into thinking the function doesn't return. */
while (1)
;
}
#define BUG() \
do { \
__asm__ __volatile__("break %0" : : "i" (BRK_BUG)); \
} while (0)

#define HAVE_ARCH_BUG

#if (_MIPS_ISA > _MIPS_ISA_MIPS1)

static inline void __BUG_ON(unsigned long condition)
{
if (__builtin_constant_p(condition)) {
if (condition)
BUG();
else
return;
}
__asm__ __volatile__("tne $0, %0, %1"
: : "r" (condition), "i" (BRK_BUG));
}

#define BUG_ON(C) __BUG_ON((unsigned long)(C))
#define BUG_ON(condition) \
do { \
__asm__ __volatile__("tne $0, %0, %1" \
: : "r" (condition), "i" (BRK_BUG)); \
} while (0)

#define HAVE_ARCH_BUG_ON

Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/mips/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#ifndef _ASM_PTRACE_H
#define _ASM_PTRACE_H

#ifdef CONFIG_64BIT
#define __ARCH_WANT_COMPAT_SYS_PTRACE
#endif

/* 0 - 31 are integer registers, 32 - 63 are fp registers. */
#define FPR_BASE 32
#define PC 64
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/parisc/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ struct pt_regs {

#define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS))

#define __ARCH_WANT_COMPAT_SYS_PTRACE

struct task_struct;
#define arch_has_single_step() 1
void user_disable_single_step(struct task_struct *task);
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/powerpc/include/asm/mmu-hash64.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ extern int hash_huge_page(struct mm_struct *mm, unsigned long access,
extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
unsigned long pstart, unsigned long prot,
int psize, int ssize);
extern void set_huge_psize(int psize);
extern void add_gpage(unsigned long addr, unsigned long page_size,
unsigned long number_of_pages);
extern void demote_segment_4k(struct mm_struct *mm, unsigned long addr);
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/powerpc/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ struct pt_regs {

#ifdef __powerpc64__

#define __ARCH_WANT_COMPAT_SYS_PTRACE

#define STACK_FRAME_OVERHEAD 112 /* size of minimum stack frame */
#define STACK_FRAME_LR_SAVE 2 /* Location of LR in stack frame */
#define STACK_FRAME_REGS_MARKER ASM_CONST(0x7265677368657265)
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/mm/hugetlbpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access,
return err;
}

static void __init set_huge_psize(int psize)
void set_huge_psize(int psize)
{
/* Check that it is a page size supported by the hardware and
* that it fits within pagetable limits. */
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/s390/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ struct pt_regs
psw_t psw;
unsigned long gprs[NUM_GPRS];
unsigned long orig_gpr2;
unsigned short svcnr;
unsigned short ilc;
unsigned short trap;
};
#endif

Expand Down Expand Up @@ -486,6 +486,8 @@ struct task_struct;
extern void user_enable_single_step(struct task_struct *);
extern void user_disable_single_step(struct task_struct *);

#define __ARCH_WANT_COMPAT_SYS_PTRACE

#define user_mode(regs) (((regs)->psw.mask & PSW_MASK_PSTATE) != 0)
#define instruction_pointer(regs) ((regs)->psw.addr & PSW_ADDR_INSN)
#define user_stack_pointer(regs)((regs)->gprs[15])
Expand Down
28 changes: 16 additions & 12 deletions trunk/arch/s390/include/asm/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
static inline long syscall_get_nr(struct task_struct *task,
struct pt_regs *regs)
{
if (regs->trap != __LC_SVC_OLD_PSW)
return -1;
return regs->gprs[2];
return regs->svcnr ? regs->svcnr : -1;
}

static inline void syscall_rollback(struct task_struct *task,
Expand Down Expand Up @@ -52,18 +50,20 @@ static inline void syscall_get_arguments(struct task_struct *task,
unsigned int i, unsigned int n,
unsigned long *args)
{
unsigned long mask = -1UL;

BUG_ON(i + n > 6);
#ifdef CONFIG_COMPAT
if (test_tsk_thread_flag(task, TIF_31BIT)) {
if (i + n == 6)
args[--n] = (u32) regs->args[0];
while (n-- > 0)
args[n] = (u32) regs->gprs[2 + i + n];
}
if (test_tsk_thread_flag(task, TIF_31BIT))
mask = 0xffffffff;
#endif
if (i + n == 6)
args[--n] = regs->args[0];
memcpy(args, &regs->gprs[2 + i], n * sizeof(args[0]));
args[--n] = regs->args[0] & mask;
while (n-- > 0)
if (i + n > 0)
args[n] = regs->gprs[2 + i + n] & mask;
if (i == 0)
args[0] = regs->orig_gpr2 & mask;
}

static inline void syscall_set_arguments(struct task_struct *task,
Expand All @@ -74,7 +74,11 @@ static inline void syscall_set_arguments(struct task_struct *task,
BUG_ON(i + n > 6);
if (i + n == 6)
regs->args[0] = args[--n];
memcpy(&regs->gprs[2 + i], args, n * sizeof(args[0]));
while (n-- > 0)
if (i + n > 0)
regs->gprs[2 + i + n] = args[n];
if (i == 0)
regs->orig_gpr2 = args[0];
}

#endif /* _ASM_SYSCALL_H */
2 changes: 1 addition & 1 deletion trunk/arch/s390/kernel/asm-offsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int main(void)
DEFINE(__PT_GPRS, offsetof(struct pt_regs, gprs));
DEFINE(__PT_ORIG_GPR2, offsetof(struct pt_regs, orig_gpr2));
DEFINE(__PT_ILC, offsetof(struct pt_regs, ilc));
DEFINE(__PT_TRAP, offsetof(struct pt_regs, trap));
DEFINE(__PT_SVCNR, offsetof(struct pt_regs, svcnr));
DEFINE(__PT_SIZE, sizeof(struct pt_regs));
BLANK();
DEFINE(__SF_BACKCHAIN, offsetof(struct stack_frame, back_chain));
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/s390/kernel/compat_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs)
return err;

restore_fp_regs(&current->thread.fp_regs);
regs->trap = -1; /* disable syscall checks */
regs->svcnr = 0; /* disable syscall checks */
return 0;
}

Expand Down
21 changes: 11 additions & 10 deletions trunk/arch/s390/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ SP_R14 = STACK_FRAME_OVERHEAD + __PT_GPRS + 56
SP_R15 = STACK_FRAME_OVERHEAD + __PT_GPRS + 60
SP_ORIG_R2 = STACK_FRAME_OVERHEAD + __PT_ORIG_GPR2
SP_ILC = STACK_FRAME_OVERHEAD + __PT_ILC
SP_TRAP = STACK_FRAME_OVERHEAD + __PT_TRAP
SP_SVCNR = STACK_FRAME_OVERHEAD + __PT_SVCNR
SP_SIZE = STACK_FRAME_OVERHEAD + __PT_SIZE

_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \
Expand Down Expand Up @@ -183,11 +183,10 @@ STACK_SIZE = 1 << STACK_SHIFT
.macro CREATE_STACK_FRAME psworg,savearea
s %r15,BASED(.Lc_spsize) # make room for registers & psw
mvc SP_PSW(8,%r15),0(%r12) # move user PSW to stack
la %r12,\psworg
st %r2,SP_ORIG_R2(%r15) # store original content of gpr 2
icm %r12,12,__LC_SVC_ILC
icm %r12,3,__LC_SVC_ILC
stm %r0,%r11,SP_R0(%r15) # store gprs %r0-%r11 to kernel stack
st %r12,SP_ILC(%r15)
st %r12,SP_SVCNR(%r15)
mvc SP_R12(16,%r15),\savearea # move %r12-%r15 to stack
la %r12,0
st %r12,__SF_BACKCHAIN(%r15) # clear back chain
Expand Down Expand Up @@ -264,16 +263,17 @@ sysc_update:
#endif
sysc_do_svc:
l %r9,__LC_THREAD_INFO # load pointer to thread_info struct
sla %r7,2 # *4 and test for svc 0
ltr %r7,%r7 # test for svc 0
bnz BASED(sysc_nr_ok) # svc number > 0
# svc 0: system call number in %r1
cl %r1,BASED(.Lnr_syscalls)
bnl BASED(sysc_nr_ok)
lr %r7,%r1 # copy svc number to %r7
sla %r7,2 # *4
sysc_nr_ok:
mvc SP_ARGS(4,%r15),SP_R7(%r15)
sysc_do_restart:
sth %r7,SP_SVCNR(%r15)
sll %r7,2 # svc number *4
l %r8,BASED(.Lsysc_table)
tm __TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
l %r8,0(%r7,%r8) # get system call addr.
Expand Down Expand Up @@ -376,7 +376,6 @@ sysc_notify_resume:
sysc_restart:
ni __TI_flags+3(%r9),255-_TIF_RESTART_SVC # clear TIF_RESTART_SVC
l %r7,SP_R2(%r15) # load new svc number
sla %r7,2
mvc SP_R2(4,%r15),SP_ORIG_R2(%r15) # restore first argument
lm %r2,%r6,SP_R2(%r15) # load svc arguments
b BASED(sysc_do_restart) # restart svc
Expand All @@ -386,7 +385,8 @@ sysc_restart:
#
sysc_singlestep:
ni __TI_flags+3(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP
mvi SP_TRAP+1(%r15),0x28 # set trap indication to pgm check
mvi SP_SVCNR(%r15),0xff # set trap indication to pgm check
mvi SP_SVCNR+1(%r15),0xff
la %r2,SP_PTREGS(%r15) # address of register-save area
l %r1,BASED(.Lhandle_per) # load adr. of per handler
la %r14,BASED(sysc_return) # load adr. of system return
Expand All @@ -407,7 +407,7 @@ sysc_tracesys:
bnl BASED(sysc_tracenogo)
l %r8,BASED(.Lsysc_table)
lr %r7,%r2
sll %r7,2 # *4
sll %r7,2 # svc number *4
l %r8,0(%r7,%r8)
sysc_tracego:
lm %r3,%r6,SP_R3(%r15)
Expand Down Expand Up @@ -586,7 +586,8 @@ pgm_svcper:
# per was called from kernel, must be kprobes
#
kernel_per:
mvi SP_TRAP+1(%r15),0x28 # set trap indication to pgm check
mvi SP_SVCNR(%r15),0xff # set trap indication to pgm check
mvi SP_SVCNR+1(%r15),0xff
la %r2,SP_PTREGS(%r15) # address of register-save area
l %r1,BASED(.Lhandle_per) # load adr. of per handler
la %r14,BASED(sysc_restore)# load adr. of system return
Expand Down
Loading

0 comments on commit 96e30e2

Please sign in to comment.