patch-2.4.19 linux-2.4.19/include/asm-s390/processor.h
Next file: linux-2.4.19/include/asm-s390/ptrace.h
Previous file: linux-2.4.19/include/asm-s390/pgtable.h
Back to the patch index
Back to the overall index
- Lines: 100
- Date:
Fri Aug 2 17:39:45 2002
- Orig file:
linux-2.4.18/include/asm-s390/processor.h
- Orig date:
Mon Feb 25 11:38:13 2002
diff -urN linux-2.4.18/include/asm-s390/processor.h linux-2.4.19/include/asm-s390/processor.h
@@ -16,6 +16,7 @@
#include <asm/page.h>
#include <asm/ptrace.h>
+#ifdef __KERNEL__
/*
* Default implementation of macro that returns current
* instruction pointer ("program counter").
@@ -64,8 +65,7 @@
#define THREAD_SIZE (2*PAGE_SIZE)
typedef struct {
- unsigned long seg;
- unsigned long acc4;
+ unsigned long ar4;
} mm_segment_t;
/* if you change the thread_struct structure, you must
@@ -82,8 +82,6 @@
__u32 error_code; /* error-code of last prog-excep. */
__u32 prot_addr; /* address of protection-excep. */
__u32 trap_no;
- /* perform syscall argument validation (get/set_fs) */
- mm_segment_t fs;
per_struct per_info;/* Must be aligned on an 4 byte boundary*/
/* Used to give failing instruction back to user for ieee exceptions */
addr_t ieee_instruction_pointer;
@@ -99,7 +97,6 @@
sizeof(init_stack) + (__u32) &init_stack, \
(__pa((__u32) &swapper_pg_dir[0]) + _SEGMENT_TABLE),\
0,0,0, \
- (mm_segment_t) { 0,1}, \
(per_struct) {{{{0,}}},0,0,0,0,{{0,}}}, \
0, 0 \
}
@@ -138,8 +135,8 @@
}
unsigned long get_wchan(struct task_struct *p);
-#define __KSTK_PTREGS(tsk) \
- ((struct pt_regs *)((unsigned long) tsk+THREAD_SIZE) - 1)
+#define __KSTK_PTREGS(tsk) ((struct pt_regs *) \
+ (((unsigned long) tsk + THREAD_SIZE - sizeof(struct pt_regs)) & -8L))
#define KSTK_EIP(tsk) (__KSTK_PTREGS(tsk)->psw.addr)
#define KSTK_ESP(tsk) (__KSTK_PTREGS(tsk)->gprs[15])
@@ -171,6 +168,46 @@
#define PSW_PROBLEM_STATE 0x00010000UL
/*
+ * Set PSW mask to specified value, while leaving the
+ * PSW addr pointing to the next instruction.
+ */
+
+static inline void __load_psw_mask (unsigned long mask)
+{
+ unsigned long addr;
+
+ psw_t psw;
+ psw.mask = mask;
+
+ asm volatile (
+ " basr %0,0\n"
+ "0: ahi %0,1f-0b\n"
+ " st %0,4(%1)\n"
+ " lpsw 0(%1)\n"
+ "1:"
+ : "=&d" (addr) : "a" (&psw) : "memory", "cc" );
+}
+
+/*
+ * Function to stop a processor until an interruption occured
+ */
+static inline void enabled_wait(void)
+{
+ unsigned long reg;
+ psw_t wait_psw;
+
+ wait_psw.mask = 0x070e0000;
+ asm volatile (
+ " basr %0,0\n"
+ "0: la %0,1f-0b(%0)\n"
+ " st %0,4(%1)\n"
+ " oi 4(%1),0x80\n"
+ " lpsw 0(%1)\n"
+ "1:"
+ : "=&a" (reg) : "a" (&wait_psw) : "memory", "cc" );
+}
+
+/*
* Function to drop a processor into disabled wait state
*/
@@ -206,4 +243,6 @@
: : "a" (dw_psw), "a" (&ctl_buf) : "cc" );
}
+#endif
+
#endif /* __ASM_S390_PROCESSOR_H */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)