1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 **************************************************************************** 11 ****************************************************************************/ 12 #ifndef __ASM_SH_PROCESSOR_64_H 13 #define __ASM_SH_PROCESSOR_64_H 14 15 #ifndef __ASSEMBLY__ 16 17 #include <linux/compiler.h> 18 #include <asm/page.h> 19 #include <asm/types.h> 20 #include <asm/cache.h> 21 #include <asm/ptrace.h> 22 #include <cpu/registers.h> 23 24 #define current_text_addr() ({ void *pc; unsigned long long __dummy = 0; __asm__("gettr tr0, %1\n\t" "pta 4, tr0\n\t" "gettr tr0, %0\n\t" "ptabs %1, tr0\n\t" :"=r" (pc), "=r" (__dummy) : "1" (__dummy)); pc; }) 25 26 struct tlb_info { 27 unsigned long long next; 28 unsigned long long first; 29 unsigned long long last; 30 31 unsigned int entries; 32 unsigned int step; 33 34 unsigned long flags; 35 }; 36 37 struct sh_cpuinfo { 38 enum cpu_type type; 39 unsigned long loops_per_jiffy; 40 unsigned long asid_cache; 41 42 unsigned int cpu_clock, master_clock, bus_clock, module_clock; 43 44 struct cache_info icache; 45 struct cache_info dcache; 46 struct cache_info scache; 47 48 struct tlb_info itlb; 49 struct tlb_info dtlb; 50 51 unsigned long flags; 52 }; 53 54 #define boot_cpu_data cpu_data[0] 55 #define current_cpu_data cpu_data[smp_processor_id()] 56 #define raw_current_cpu_data cpu_data[raw_smp_processor_id()] 57 58 #endif 59 60 #define TASK_SIZE 0x7ffff000UL 61 62 #define STACK_TOP TASK_SIZE 63 #define STACK_TOP_MAX STACK_TOP 64 65 #define TASK_UNMAPPED_BASE (TASK_SIZE / 3) 66 67 #define SR_MMU 0x80000000 68 69 #define SR_IMASK 0x000000f0 70 #define SR_FD 0x00008000 71 #define SR_SSTEP 0x08000000 72 73 #ifndef __ASSEMBLY__ 74 75 struct sh_fpu_hard_struct { 76 unsigned long fp_regs[64]; 77 unsigned int fpscr; 78 79 }; 80 81 union sh_fpu_union { 82 struct sh_fpu_hard_struct hard; 83 84 unsigned long long alignment_dummy; 85 }; 86 87 struct thread_struct { 88 unsigned long sp; 89 unsigned long pc; 90 91 struct pt_regs *kregs; 92 93 struct pt_regs *uregs; 94 95 unsigned long trap_no, error_code; 96 unsigned long address; 97 98 union sh_fpu_union fpu; 99 }; 100 101 #define INIT_MMAP { &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL } 102 103 #define INIT_THREAD { .sp = sizeof(init_stack) + (long) &init_stack, .pc = 0, .kregs = &fake_swapper_regs, .uregs = NULL, .trap_no = 0, .error_code = 0, .address = 0, .fpu = { { { 0, } }, } } 104 105 #define SR_USER (SR_MMU | SR_FD) 106 107 #define start_thread(regs, new_pc, new_sp) set_fs(USER_DS); regs->sr = SR_USER; regs->pc = new_pc - 4; regs->pc |= 1; regs->regs[18] = 0; regs->regs[15] = new_sp 108 109 struct task_struct; 110 struct mm_struct; 111 112 #define copy_segments(p, mm) do { } while (0) 113 #define release_segments(mm) do { } while (0) 114 #define forget_segments() do { } while (0) 115 #define prepare_to_copy(tsk) do { } while (0) 116 117 #define FPSCR_INIT 0x00000000 118 119 #define thread_saved_pc(tsk) (tsk->thread.pc) 120 121 #define KSTK_EIP(tsk) ((tsk)->thread.pc) 122 #define KSTK_ESP(tsk) ((tsk)->thread.sp) 123 124 #define cpu_relax() barrier() 125 126 #endif 127 #endif 128