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

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

Version: ~ [ linux-6.4-rc3 ] ~ [ linux-6.3.4 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.30 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.113 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.180 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.243 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.283 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.315 ] ~ [ 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  * linux/arch/unicore32/include/asm/processor.h
  3  *
  4  * Code specific to PKUnity SoC and UniCore ISA
  5  *
  6  * Copyright (C) 2001-2010 GUAN Xue-tao
  7  *
  8  * This program is free software; you can redistribute it and/or modify
  9  * it under the terms of the GNU General Public License version 2 as
 10  * published by the Free Software Foundation.
 11  */
 12 
 13 #ifndef __UNICORE_PROCESSOR_H__
 14 #define __UNICORE_PROCESSOR_H__
 15 
 16 /*
 17  * Default implementation of macro that returns current
 18  * instruction pointer ("program counter").
 19  */
 20 #define current_text_addr() ({ __label__ _l; _l: &&_l; })
 21 
 22 #ifdef __KERNEL__
 23 
 24 #include <asm/ptrace.h>
 25 #include <asm/types.h>
 26 
 27 #ifdef __KERNEL__
 28 #define STACK_TOP       TASK_SIZE
 29 #define STACK_TOP_MAX   TASK_SIZE
 30 #endif
 31 
 32 struct debug_entry {
 33         u32                     address;
 34         u32                     insn;
 35 };
 36 
 37 struct debug_info {
 38         int                     nsaved;
 39         struct debug_entry      bp[2];
 40 };
 41 
 42 struct thread_struct {
 43                                                         /* fault info     */
 44         unsigned long           address;
 45         unsigned long           trap_no;
 46         unsigned long           error_code;
 47                                                         /* debugging      */
 48         struct debug_info       debug;
 49 };
 50 
 51 #define INIT_THREAD  {  }
 52 
 53 #define start_thread(regs, pc, sp)                                      \
 54 ({                                                                      \
 55         unsigned long *stack = (unsigned long *)sp;                     \
 56         memset(regs->uregs, 0, sizeof(regs->uregs));                    \
 57         regs->UCreg_asr = USER_MODE;                                    \
 58         regs->UCreg_pc = pc & ~1;       /* pc */                        \
 59         regs->UCreg_sp = sp;            /* sp */                        \
 60         regs->UCreg_02 = stack[2];      /* r2 (envp) */                 \
 61         regs->UCreg_01 = stack[1];      /* r1 (argv) */                 \
 62         regs->UCreg_00 = stack[0];      /* r0 (argc) */                 \
 63 })
 64 
 65 /* Forward declaration, a strange C thing */
 66 struct task_struct;
 67 
 68 /* Free all resources held by a thread. */
 69 extern void release_thread(struct task_struct *);
 70 
 71 unsigned long get_wchan(struct task_struct *p);
 72 
 73 #define cpu_relax()                     barrier()
 74 
 75 #define task_pt_regs(p) \
 76         ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1)
 77 
 78 #define KSTK_EIP(tsk)   (task_pt_regs(tsk)->UCreg_pc)
 79 #define KSTK_ESP(tsk)   (task_pt_regs(tsk)->UCreg_sp)
 80 
 81 #endif
 82 
 83 #endif /* __UNICORE_PROCESSOR_H__ */
 84 

~ [ 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