Commit 7e742256 authored by David Mosberger's avatar David Mosberger Committed by Tony Luck

[IA64] cleanup C uage of global/root-function predicates

 
The patch below is purely a cleanup but it's a prerequisite for the
next bug fix patch.
Signed-off-by: default avatarDavid Mosberger-Tang <davidm@hpl.hp.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent d6b8181a
#include <linux/config.h> #include <linux/config.h>
/* /*
* Preserved registers that are shared between code in ivt.S and entry.S. Be * Preserved registers that are shared between code in ivt.S and
* careful not to step on these! * entry.S. Be careful not to step on these!
*/ */
#define pLvSys p1 /* set 1 if leave from syscall; otherwise, set 0 */ #define PRED_LEAVE_SYSCALL 1 /* TRUE iff leave from syscall */
#define pKStk p2 /* will leave_{kernel,syscall} return to kernel-stacks? */ #define PRED_KERNEL_STACK 2 /* returning to kernel-stacks? */
#define pUStk p3 /* will leave_{kernel,syscall} return to user-stacks? */ #define PRED_USER_STACK 3 /* returning to user-stacks? */
#define pSys p4 /* are we processing a (synchronous) system call? */ #define PRED_SYSCALL 4 /* inside a system call? */
#define pNonSys p5 /* complement of pSys */ #define PRED_NON_SYSCALL 5 /* complement of PRED_SYSCALL */
#ifdef __ASSEMBLY__
# define PASTE2(x,y) x##y
# define PASTE(x,y) PASTE2(x,y)
# define pLvSys PASTE(p,PRED_LEAVE_SYSCALL)
# define pKStk PASTE(p,PRED_KERNEL_STACK)
# define pUStk PASTE(p,PRED_USER_STACK)
# define pSys PASTE(p,PRED_SYSCALL)
# define pNonSys PASTE(p,PRED_NON_SYSCALL)
#endif
#define PT(f) (IA64_PT_REGS_##f##_OFFSET) #define PT(f) (IA64_PT_REGS_##f##_OFFSET)
#define SW(f) (IA64_SWITCH_STACK_##f##_OFFSET) #define SW(f) (IA64_SWITCH_STACK_##f##_OFFSET)
......
...@@ -31,9 +31,6 @@ ...@@ -31,9 +31,6 @@
#include "entry.h" #include "entry.h"
#define p4 (1UL << 4) /* for pSys (see entry.h) */
#define p5 (1UL << 5) /* for pNonSys (see entry.h) */
/* /*
* Bits in the PSR that we allow ptrace() to change: * Bits in the PSR that we allow ptrace() to change:
* be, up, ac, mfl, mfh (the user mask; five bits total) * be, up, ac, mfl, mfh (the user mask; five bits total)
...@@ -669,8 +666,8 @@ convert_to_non_syscall (struct task_struct *child, struct pt_regs *pt, unsigned ...@@ -669,8 +666,8 @@ convert_to_non_syscall (struct task_struct *child, struct pt_regs *pt, unsigned
} }
unw_get_pr(&prev_info, &pr); unw_get_pr(&prev_info, &pr);
pr &= ~pSys; pr &= ~(1UL << PRED_SYSCALL);
pr |= pNonSys; pr |= (1UL << PRED_NON_SYSCALL);
unw_set_pr(&prev_info, pr); unw_set_pr(&prev_info, pr);
pt->cr_ifs = (1UL << 63) | cfm; pt->cr_ifs = (1UL << 63) | cfm;
......
...@@ -47,8 +47,6 @@ ...@@ -47,8 +47,6 @@
#include "entry.h" #include "entry.h"
#include "unwind_i.h" #include "unwind_i.h"
#define p5 5
#define UNW_LOG_CACHE_SIZE 7 /* each unw_script is ~256 bytes in size */ #define UNW_LOG_CACHE_SIZE 7 /* each unw_script is ~256 bytes in size */
#define UNW_CACHE_SIZE (1 << UNW_LOG_CACHE_SIZE) #define UNW_CACHE_SIZE (1 << UNW_LOG_CACHE_SIZE)
...@@ -1899,7 +1897,7 @@ unw_unwind (struct unw_frame_info *info) ...@@ -1899,7 +1897,7 @@ unw_unwind (struct unw_frame_info *info)
num_regs = 0; num_regs = 0;
if ((info->flags & UNW_FLAG_INTERRUPT_FRAME)) { if ((info->flags & UNW_FLAG_INTERRUPT_FRAME)) {
info->pt = info->sp + 16; info->pt = info->sp + 16;
if ((pr & (1UL << pNonSys)) != 0) if ((pr & (1UL << PRED_NON_SYSCALL)) != 0)
num_regs = *info->cfm_loc & 0x7f; /* size of frame */ num_regs = *info->cfm_loc & 0x7f; /* size of frame */
info->pfs_loc = info->pfs_loc =
(unsigned long *) (info->pt + offsetof(struct pt_regs, ar_pfs)); (unsigned long *) (info->pt + offsetof(struct pt_regs, ar_pfs));
......
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