···19#include <asm/unistd.h>2021#include "ptrace.h"22+#include "signal.h"2324#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))25···35#define SWI_THUMB_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_sigreturn - __NR_SYSCALL_BASE))36#define SWI_THUMB_RT_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_rt_sigreturn - __NR_SYSCALL_BASE))3738+const unsigned long sigreturn_codes[4] = {39 SWI_SYS_SIGRETURN, SWI_THUMB_SIGRETURN,40 SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN41};···500 if (ka->sa.sa_flags & SA_SIGINFO)501 idx += 2;502503+ if (__put_user(sigreturn_codes[idx], rc))504 return 1;505506+ if (cpsr & MODE32_BIT) {507+ /*508+ * 32-bit code can use the new high-page509+ * signal return code support.510+ */511+ retcode = KERN_SIGRETURN_CODE + (idx << 2) + thumb;512+ } else {513+ /*514+ * Ensure that the instruction cache sees515+ * the return code written onto the stack.516+ */517+ flush_icache_range((unsigned long)rc,518+ (unsigned long)(rc + 1));519520+ retcode = ((unsigned long)rc) + thumb;521+ }522 }523524 regs->ARM_r0 = usig;
+12
arch/arm/kernel/signal.h
···000000000000
···1+/*2+ * linux/arch/arm/kernel/signal.h3+ *4+ * Copyright (C) 2005 Russell King.5+ *6+ * This program is free software; you can redistribute it and/or modify7+ * it under the terms of the GNU General Public License version 2 as8+ * published by the Free Software Foundation.9+ */10+#define KERN_SIGRETURN_CODE 0xffff050011+12+extern const unsigned long sigreturn_codes[4];
···30#include <asm/traps.h>3132#include "ptrace.h"33+#include "signal.h"3435const char *processor_modes[]=36{ "USER_26", "FIQ_26" , "IRQ_26" , "SVC_26" , "UK4_26" , "UK5_26" , "UK6_26" , "UK7_26" ,···683 memcpy((void *)0xffff0000, __vectors_start, __vectors_end - __vectors_start);684 memcpy((void *)0xffff0200, __stubs_start, __stubs_end - __stubs_start);685 memcpy((void *)0xffff1000 - kuser_sz, __kuser_helper_start, kuser_sz);686+687+ /*688+ * Copy signal return handlers into the vector page, and689+ * set sigreturn to be a pointer to these.690+ */691+ memcpy((void *)KERN_SIGRETURN_CODE, sigreturn_codes,692+ sizeof(sigreturn_codes));693+694 flush_icache_range(0xffff0000, 0xffff0000 + PAGE_SIZE);695 modify_domain(DOMAIN_USER, DOMAIN_CLIENT);696}
+2
arch/arm/mach-clps7500/core.c
···26#include <asm/irq.h>27#include <asm/mach-types.h>280029static void cl7500_ack_irq_a(unsigned int irq)30{31 unsigned int val, mask;
···26#include <asm/irq.h>27#include <asm/mach-types.h>2829+unsigned int vram_size;30+31static void cl7500_ack_irq_a(unsigned int irq)32{33 unsigned int val, mask;
+1-6
arch/arm/mach-rpc/riscpc.c
···3233extern void rpc_init_irq(void);3435-extern unsigned int vram_size;36-37-#if 038-39unsigned int memc_ctrl_reg;40unsigned int number_mfm_drives;41···59}6061__tagtable(ATAG_ACORN, parse_tag_acorn);62-63-#endif6465static struct map_desc rpc_io_desc[] __initdata = {66 { SCREEN_BASE, SCREEN_START, 2*1048576, MT_DEVICE }, /* VRAM */
···3233extern void rpc_init_irq(void);3435+unsigned int vram_size;00036unsigned int memc_ctrl_reg;37unsigned int number_mfm_drives;38···62}6364__tagtable(ATAG_ACORN, parse_tag_acorn);006566static struct map_desc rpc_io_desc[] __initdata = {67 { SCREEN_BASE, SCREEN_START, 2*1048576, MT_DEVICE }, /* VRAM */
+6-13
arch/arm/mm/init.c
···93};9495#define O_PFN_DOWN(x) ((x) >> PAGE_SHIFT)96-#define V_PFN_DOWN(x) O_PFN_DOWN(__pa(x))97-98#define O_PFN_UP(x) (PAGE_ALIGN(x) >> PAGE_SHIFT)99-#define V_PFN_UP(x) O_PFN_UP(__pa(x))100-101-#define PFN_SIZE(x) ((x) >> PAGE_SHIFT)102-#define PFN_RANGE(s,e) PFN_SIZE(PAGE_ALIGN((unsigned long)(e)) - \103- (((unsigned long)(s)) & PAGE_MASK))104105/*106 * FIXME: We really want to avoid allocating the bootmap bitmap···106{107 unsigned int start_pfn, bank, bootmap_pfn;108109- start_pfn = V_PFN_UP(&_end);110 bootmap_pfn = 0;111112 for (bank = 0; bank < mi->nr_banks; bank ++) {···115 if (mi->bank[bank].node != node)116 continue;117118- start = O_PFN_UP(mi->bank[bank].start);119- end = O_PFN_DOWN(mi->bank[bank].size +120- mi->bank[bank].start);121122 if (end < start_pfn)123 continue;···184 /*185 * Get the start and end pfns for this bank186 */187- start = O_PFN_UP(mi->bank[i].start);188- end = O_PFN_DOWN(mi->bank[i].start + mi->bank[i].size);189190 if (np[node].start > start)191 np[node].start = start;
···93};9495#define O_PFN_DOWN(x) ((x) >> PAGE_SHIFT)0096#define O_PFN_UP(x) (PAGE_ALIGN(x) >> PAGE_SHIFT)000009798/*99 * FIXME: We really want to avoid allocating the bootmap bitmap···113{114 unsigned int start_pfn, bank, bootmap_pfn;115116+ start_pfn = O_PFN_UP(__pa(&_end));117 bootmap_pfn = 0;118119 for (bank = 0; bank < mi->nr_banks; bank ++) {···122 if (mi->bank[bank].node != node)123 continue;124125+ start = mi->bank[bank].start >> PAGE_SHIFT;126+ end = (mi->bank[bank].size +127+ mi->bank[bank].start) >> PAGE_SHIFT;128129 if (end < start_pfn)130 continue;···191 /*192 * Get the start and end pfns for this bank193 */194+ start = mi->bank[i].start >> PAGE_SHIFT;195+ end = (mi->bank[i].start + mi->bank[i].size) >> PAGE_SHIFT;196197 if (np[node].start > start)198 np[node].start = start;
+9-15
include/asm-arm/pgalloc.h
···89 __free_page(pte);90}91000000092/*93 * Populate the pmdp entry with a pointer to the pte. This pmd is part94 * of the mm address space.···106pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep)107{108 unsigned long pte_ptr = (unsigned long)ptep;109- unsigned long pmdval;110-111- BUG_ON(mm != &init_mm);112113 /*114 * The pmd must be loaded with the physical115 * address of the PTE table116 */117 pte_ptr -= PTRS_PER_PTE * sizeof(void *);118- pmdval = __pa(pte_ptr) | _PAGE_KERNEL_TABLE;119- pmdp[0] = __pmd(pmdval);120- pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));121- flush_pmd_entry(pmdp);122}123124static inline void125pmd_populate(struct mm_struct *mm, pmd_t *pmdp, struct page *ptep)126{127- unsigned long pmdval;128-129- BUG_ON(mm == &init_mm);130-131- pmdval = page_to_pfn(ptep) << PAGE_SHIFT | _PAGE_USER_TABLE;132- pmdp[0] = __pmd(pmdval);133- pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));134- flush_pmd_entry(pmdp);135}136137#endif
···89 __free_page(pte);90}9192+static inline void __pmd_populate(pmd_t *pmdp, unsigned long pmdval)93+{94+ pmdp[0] = __pmd(pmdval);95+ pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));96+ flush_pmd_entry(pmdp);97+}98+99/*100 * Populate the pmdp entry with a pointer to the pte. This pmd is part101 * of the mm address space.···99pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep)100{101 unsigned long pte_ptr = (unsigned long)ptep;000102103 /*104 * The pmd must be loaded with the physical105 * address of the PTE table106 */107 pte_ptr -= PTRS_PER_PTE * sizeof(void *);108+ __pmd_populate(pmdp, __pa(pte_ptr) | _PAGE_KERNEL_TABLE);000109}110111static inline void112pmd_populate(struct mm_struct *mm, pmd_t *pmdp, struct page *ptep)113{114+ __pmd_populate(pmdp, page_to_pfn(ptep) << PAGE_SHIFT | _PAGE_USER_TABLE);0000000115}116117#endif