blob: cea42a36d161592da49e65d52fe9a8fab2beafb4 [file] [log] [blame]
Michal Simek4511ec12009-03-27 14:25:37 +01001/*
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>
18
19# ifndef __ASSEMBLY__
20/* from kernel/cpu/mb.c */
21extern const struct seq_operations cpuinfo_op;
22
23# define cpu_relax() barrier()
24# define cpu_sleep() do {} while (0)
25# define prepare_to_copy(tsk) do {} while (0)
26
27# endif /* __ASSEMBLY__ */
28
Michal Simek2eba3182009-04-16 11:05:26 +020029#define task_pt_regs(tsk) \
30 (((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1)
31
Michal Simek4511ec12009-03-27 14:25:37 +010032/*
33 * User space process size: memory size
34 *
35 * TASK_SIZE on MMU cpu is usually 1GB. However, on no-MMU arch, both
36 * user processes and the kernel is on the same memory region. They
37 * both share the memory space and that is limited by the amount of
38 * physical memory. thus, we set TASK_SIZE == amount of total memory.
39 */
40# define TASK_SIZE (0x81000000 - 0x80000000)
41
42/*
43 * Default implementation of macro that returns current
44 * instruction pointer ("program counter").
45 */
46# define current_text_addr() ({ __label__ _l; _l: &&_l; })
47
48/*
49 * This decides where the kernel will search for a free chunk of vm
50 * space during mmap's. We won't be using it
51 */
52# define TASK_UNMAPPED_BASE 0
53
54/* definition in include/linux/sched.h */
55struct task_struct;
56
57/* thread_struct is gone. use thread_info instead. */
58struct thread_struct { };
59# define INIT_THREAD { }
60
61/* Do necessary setup to start up a newly executed thread. */
62static inline void start_thread(struct pt_regs *regs,
63 unsigned long pc,
64 unsigned long usp)
65{
66 regs->pc = pc;
67 regs->r1 = usp;
Michal Simekac3efab2009-04-16 10:58:47 +020068 regs->pt_mode = 0;
Michal Simek4511ec12009-03-27 14:25:37 +010069}
70
71/* Free all resources held by a thread. */
72static inline void release_thread(struct task_struct *dead_task)
73{
74}
75
76/* Free all resources held by a thread. */
77static inline void exit_thread(void)
78{
79}
80
81extern unsigned long thread_saved_pc(struct task_struct *t);
82
83extern unsigned long get_wchan(struct task_struct *p);
84
85/*
86 * create a kernel thread without removing it from tasklists
87 */
88extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
89
Michal Simek4511ec12009-03-27 14:25:37 +010090# define KSTK_EIP(tsk) (0)
91# define KSTK_ESP(tsk) (0)
92
93#endif /* _ASM_MICROBLAZE_PROCESSOR_H */