1/* 2 * linux/arch/arm/tools/getconsdata.c 3 * 4 * Copyright (C) 1995-2001 Russell King 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License version 2 as 8 * published by the Free Software Foundation. 9 */ 10#include <linux/config.h> 11#include <linux/sched.h> 12#include <linux/mm.h> 13 14#include <asm/pgtable.h> 15#include <asm/uaccess.h> 16 17/* 18 * Make sure that the compiler and target are compatible. 19 */ 20#if defined(__APCS_32__) && defined(CONFIG_CPU_26) 21#error Your compiler targets APCS-32 but this kernel requires APCS-26 22#endif 23#if defined(__APCS_26__) && defined(CONFIG_CPU_32) 24#error Your compiler targets APCS-26 but this kernel requires APCS-32 25#endif 26 27#define OFF_TSK(n) (unsigned long)&(((struct task_struct *)0)->n) 28 29#define DEFN(name,off) asm("\n#define "name" %0" :: "I" (off)) 30 31void func(void) 32{ 33DEFN("TSK_SIGPENDING", OFF_TSK(sigpending)); 34DEFN("TSK_ADDR_LIMIT", OFF_TSK(addr_limit)); 35DEFN("TSK_NEED_RESCHED", OFF_TSK(need_resched)); 36DEFN("TSK_PTRACE", OFF_TSK(ptrace)); 37DEFN("TSK_USED_MATH", OFF_TSK(used_math)); 38 39DEFN("TSS_SAVE", OFF_TSK(thread.save)); 40DEFN("TSS_FPESAVE", OFF_TSK(thread.fpstate.soft.save)); 41 42#ifdef CONFIG_CPU_32 43DEFN("TSS_DOMAIN", OFF_TSK(thread.domain)); 44 45DEFN("HPTE_TYPE_SMALL", PTE_TYPE_SMALL); 46DEFN("HPTE_AP_READ", PTE_AP_READ); 47DEFN("HPTE_AP_WRITE", PTE_AP_WRITE); 48 49DEFN("LPTE_PRESENT", L_PTE_PRESENT); 50DEFN("LPTE_YOUNG", L_PTE_YOUNG); 51DEFN("LPTE_BUFFERABLE", L_PTE_BUFFERABLE); 52DEFN("LPTE_CACHEABLE", L_PTE_CACHEABLE); 53DEFN("LPTE_USER", L_PTE_USER); 54DEFN("LPTE_WRITE", L_PTE_WRITE); 55DEFN("LPTE_EXEC", L_PTE_EXEC); 56DEFN("LPTE_DIRTY", L_PTE_DIRTY); 57#endif 58 59#ifdef CONFIG_CPU_26 60DEFN("PAGE_PRESENT", _PAGE_PRESENT); 61DEFN("PAGE_READONLY", _PAGE_READONLY); 62DEFN("PAGE_NOT_USER", _PAGE_NOT_USER); 63DEFN("PAGE_OLD", _PAGE_OLD); 64DEFN("PAGE_CLEAN", _PAGE_CLEAN); 65#endif 66 67DEFN("PAGE_SZ", PAGE_SIZE); 68 69DEFN("SYS_ERROR0", 0x9f0000); 70} 71