Skip to content

Commit

Permalink
ARC: Fixes to enable building with 3.5 tip
Browse files Browse the repository at this point in the history
-Nuke TIF_FREEZE
-Nuke PTRACE_O_TRACESYSGOOD
-Add __kernel_long_t, __kernel_ulong_t

-Use sigsuspend() helper in sys_{rt_}sigsuspend
 (68f3f16, "new helper: sigsuspend()")

-Use set_current_blocked()/block_sigmask() helpers
 (7ebe0c5, "frv: use set_current_blocked() and block_sigmask()")

-Use signal_delivered() instead of block_sigmask()
(efee984, "new helper: signal_delivered()")

-tick_nohz_{stop,restart}_sched_tick => tick_nohz_idle_{enter,exit}
 (280f067, "nohz: Separate out irq exit and idle loop dyntick logic")

-Nuke init_task.c
 (a4a2eb4, "init_task: Create generic init_task instance")

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
  • Loading branch information
vineetgarc committed Jun 13, 2012
1 parent f96a2fa commit cd85753
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 65 deletions.
2 changes: 1 addition & 1 deletion arch/arc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ KBUILD_LDFLAGS += $(ldflags-y)
# Needed for Linker script preprocessing
KBUILD_CPPFLAGS += -Iarch/arc/plat-$(PLATFORM)/include

head-y := arch/arc/kernel/head.o arch/arc/kernel/init_task.o
head-y := arch/arc/kernel/head.o

# See arch/arc/Kbuild for content of core part of the kernel
core-y += arch/arc/
Expand Down
2 changes: 2 additions & 0 deletions arch/arc/include/asm/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#define _ASM_ARC_POSIX_TYPES_H

/* XXX: Subtle differences in asm-generic ver - need to chk before switch */
typedef long __kernel_long_t;
typedef unsigned long __kernel_ulong_t;
typedef unsigned long __kernel_ino_t;
typedef unsigned short __kernel_mode_t;
typedef unsigned short __kernel_nlink_t;
Expand Down
2 changes: 0 additions & 2 deletions arch/arc/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ struct callee_regs {
#define PTRACE_GETFPREGS 14
#define PTRACE_SETFPREGS 15

#define PTRACE_O_TRACESYSGOOD 0x00000001

#define instruction_pointer(regs) ((regs)->ret)
#define profile_pc(regs) instruction_pointer(regs)

Expand Down
2 changes: 0 additions & 2 deletions arch/arc/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ static inline __attribute_const__ struct thread_info *current_thread_info(void)
/* true if poll_idle() is polling TIF_NEED_RESCHED */
#define TIF_POLLING_NRFLAG 17
#define TIF_MEMDIE 18
#define TIF_FREEZE 19
#define TIF_SYSCALL_TRACE 31 /* syscall trace active */

#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
Expand All @@ -112,7 +111,6 @@ static inline __attribute_const__ struct thread_info *current_thread_info(void)
#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
#define _TIF_USEDFPU (1<<TIF_USEDFPU)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
#define _TIF_FREEZE (1<<TIF_FREEZE)

/* work to do on interrupt/exception return */
#define _TIF_WORK_MASK (0x0000ffef & ~_TIF_SECCOMP)
Expand Down
2 changes: 1 addition & 1 deletion arch/arc/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ else
obj-y += ctx_sw_asm.o
endif

extra-y := init_task.o vmlinux.lds head.o
extra-y := vmlinux.lds head.o
33 changes: 0 additions & 33 deletions arch/arc/kernel/init_task.c

This file was deleted.

4 changes: 2 additions & 2 deletions arch/arc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void cpu_idle(void)

/* endless idle loop with no priority at all */
while (1) {
tick_nohz_stop_sched_tick(1);
tick_nohz_idle_enter();

/* Test the need-resced "flag" of current task "idle"
A local ISR or peer CPU may want resched
Expand All @@ -85,7 +85,7 @@ void cpu_idle(void)
while (!need_resched())
arch_idle();

tick_nohz_restart_sched_tick();
tick_nohz_idle_exit();

preempt_enable_no_resched();
schedule();
Expand Down
29 changes: 5 additions & 24 deletions arch/arc/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,9 @@ static noinline void set_frame_exec(unsigned long vaddr, unsigned int exec_on);
asmlinkage int sys_sigsuspend(int restart, unsigned long oldmask,
old_sigset_t mask)
{
sigset_t saveset;

mask &= _BLOCKABLE;
spin_lock_irq(&current->sighand->siglock);
saveset = current->blocked;
siginitset(&current->blocked, mask);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);

current->state = TASK_INTERRUPTIBLE;
schedule();
set_thread_flag(TIF_RESTORE_SIGMASK);
return -ERESTARTNOHAND;
sigset_t blocked;
siginitset(&blocked, mask);
return sigsuspend(&blocked);
}

asmlinkage int
Expand Down Expand Up @@ -169,10 +159,7 @@ static int restore_sigframe(struct pt_regs *regs, struct sigframe __user *sf)
err = __copy_from_user(&set, &sf->uc.uc_sigmask, sizeof(set));
if (err == 0) {
sigdelsetmask(&set, ~_BLOCKABLE);
spin_lock_irq(&current->sighand->siglock);
current->blocked = set;
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
set_current_blocked(&set);
}

{
Expand Down Expand Up @@ -553,13 +540,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
return ret;
}

/* Block the signal if we are successful */
spin_lock_irq(&current->sighand->siglock);
sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
if (!(ka->sa.sa_flags & SA_NODEFER))
sigaddset(&current->blocked, sig);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
signal_delivered(sig, info, ka, regs, 0);

return ret;
}
Expand Down

0 comments on commit cd85753

Please sign in to comment.