Path: blob/master/arch/unicore32/kernel/asm-offsets.c
10817 views
/*1* linux/arch/unicore32/kernel/asm-offsets.c2*3* Code specific to PKUnity SoC and UniCore ISA4*5* Copyright (C) 2001-2010 GUAN Xue-tao6*7* Generate definitions needed by assembly language modules.8* This code generates raw asm output which is post-processed to extract9* and format the required data.10*11* This program is free software; you can redistribute it and/or modify12* it under the terms of the GNU General Public License version 2 as13* published by the Free Software Foundation.14*/15#include <linux/sched.h>16#include <linux/mm.h>17#include <linux/dma-mapping.h>18#include <linux/kbuild.h>19#include <linux/suspend.h>20#include <linux/thread_info.h>21#include <asm/memory.h>22#include <asm/suspend.h>2324/*25* GCC 3.0, 3.1: general bad code generation.26* GCC 3.2.0: incorrect function argument offset calculation.27* GCC 3.2.x: miscompiles NEW_AUX_ENT in fs/binfmt_elf.c28* (http://gcc.gnu.org/PR8896) and incorrect structure29* initialisation in fs/jffs2/erase.c30*/31#if (__GNUC__ < 4)32#error Your compiler should upgrade to uc433#error Known good compilers: 4.2.234#endif3536int main(void)37{38DEFINE(TSK_ACTIVE_MM, offsetof(struct task_struct, active_mm));39BLANK();40DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));41DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));42DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit));43DEFINE(TI_TASK, offsetof(struct thread_info, task));44DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));45DEFINE(TI_CPU, offsetof(struct thread_info, cpu));46DEFINE(TI_CPU_SAVE, offsetof(struct thread_info, cpu_context));47DEFINE(TI_USED_CP, offsetof(struct thread_info, used_cp));48#ifdef CONFIG_UNICORE_FPU_F6449DEFINE(TI_FPSTATE, offsetof(struct thread_info, fpstate));50#endif51BLANK();52DEFINE(S_R0, offsetof(struct pt_regs, UCreg_00));53DEFINE(S_R1, offsetof(struct pt_regs, UCreg_01));54DEFINE(S_R2, offsetof(struct pt_regs, UCreg_02));55DEFINE(S_R3, offsetof(struct pt_regs, UCreg_03));56DEFINE(S_R4, offsetof(struct pt_regs, UCreg_04));57DEFINE(S_R5, offsetof(struct pt_regs, UCreg_05));58DEFINE(S_R6, offsetof(struct pt_regs, UCreg_06));59DEFINE(S_R7, offsetof(struct pt_regs, UCreg_07));60DEFINE(S_R8, offsetof(struct pt_regs, UCreg_08));61DEFINE(S_R9, offsetof(struct pt_regs, UCreg_09));62DEFINE(S_R10, offsetof(struct pt_regs, UCreg_10));63DEFINE(S_R11, offsetof(struct pt_regs, UCreg_11));64DEFINE(S_R12, offsetof(struct pt_regs, UCreg_12));65DEFINE(S_R13, offsetof(struct pt_regs, UCreg_13));66DEFINE(S_R14, offsetof(struct pt_regs, UCreg_14));67DEFINE(S_R15, offsetof(struct pt_regs, UCreg_15));68DEFINE(S_R16, offsetof(struct pt_regs, UCreg_16));69DEFINE(S_R17, offsetof(struct pt_regs, UCreg_17));70DEFINE(S_R18, offsetof(struct pt_regs, UCreg_18));71DEFINE(S_R19, offsetof(struct pt_regs, UCreg_19));72DEFINE(S_R20, offsetof(struct pt_regs, UCreg_20));73DEFINE(S_R21, offsetof(struct pt_regs, UCreg_21));74DEFINE(S_R22, offsetof(struct pt_regs, UCreg_22));75DEFINE(S_R23, offsetof(struct pt_regs, UCreg_23));76DEFINE(S_R24, offsetof(struct pt_regs, UCreg_24));77DEFINE(S_R25, offsetof(struct pt_regs, UCreg_25));78DEFINE(S_R26, offsetof(struct pt_regs, UCreg_26));79DEFINE(S_FP, offsetof(struct pt_regs, UCreg_fp));80DEFINE(S_IP, offsetof(struct pt_regs, UCreg_ip));81DEFINE(S_SP, offsetof(struct pt_regs, UCreg_sp));82DEFINE(S_LR, offsetof(struct pt_regs, UCreg_lr));83DEFINE(S_PC, offsetof(struct pt_regs, UCreg_pc));84DEFINE(S_PSR, offsetof(struct pt_regs, UCreg_asr));85DEFINE(S_OLD_R0, offsetof(struct pt_regs, UCreg_ORIG_00));86DEFINE(S_FRAME_SIZE, sizeof(struct pt_regs));87BLANK();88DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm));89DEFINE(VMA_VM_FLAGS, offsetof(struct vm_area_struct, vm_flags));90BLANK();91DEFINE(VM_EXEC, VM_EXEC);92BLANK();93DEFINE(PAGE_SZ, PAGE_SIZE);94BLANK();95DEFINE(SYS_ERROR0, 0x9f0000);96BLANK();97DEFINE(PBE_ADDRESS, offsetof(struct pbe, address));98DEFINE(PBE_ORIN_ADDRESS, offsetof(struct pbe, orig_address));99DEFINE(PBE_NEXT, offsetof(struct pbe, next));100DEFINE(SWSUSP_CPU, offsetof(struct swsusp_arch_regs, \101cpu_context));102#ifdef CONFIG_UNICORE_FPU_F64103DEFINE(SWSUSP_FPSTATE, offsetof(struct swsusp_arch_regs, \104fpstate));105#endif106BLANK();107DEFINE(DMA_BIDIRECTIONAL, DMA_BIDIRECTIONAL);108DEFINE(DMA_TO_DEVICE, DMA_TO_DEVICE);109DEFINE(DMA_FROM_DEVICE, DMA_FROM_DEVICE);110return 0;111}112113114