Commit 358e377e authored by David Mosberger's avatar David Mosberger

ia64: Initial sync with 2.5.67.

parent f066bc3b
...@@ -114,6 +114,7 @@ copy_siginfo_from_user32 (siginfo_t *to, siginfo_t32 *from) ...@@ -114,6 +114,7 @@ copy_siginfo_from_user32 (siginfo_t *to, siginfo_t32 *from)
int int
copy_siginfo_to_user32 (siginfo_t32 *to, siginfo_t *from) copy_siginfo_to_user32 (siginfo_t32 *to, siginfo_t *from)
{ {
unsigned int addr;
int err; int err;
if (!access_ok(VERIFY_WRITE, to, sizeof(siginfo_t32))) if (!access_ok(VERIFY_WRITE, to, sizeof(siginfo_t32)))
...@@ -151,7 +152,8 @@ copy_siginfo_to_user32 (siginfo_t32 *to, siginfo_t *from) ...@@ -151,7 +152,8 @@ copy_siginfo_to_user32 (siginfo_t32 *to, siginfo_t *from)
case __SI_TIMER >> 16: case __SI_TIMER >> 16:
err |= __put_user(from->si_tid, &to->si_tid); err |= __put_user(from->si_tid, &to->si_tid);
err |= __put_user(from->si_overrun, &to->si_overrun); err |= __put_user(from->si_overrun, &to->si_overrun);
err |= __put_user(from->si_ptr, &to->si_ptr); /*XXX eric: not sure the size is correct because it contains pointer*/ addr = (unsigned long) from->si_ptr;
err |= __put_user(addr, &to->si_ptr);
break; break;
/* case __SI_RT: This is not generated by the kernel as of now. */ /* case __SI_RT: This is not generated by the kernel as of now. */
} }
......
...@@ -2261,7 +2261,7 @@ sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data, ...@@ -2261,7 +2261,7 @@ sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data,
} }
out_tsk: out_tsk:
free_task_struct(child); put_task_struct(child);
out: out:
unlock_kernel(); unlock_kernel();
return ret; return ret;
......
...@@ -194,6 +194,7 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re ...@@ -194,6 +194,7 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
up_read(&mm->mmap_sem); up_read(&mm->mmap_sem);
if (current->pid == 1) { if (current->pid == 1) {
yield(); yield();
down_read(&mm->mmap_sem);
goto survive; goto survive;
} }
printk(KERN_CRIT "VM: killing process %s\n", current->comm); printk(KERN_CRIT "VM: killing process %s\n", current->comm);
......
...@@ -27,6 +27,11 @@ typedef s32 compat_daddr_t; ...@@ -27,6 +27,11 @@ typedef s32 compat_daddr_t;
typedef u32 compat_caddr_t; typedef u32 compat_caddr_t;
typedef __kernel_fsid_t compat_fsid_t; typedef __kernel_fsid_t compat_fsid_t;
typedef s32 compat_int_t;
typedef s32 compat_long_t;
typedef u32 compat_uint_t;
typedef u32 compat_ulong_t;
struct compat_timespec { struct compat_timespec {
compat_time_t tv_sec; compat_time_t tv_sec;
s32 tv_nsec; s32 tv_nsec;
...@@ -108,16 +113,16 @@ typedef u32 compat_sigset_word; ...@@ -108,16 +113,16 @@ typedef u32 compat_sigset_word;
#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
/* /*
* A pointer passed in from user mode. This should not * A pointer passed in from user mode. This should not be used for syscall parameters,
* be used for syscall parameters, just declare them * just declare them as pointers because the syscall entry code will have appropriately
* as pointers because the syscall entry code will have * comverted them already.
* appropriately comverted them already.
*/ */
typedef u32 compat_uptr_t; typedef u32 compat_uptr_t;
static inline void *compat_ptr(compat_ptr_t uptr) static inline void *
compat_ptr (compat_uptr_t uptr)
{ {
return (void *)uptr; return (void *) (unsigned long) uptr;
} }
#endif /* _ASM_IA64_COMPAT_H */ #endif /* _ASM_IA64_COMPAT_H */
...@@ -59,6 +59,9 @@ ...@@ -59,6 +59,9 @@
#define _PAGE_ED (__IA64_UL(1) << 52) /* exception deferral */ #define _PAGE_ED (__IA64_UL(1) << 52) /* exception deferral */
#define _PAGE_PROTNONE (__IA64_UL(1) << 63) #define _PAGE_PROTNONE (__IA64_UL(1) << 63)
/* Valid only for a PTE with the present bit cleared: */
#define _PAGE_FILE (1 << 1) /* see swap & file pte remarks below */
#define _PFN_MASK _PAGE_PPN_MASK #define _PFN_MASK _PAGE_PPN_MASK
#define _PAGE_CHG_MASK (_PFN_MASK | _PAGE_A | _PAGE_D) #define _PAGE_CHG_MASK (_PFN_MASK | _PAGE_A | _PAGE_D)
...@@ -253,6 +256,7 @@ ia64_phys_addr_valid (unsigned long addr) ...@@ -253,6 +256,7 @@ ia64_phys_addr_valid (unsigned long addr)
#define pte_exec(pte) ((pte_val(pte) & _PAGE_AR_RX) != 0) #define pte_exec(pte) ((pte_val(pte) & _PAGE_AR_RX) != 0)
#define pte_dirty(pte) ((pte_val(pte) & _PAGE_D) != 0) #define pte_dirty(pte) ((pte_val(pte) & _PAGE_D) != 0)
#define pte_young(pte) ((pte_val(pte) & _PAGE_A) != 0) #define pte_young(pte) ((pte_val(pte) & _PAGE_A) != 0)
#define pte_file(pte) ((pte_val(pte) & _PAGE_FILE) != 0)
/* /*
* Note: we convert AR_RWX to AR_RX and AR_RW to AR_R by clearing the 2nd bit in the * Note: we convert AR_RWX to AR_RX and AR_RW to AR_R by clearing the 2nd bit in the
* access rights: * access rights:
...@@ -402,12 +406,35 @@ pte_same (pte_t a, pte_t b) ...@@ -402,12 +406,35 @@ pte_same (pte_t a, pte_t b)
extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
extern void paging_init (void); extern void paging_init (void);
#define __swp_type(entry) (((entry).val >> 1) & 0xff) /*
* Note: The macros below rely on the fact that MAX_SWAPFILES_SHIFT <= number of
* bits in the swap-type field of the swap pte. It would be nice to
* enforce that, but we can't easily include <linux/swap.h> here.
* (Of course, better still would be to define MAX_SWAPFILES_SHIFT here...).
*
* Format of swap pte:
* bit 0 : present bit (must be zero)
* bit 1 : _PAGE_FILE (must be zero)
* bits 2- 8: swap-type
* bits 9-62: swap offset
* bit 63 : _PAGE_PROTNONE bit
*
* Format of file pte:
* bit 0 : present bit (must be zero)
* bit 1 : _PAGE_FILE (must be one)
* bits 2-62: file_offset/PAGE_SIZE
* bit 63 : _PAGE_PROTNONE bit
*/
#define __swp_type(entry) (((entry).val >> 2) & 0x7f)
#define __swp_offset(entry) (((entry).val << 1) >> 10) #define __swp_offset(entry) (((entry).val << 1) >> 10)
#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << 1) | ((long) (offset) << 9) }) #define __swp_entry(type,offset) ((swp_entry_t) { ((type) << 2) | ((long) (offset) << 9) })
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) #define __swp_entry_to_pte(x) ((pte_t) { (x).val })
#define PTE_FILE_MAX_BITS 61
#define pte_to_pgoff(pte) ((pte_val(pte) << 1) >> 3)
#define pgoff_to_pte(off) ((pte_t) { ((off) << 2) | _PAGE_FILE })
#define io_remap_page_range remap_page_range /* XXX is this right? */ #define io_remap_page_range remap_page_range /* XXX is this right? */
/* /*
......
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