Michal Simek | 4511ec1 | 2009-03-27 14:25:37 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 Michal Simek |
| 3 | * Copyright (C) 2008 PetaLogix |
| 4 | * Copyright (C) 2006 Atmark Techno, Inc. |
| 5 | * |
| 6 | * This file is subject to the terms and conditions of the GNU General Public |
| 7 | * License. See the file "COPYING" in the main directory of this archive |
| 8 | * for more details. |
| 9 | */ |
| 10 | |
| 11 | #ifndef _ASM_MICROBLAZE_PROCESSOR_H |
| 12 | #define _ASM_MICROBLAZE_PROCESSOR_H |
| 13 | |
| 14 | #include <asm/ptrace.h> |
| 15 | #include <asm/setup.h> |
| 16 | #include <asm/registers.h> |
| 17 | #include <asm/segment.h> |
Michal Simek | 2921e2b | 2009-04-21 14:08:47 +0200 | [diff] [blame^] | 18 | #include <asm/entry.h> |
| 19 | #include <asm/current.h> |
Michal Simek | 4511ec1 | 2009-03-27 14:25:37 +0100 | [diff] [blame] | 20 | |
| 21 | # ifndef __ASSEMBLY__ |
| 22 | /* from kernel/cpu/mb.c */ |
| 23 | extern const struct seq_operations cpuinfo_op; |
| 24 | |
| 25 | # define cpu_relax() barrier() |
| 26 | # define cpu_sleep() do {} while (0) |
| 27 | # define prepare_to_copy(tsk) do {} while (0) |
| 28 | |
| 29 | # endif /* __ASSEMBLY__ */ |
| 30 | |
Michal Simek | 2eba318 | 2009-04-16 11:05:26 +0200 | [diff] [blame] | 31 | #define task_pt_regs(tsk) \ |
| 32 | (((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1) |
| 33 | |
Michal Simek | e1c4bd0 | 2009-04-16 11:30:16 +0200 | [diff] [blame] | 34 | /* Do necessary setup to start up a newly executed thread. */ |
| 35 | void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long usp); |
| 36 | |
Michal Simek | 4511ec1 | 2009-03-27 14:25:37 +0100 | [diff] [blame] | 37 | /* |
| 38 | * User space process size: memory size |
| 39 | * |
| 40 | * TASK_SIZE on MMU cpu is usually 1GB. However, on no-MMU arch, both |
| 41 | * user processes and the kernel is on the same memory region. They |
| 42 | * both share the memory space and that is limited by the amount of |
| 43 | * physical memory. thus, we set TASK_SIZE == amount of total memory. |
| 44 | */ |
| 45 | # define TASK_SIZE (0x81000000 - 0x80000000) |
| 46 | |
| 47 | /* |
| 48 | * Default implementation of macro that returns current |
| 49 | * instruction pointer ("program counter"). |
| 50 | */ |
| 51 | # define current_text_addr() ({ __label__ _l; _l: &&_l; }) |
| 52 | |
| 53 | /* |
| 54 | * This decides where the kernel will search for a free chunk of vm |
| 55 | * space during mmap's. We won't be using it |
| 56 | */ |
| 57 | # define TASK_UNMAPPED_BASE 0 |
| 58 | |
| 59 | /* definition in include/linux/sched.h */ |
| 60 | struct task_struct; |
| 61 | |
| 62 | /* thread_struct is gone. use thread_info instead. */ |
| 63 | struct thread_struct { }; |
| 64 | # define INIT_THREAD { } |
| 65 | |
Michal Simek | 4511ec1 | 2009-03-27 14:25:37 +0100 | [diff] [blame] | 66 | /* Free all resources held by a thread. */ |
| 67 | static inline void release_thread(struct task_struct *dead_task) |
| 68 | { |
| 69 | } |
| 70 | |
| 71 | /* Free all resources held by a thread. */ |
| 72 | static inline void exit_thread(void) |
| 73 | { |
| 74 | } |
| 75 | |
| 76 | extern unsigned long thread_saved_pc(struct task_struct *t); |
| 77 | |
| 78 | extern unsigned long get_wchan(struct task_struct *p); |
| 79 | |
| 80 | /* |
| 81 | * create a kernel thread without removing it from tasklists |
| 82 | */ |
| 83 | extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); |
| 84 | |
Michal Simek | 4511ec1 | 2009-03-27 14:25:37 +0100 | [diff] [blame] | 85 | # define KSTK_EIP(tsk) (0) |
| 86 | # define KSTK_ESP(tsk) (0) |
| 87 | |
| 88 | #endif /* _ASM_MICROBLAZE_PROCESSOR_H */ |