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

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

Version: ~ [ linux-6.6-rc1 ] ~ [ linux-6.5.2 ] ~ [ linux-6.4.15 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.52 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.131 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.194 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.256 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.294 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.325 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright (C) 2013 Altera Corporation
  3  * Copyright (C) 2010 Tobias Klauser <tklauser@distanz.ch>
  4  * Copyright (C) 2004 Microtronix Datacom Ltd
  5  * Copyright (C) 2001 Ken Hill (khill@microtronix.com)
  6  *                    Vic Phillips (vic@microtronix.com)
  7  *
  8  * based on SPARC asm/processor_32.h which is:
  9  *
 10  * Copyright (C) 1994 David S. Miller
 11  *
 12  * This file is subject to the terms and conditions of the GNU General Public
 13  * License.  See the file "COPYING" in the main directory of this archive
 14  * for more details.
 15  */
 16 
 17 #ifndef _ASM_NIOS2_PROCESSOR_H
 18 #define _ASM_NIOS2_PROCESSOR_H
 19 
 20 #include <asm/ptrace.h>
 21 #include <asm/registers.h>
 22 #include <asm/page.h>
 23 
 24 #define NIOS2_FLAG_KTHREAD      0x00000001      /* task is a kernel thread */
 25 
 26 #define NIOS2_OP_NOP            0x1883a
 27 #define NIOS2_OP_BREAK          0x3da03a
 28 
 29 #ifdef __KERNEL__
 30 
 31 #define STACK_TOP       TASK_SIZE
 32 #define STACK_TOP_MAX   STACK_TOP
 33 
 34 #endif /* __KERNEL__ */
 35 
 36 /* Kuser helpers is mapped to this user space address */
 37 #define KUSER_BASE              0x1000
 38 #define KUSER_SIZE              (PAGE_SIZE)
 39 #ifndef __ASSEMBLY__
 40 
 41 /*
 42  * Default implementation of macro that returns current
 43  * instruction pointer ("program counter").
 44  */
 45 #define current_text_addr() ({ __label__ _l; _l: &&_l; })
 46 
 47 # define TASK_SIZE              0x7FFF0000UL
 48 # define TASK_UNMAPPED_BASE     (PAGE_ALIGN(TASK_SIZE / 3))
 49 
 50 /* The Nios processor specific thread struct. */
 51 struct thread_struct {
 52         struct pt_regs *kregs;
 53 
 54         /* Context switch saved kernel state. */
 55         unsigned long ksp;
 56         unsigned long kpsr;
 57 };
 58 
 59 #define INIT_MMAP \
 60         { &init_mm, (0), (0), __pgprot(0x0), VM_READ | VM_WRITE | VM_EXEC }
 61 
 62 # define INIT_THREAD {                  \
 63         .kregs  = NULL,                 \
 64         .ksp    = 0,                    \
 65         .kpsr   = 0,                    \
 66 }
 67 
 68 extern void start_thread(struct pt_regs *regs, unsigned long pc,
 69                         unsigned long sp);
 70 
 71 struct task_struct;
 72 
 73 /* Free all resources held by a thread. */
 74 static inline void release_thread(struct task_struct *dead_task)
 75 {
 76 }
 77 
 78 extern unsigned long get_wchan(struct task_struct *p);
 79 
 80 #define task_pt_regs(p) \
 81         ((struct pt_regs *)(THREAD_SIZE + task_stack_page(p)) - 1)
 82 
 83 /* Used by procfs */
 84 #define KSTK_EIP(tsk)   ((tsk)->thread.kregs->ea)
 85 #define KSTK_ESP(tsk)   ((tsk)->thread.kregs->sp)
 86 
 87 #define cpu_relax()     barrier()
 88 
 89 #endif /* __ASSEMBLY__ */
 90 
 91 #endif /* _ASM_NIOS2_PROCESSOR_H */
 92 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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