0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #include <linux/compiler.h>
0011 #include <linux/sched.h>
0012 #include <linux/mm.h>
0013 #include <linux/dma-mapping.h>
0014 #include <asm/cacheflush.h>
0015 #include <asm/kexec-internal.h>
0016 #include <asm/glue-df.h>
0017 #include <asm/glue-pf.h>
0018 #include <asm/mach/arch.h>
0019 #include <asm/thread_info.h>
0020 #include <asm/memory.h>
0021 #include <asm/mpu.h>
0022 #include <asm/procinfo.h>
0023 #include <asm/suspend.h>
0024 #include <asm/vdso_datapage.h>
0025 #include <asm/hardware/cache-l2x0.h>
0026 #include <linux/kbuild.h>
0027 #include <linux/arm-smccc.h>
0028 #include "signal.h"
0029
0030
0031
0032
0033 #if defined(__APCS_26__)
0034 #error Sorry, your compiler targets APCS-26 but this kernel requires APCS-32
0035 #endif
0036
0037 int main(void)
0038 {
0039 DEFINE(TSK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
0040 #ifdef CONFIG_STACKPROTECTOR
0041 DEFINE(TSK_STACK_CANARY, offsetof(struct task_struct, stack_canary));
0042 #endif
0043 BLANK();
0044 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
0045 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
0046 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
0047 DEFINE(TI_CPU_DOMAIN, offsetof(struct thread_info, cpu_domain));
0048 DEFINE(TI_CPU_SAVE, offsetof(struct thread_info, cpu_context));
0049 DEFINE(TI_ABI_SYSCALL, offsetof(struct thread_info, abi_syscall));
0050 DEFINE(TI_USED_CP, offsetof(struct thread_info, used_cp));
0051 DEFINE(TI_TP_VALUE, offsetof(struct thread_info, tp_value));
0052 DEFINE(TI_FPSTATE, offsetof(struct thread_info, fpstate));
0053 #ifdef CONFIG_VFP
0054 DEFINE(TI_VFPSTATE, offsetof(struct thread_info, vfpstate));
0055 #ifdef CONFIG_SMP
0056 DEFINE(VFP_CPU, offsetof(union vfp_state, hard.cpu));
0057 #endif
0058 #endif
0059 #ifdef CONFIG_ARM_THUMBEE
0060 DEFINE(TI_THUMBEE_STATE, offsetof(struct thread_info, thumbee_state));
0061 #endif
0062 #ifdef CONFIG_IWMMXT
0063 DEFINE(TI_IWMMXT_STATE, offsetof(struct thread_info, fpstate.iwmmxt));
0064 #endif
0065 BLANK();
0066 DEFINE(S_R0, offsetof(struct pt_regs, ARM_r0));
0067 DEFINE(S_R1, offsetof(struct pt_regs, ARM_r1));
0068 DEFINE(S_R2, offsetof(struct pt_regs, ARM_r2));
0069 DEFINE(S_R3, offsetof(struct pt_regs, ARM_r3));
0070 DEFINE(S_R4, offsetof(struct pt_regs, ARM_r4));
0071 DEFINE(S_R5, offsetof(struct pt_regs, ARM_r5));
0072 DEFINE(S_R6, offsetof(struct pt_regs, ARM_r6));
0073 DEFINE(S_R7, offsetof(struct pt_regs, ARM_r7));
0074 DEFINE(S_R8, offsetof(struct pt_regs, ARM_r8));
0075 DEFINE(S_R9, offsetof(struct pt_regs, ARM_r9));
0076 DEFINE(S_R10, offsetof(struct pt_regs, ARM_r10));
0077 DEFINE(S_FP, offsetof(struct pt_regs, ARM_fp));
0078 DEFINE(S_IP, offsetof(struct pt_regs, ARM_ip));
0079 DEFINE(S_SP, offsetof(struct pt_regs, ARM_sp));
0080 DEFINE(S_LR, offsetof(struct pt_regs, ARM_lr));
0081 DEFINE(S_PC, offsetof(struct pt_regs, ARM_pc));
0082 DEFINE(S_PSR, offsetof(struct pt_regs, ARM_cpsr));
0083 DEFINE(S_OLD_R0, offsetof(struct pt_regs, ARM_ORIG_r0));
0084 DEFINE(PT_REGS_SIZE, sizeof(struct pt_regs));
0085 DEFINE(SVC_DACR, offsetof(struct svc_pt_regs, dacr));
0086 DEFINE(SVC_REGS_SIZE, sizeof(struct svc_pt_regs));
0087 BLANK();
0088 DEFINE(SIGFRAME_RC3_OFFSET, offsetof(struct sigframe, retcode[3]));
0089 DEFINE(RT_SIGFRAME_RC3_OFFSET, offsetof(struct rt_sigframe, sig.retcode[3]));
0090 BLANK();
0091 #ifdef CONFIG_CACHE_L2X0
0092 DEFINE(L2X0_R_PHY_BASE, offsetof(struct l2x0_regs, phy_base));
0093 DEFINE(L2X0_R_AUX_CTRL, offsetof(struct l2x0_regs, aux_ctrl));
0094 DEFINE(L2X0_R_TAG_LATENCY, offsetof(struct l2x0_regs, tag_latency));
0095 DEFINE(L2X0_R_DATA_LATENCY, offsetof(struct l2x0_regs, data_latency));
0096 DEFINE(L2X0_R_FILTER_START, offsetof(struct l2x0_regs, filter_start));
0097 DEFINE(L2X0_R_FILTER_END, offsetof(struct l2x0_regs, filter_end));
0098 DEFINE(L2X0_R_PREFETCH_CTRL, offsetof(struct l2x0_regs, prefetch_ctrl));
0099 DEFINE(L2X0_R_PWR_CTRL, offsetof(struct l2x0_regs, pwr_ctrl));
0100 BLANK();
0101 #endif
0102 #ifdef CONFIG_CPU_HAS_ASID
0103 DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id.counter));
0104 BLANK();
0105 #endif
0106 DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm));
0107 DEFINE(VMA_VM_FLAGS, offsetof(struct vm_area_struct, vm_flags));
0108 BLANK();
0109 DEFINE(VM_EXEC, VM_EXEC);
0110 BLANK();
0111 DEFINE(PAGE_SZ, PAGE_SIZE);
0112 BLANK();
0113 DEFINE(SYS_ERROR0, 0x9f0000);
0114 BLANK();
0115 DEFINE(SIZEOF_MACHINE_DESC, sizeof(struct machine_desc));
0116 DEFINE(MACHINFO_TYPE, offsetof(struct machine_desc, nr));
0117 DEFINE(MACHINFO_NAME, offsetof(struct machine_desc, name));
0118 BLANK();
0119 DEFINE(PROC_INFO_SZ, sizeof(struct proc_info_list));
0120 DEFINE(PROCINFO_INITFUNC, offsetof(struct proc_info_list, __cpu_flush));
0121 DEFINE(PROCINFO_MM_MMUFLAGS, offsetof(struct proc_info_list, __cpu_mm_mmu_flags));
0122 DEFINE(PROCINFO_IO_MMUFLAGS, offsetof(struct proc_info_list, __cpu_io_mmu_flags));
0123 BLANK();
0124 #ifdef MULTI_DABORT
0125 DEFINE(PROCESSOR_DABT_FUNC, offsetof(struct processor, _data_abort));
0126 #endif
0127 #ifdef MULTI_PABORT
0128 DEFINE(PROCESSOR_PABT_FUNC, offsetof(struct processor, _prefetch_abort));
0129 #endif
0130 #ifdef MULTI_CPU
0131 DEFINE(CPU_SLEEP_SIZE, offsetof(struct processor, suspend_size));
0132 DEFINE(CPU_DO_SUSPEND, offsetof(struct processor, do_suspend));
0133 DEFINE(CPU_DO_RESUME, offsetof(struct processor, do_resume));
0134 #endif
0135 #ifdef MULTI_CACHE
0136 DEFINE(CACHE_FLUSH_KERN_ALL, offsetof(struct cpu_cache_fns, flush_kern_all));
0137 #endif
0138 #ifdef CONFIG_ARM_CPU_SUSPEND
0139 DEFINE(SLEEP_SAVE_SP_SZ, sizeof(struct sleep_save_sp));
0140 DEFINE(SLEEP_SAVE_SP_PHYS, offsetof(struct sleep_save_sp, save_ptr_stash_phys));
0141 DEFINE(SLEEP_SAVE_SP_VIRT, offsetof(struct sleep_save_sp, save_ptr_stash));
0142 #endif
0143 DEFINE(ARM_SMCCC_QUIRK_ID_OFFS, offsetof(struct arm_smccc_quirk, id));
0144 DEFINE(ARM_SMCCC_QUIRK_STATE_OFFS, offsetof(struct arm_smccc_quirk, state));
0145 BLANK();
0146 DEFINE(DMA_BIDIRECTIONAL, DMA_BIDIRECTIONAL);
0147 DEFINE(DMA_TO_DEVICE, DMA_TO_DEVICE);
0148 DEFINE(DMA_FROM_DEVICE, DMA_FROM_DEVICE);
0149 BLANK();
0150 DEFINE(CACHE_WRITEBACK_ORDER, __CACHE_WRITEBACK_ORDER);
0151 DEFINE(CACHE_WRITEBACK_GRANULE, __CACHE_WRITEBACK_GRANULE);
0152 BLANK();
0153 #ifdef CONFIG_VDSO
0154 DEFINE(VDSO_DATA_SIZE, sizeof(union vdso_data_store));
0155 #endif
0156 BLANK();
0157 #ifdef CONFIG_ARM_MPU
0158 DEFINE(MPU_RNG_INFO_RNGS, offsetof(struct mpu_rgn_info, rgns));
0159 DEFINE(MPU_RNG_INFO_USED, offsetof(struct mpu_rgn_info, used));
0160
0161 DEFINE(MPU_RNG_SIZE, sizeof(struct mpu_rgn));
0162 DEFINE(MPU_RGN_DRBAR, offsetof(struct mpu_rgn, drbar));
0163 DEFINE(MPU_RGN_DRSR, offsetof(struct mpu_rgn, drsr));
0164 DEFINE(MPU_RGN_DRACR, offsetof(struct mpu_rgn, dracr));
0165 DEFINE(MPU_RGN_PRBAR, offsetof(struct mpu_rgn, prbar));
0166 DEFINE(MPU_RGN_PRLAR, offsetof(struct mpu_rgn, prlar));
0167 #endif
0168 DEFINE(KEXEC_START_ADDR, offsetof(struct kexec_relocate_data, kexec_start_address));
0169 DEFINE(KEXEC_INDIR_PAGE, offsetof(struct kexec_relocate_data, kexec_indirection_page));
0170 DEFINE(KEXEC_MACH_TYPE, offsetof(struct kexec_relocate_data, kexec_mach_type));
0171 DEFINE(KEXEC_R2, offsetof(struct kexec_relocate_data, kexec_r2));
0172 return 0;
0173 }