~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/avr32/include/asm/processor.h

Version: ~ [ linux-5.6 ] ~ [ linux-5.5.13 ] ~ [ linux-5.4.28 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.113 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.174 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.217 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.217 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.82 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright (C) 2004-2006 Atmel Corporation
  3  *
  4  * This program is free software; you can redistribute it and/or modify
  5  * it under the terms of the GNU General Public License version 2 as
  6  * published by the Free Software Foundation.
  7  */
  8 #ifndef __ASM_AVR32_PROCESSOR_H
  9 #define __ASM_AVR32_PROCESSOR_H
 10 
 11 #include <asm/page.h>
 12 #include <asm/cache.h>
 13 
 14 #define TASK_SIZE       0x80000000
 15 
 16 #ifdef __KERNEL__
 17 #define STACK_TOP       TASK_SIZE
 18 #define STACK_TOP_MAX   STACK_TOP
 19 #endif
 20 
 21 #ifndef __ASSEMBLY__
 22 
 23 static inline void *current_text_addr(void)
 24 {
 25         register void *pc asm("pc");
 26         return pc;
 27 }
 28 
 29 enum arch_type {
 30         ARCH_AVR32A,
 31         ARCH_AVR32B,
 32         ARCH_MAX
 33 };
 34 
 35 enum cpu_type {
 36         CPU_MORGAN,
 37         CPU_AT32AP,
 38         CPU_MAX
 39 };
 40 
 41 enum tlb_config {
 42         TLB_NONE,
 43         TLB_SPLIT,
 44         TLB_UNIFIED,
 45         TLB_INVALID
 46 };
 47 
 48 #define AVR32_FEATURE_RMW       (1 << 0)
 49 #define AVR32_FEATURE_DSP       (1 << 1)
 50 #define AVR32_FEATURE_SIMD      (1 << 2)
 51 #define AVR32_FEATURE_OCD       (1 << 3)
 52 #define AVR32_FEATURE_PCTR      (1 << 4)
 53 #define AVR32_FEATURE_JAVA      (1 << 5)
 54 #define AVR32_FEATURE_FPU       (1 << 6)
 55 
 56 struct avr32_cpuinfo {
 57         struct clk *clk;
 58         unsigned long loops_per_jiffy;
 59         enum arch_type arch_type;
 60         enum cpu_type cpu_type;
 61         unsigned short arch_revision;
 62         unsigned short cpu_revision;
 63         enum tlb_config tlb_config;
 64         unsigned long features;
 65         u32 device_id;
 66 
 67         struct cache_info icache;
 68         struct cache_info dcache;
 69 };
 70 
 71 static inline unsigned int avr32_get_manufacturer_id(struct avr32_cpuinfo *cpu)
 72 {
 73         return (cpu->device_id >> 1) & 0x7f;
 74 }
 75 static inline unsigned int avr32_get_product_number(struct avr32_cpuinfo *cpu)
 76 {
 77         return (cpu->device_id >> 12) & 0xffff;
 78 }
 79 static inline unsigned int avr32_get_chip_revision(struct avr32_cpuinfo *cpu)
 80 {
 81         return (cpu->device_id >> 28) & 0x0f;
 82 }
 83 
 84 extern struct avr32_cpuinfo boot_cpu_data;
 85 
 86 #ifdef CONFIG_SMP
 87 extern struct avr32_cpuinfo cpu_data[];
 88 #define current_cpu_data cpu_data[smp_processor_id()]
 89 #else
 90 #define cpu_data (&boot_cpu_data)
 91 #define current_cpu_data boot_cpu_data
 92 #endif
 93 
 94 /* This decides where the kernel will search for a free chunk of vm
 95  * space during mmap's
 96  */
 97 #define TASK_UNMAPPED_BASE      (PAGE_ALIGN(TASK_SIZE / 3))
 98 
 99 #define cpu_relax()             barrier()
100 #define cpu_sync_pipeline()     asm volatile("sub pc, -2" : : : "memory")
101 
102 struct cpu_context {
103         unsigned long sr;
104         unsigned long pc;
105         unsigned long ksp;      /* Kernel stack pointer */
106         unsigned long r7;
107         unsigned long r6;
108         unsigned long r5;
109         unsigned long r4;
110         unsigned long r3;
111         unsigned long r2;
112         unsigned long r1;
113         unsigned long r0;
114 };
115 
116 /* This struct contains the CPU context as stored by switch_to() */
117 struct thread_struct {
118         struct cpu_context cpu_context;
119         unsigned long single_step_addr;
120         u16 single_step_insn;
121 };
122 
123 #define INIT_THREAD {                                           \
124         .cpu_context = {                                        \
125                 .ksp = sizeof(init_stack) + (long)&init_stack,  \
126         },                                                      \
127 }
128 
129 /*
130  * Do necessary setup to start up a newly executed thread.
131  */
132 #define start_thread(regs, new_pc, new_sp)       \
133         do {                                     \
134                 memset(regs, 0, sizeof(*regs));  \
135                 regs->sr = MODE_USER;            \
136                 regs->pc = new_pc & ~1;          \
137                 regs->sp = new_sp;               \
138         } while(0)
139 
140 struct task_struct;
141 
142 /* Free all resources held by a thread */
143 extern void release_thread(struct task_struct *);
144 
145 /* Return saved PC of a blocked thread */
146 #define thread_saved_pc(tsk)    ((tsk)->thread.cpu_context.pc)
147 
148 struct pt_regs;
149 extern unsigned long get_wchan(struct task_struct *p);
150 extern void show_regs_log_lvl(struct pt_regs *regs, const char *log_lvl);
151 extern void show_stack_log_lvl(struct task_struct *tsk, unsigned long sp,
152                                struct pt_regs *regs, const char *log_lvl);
153 
154 #define task_pt_regs(p) \
155         ((struct pt_regs *)(THREAD_SIZE + task_stack_page(p)) - 1)
156 
157 #define KSTK_EIP(tsk)   ((tsk)->thread.cpu_context.pc)
158 #define KSTK_ESP(tsk)   ((tsk)->thread.cpu_context.ksp)
159 
160 #define ARCH_HAS_PREFETCH
161 
162 static inline void prefetch(const void *x)
163 {
164         const char *c = x;
165         asm volatile("pref %0" : : "r"(c));
166 }
167 #define PREFETCH_STRIDE L1_CACHE_BYTES
168 
169 #endif /* __ASSEMBLY__ */
170 
171 #endif /* __ASM_AVR32_PROCESSOR_H */
172 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp