]> git.neil.brown.name Git - history.git/commitdiff
ia64: Initial sync with 2.5.67.
authorDavid Mosberger <davidm@tiger.hpl.hp.com>
Wed, 9 Apr 2003 04:51:40 +0000 (21:51 -0700)
committerDavid Mosberger <davidm@tiger.hpl.hp.com>
Wed, 9 Apr 2003 04:51:40 +0000 (21:51 -0700)
arch/ia64/ia32/ia32_signal.c
arch/ia64/ia32/sys_ia32.c
arch/ia64/mm/fault.c
include/asm-ia64/compat.h
include/asm-ia64/pgtable.h

index 69e2f6ff8e277cde98b77c688c9b76b26357c8ca..e86f432bce93267589463e8967561abb1555635a 100644 (file)
@@ -114,6 +114,7 @@ copy_siginfo_from_user32 (siginfo_t *to, siginfo_t32 *from)
 int
 copy_siginfo_to_user32 (siginfo_t32 *to, siginfo_t *from)
 {
+       unsigned int addr;
        int err;
 
        if (!access_ok(VERIFY_WRITE, to, sizeof(siginfo_t32)))
@@ -151,7 +152,8 @@ copy_siginfo_to_user32 (siginfo_t32 *to, siginfo_t *from)
                case __SI_TIMER >> 16:
                        err |= __put_user(from->si_tid, &to->si_tid);
                        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;
                /* case __SI_RT: This is not generated by the kernel as of now.  */
                }
index 61e5b05e2079db98d802f6c9e7a7b3c1c7df5463..84d34a212ac2705069f07565e55feca3a9a5d5a2 100644 (file)
@@ -2261,7 +2261,7 @@ sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data,
 
        }
   out_tsk:
-       free_task_struct(child);
+       put_task_struct(child);
   out:
        unlock_kernel();
        return ret;
index ebffa17119b53db5de0b17200379831c015660bf..f16f8ce96f19abd8564aacb74af7989d33700b23 100644 (file)
@@ -194,6 +194,7 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
        up_read(&mm->mmap_sem);
        if (current->pid == 1) {
                yield();
+               down_read(&mm->mmap_sem);
                goto survive;
        }
        printk(KERN_CRIT "VM: killing process %s\n", current->comm);
index 33f6450ed38c2cc1245eae7bb5adb35c49067a22..54baeefdf13da3adf4bd9a80081354408bcf0f19 100644 (file)
@@ -27,6 +27,11 @@ typedef s32          compat_daddr_t;
 typedef u32            compat_caddr_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 {
        compat_time_t   tv_sec;
        s32             tv_nsec;
@@ -108,16 +113,16 @@ typedef u32               compat_sigset_word;
 #define COMPAT_LOFF_T_MAX      0x7fffffffffffffffL
 
 /*
- * A pointer passed in from user mode. This should not
- * be used for syscall parameters, just declare them
- * as pointers because the syscall entry code will have
- * appropriately comverted them already.
+ * A pointer passed in from user mode. This should not be used for syscall parameters,
+ * just declare them as pointers because the syscall entry code will have appropriately
+ * comverted them already.
  */
 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 */
index 04b48666fa34f2b07e13508eeb82474e6b181ad6..8104da910e34b64793f4a2b406fb7de4a1bec7a3 100644 (file)
@@ -59,6 +59,9 @@
 #define _PAGE_ED               (__IA64_UL(1) << 52)    /* exception deferral */
 #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 _PAGE_CHG_MASK         (_PFN_MASK | _PAGE_A | _PAGE_D)
 
@@ -253,6 +256,7 @@ ia64_phys_addr_valid (unsigned long addr)
 #define pte_exec(pte)          ((pte_val(pte) & _PAGE_AR_RX) != 0)
 #define pte_dirty(pte)         ((pte_val(pte) & _PAGE_D) != 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
  * access rights:
@@ -402,12 +406,35 @@ pte_same (pte_t a, pte_t b)
 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
 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_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 __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? */
 
 /*