aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2009-03-27 09:25:37 -0400
committerMichal Simek <monstr@monstr.eu>2009-03-27 09:25:37 -0400
commit4511ec153afd132da9f4308e7db394820eb52129 (patch)
tree4930333220379143a2844138e254dda61d916f6a /arch
parent6a3cece5e5e7e7c0fde769d7cf065fb8aef6e54e (diff)
microblaze_v8: system.h processor.h
Reviewed-by: Ingo Molnar <mingo@elte.hu> Acked-by: John Linn <john.linn@xilinx.com> Acked-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> Acked-by: John Williams <john.williams@petalogix.com> Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch')
-rw-r--r--arch/microblaze/include/asm/processor.h93
-rw-r--r--arch/microblaze/include/asm/system.h91
2 files changed, 184 insertions, 0 deletions
diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h
new file mode 100644
index 000000000000..d8e15434ba21
--- /dev/null
+++ b/arch/microblaze/include/asm/processor.h
@@ -0,0 +1,93 @@
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>
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
29/*
30 * User space process size: memory size
31 *
32 * TASK_SIZE on MMU cpu is usually 1GB. However, on no-MMU arch, both
33 * user processes and the kernel is on the same memory region. They
34 * both share the memory space and that is limited by the amount of
35 * physical memory. thus, we set TASK_SIZE == amount of total memory.
36 */
37# define TASK_SIZE (0x81000000 - 0x80000000)
38
39/*
40 * Default implementation of macro that returns current
41 * instruction pointer ("program counter").
42 */
43# define current_text_addr() ({ __label__ _l; _l: &&_l; })
44
45/*
46 * This decides where the kernel will search for a free chunk of vm
47 * space during mmap's. We won't be using it
48 */
49# define TASK_UNMAPPED_BASE 0
50
51/* definition in include/linux/sched.h */
52struct task_struct;
53
54/* thread_struct is gone. use thread_info instead. */
55struct thread_struct { };
56# define INIT_THREAD { }
57
58/* Do necessary setup to start up a newly executed thread. */
59static inline void start_thread(struct pt_regs *regs,
60 unsigned long pc,
61 unsigned long usp)
62{
63 regs->pc = pc;
64 regs->r1 = usp;
65 regs->kernel_mode = 0;
66}
67
68/* Free all resources held by a thread. */
69static inline void release_thread(struct task_struct *dead_task)
70{
71}
72
73/* Free all resources held by a thread. */
74static inline void exit_thread(void)
75{
76}
77
78extern unsigned long thread_saved_pc(struct task_struct *t);
79
80extern unsigned long get_wchan(struct task_struct *p);
81
82/*
83 * create a kernel thread without removing it from tasklists
84 */
85extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
86
87# define task_pt_regs(tsk) \
88 (((struct pt_regs *)(THREAD_SIZE + task_stack_page(tsk))) - 1)
89
90# define KSTK_EIP(tsk) (0)
91# define KSTK_ESP(tsk) (0)
92
93#endif /* _ASM_MICROBLAZE_PROCESSOR_H */
diff --git a/arch/microblaze/include/asm/system.h b/arch/microblaze/include/asm/system.h
new file mode 100644
index 000000000000..c4e308850b5d
--- /dev/null
+++ b/arch/microblaze/include/asm/system.h
@@ -0,0 +1,91 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SYSTEM_H
10#define _ASM_MICROBLAZE_SYSTEM_H
11
12#include <asm/registers.h>
13#include <asm/setup.h>
14#include <asm/irqflags.h>
15
16struct task_struct;
17struct thread_info;
18
19extern struct task_struct *_switch_to(struct thread_info *prev,
20 struct thread_info *next);
21
22#define switch_to(prev, next, last) \
23 do { \
24 (last) = _switch_to(task_thread_info(prev), \
25 task_thread_info(next)); \
26 } while (0)
27
28#define smp_read_barrier_depends() do {} while (0)
29#define read_barrier_depends() do {} while (0)
30
31#define nop() asm volatile ("nop")
32#define mb() barrier()
33#define rmb() mb()
34#define wmb() mb()
35#define set_mb(var, value) do { var = value; mb(); } while (0)
36#define set_wmb(var, value) do { var = value; wmb(); } while (0)
37
38#define smp_mb() mb()
39#define smp_rmb() rmb()
40#define smp_wmb() wmb()
41
42void show_trace(struct task_struct *task, unsigned long *stack);
43void __bad_xchg(volatile void *ptr, int size);
44
45static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
46 int size)
47{
48 unsigned long ret;
49 unsigned long flags;
50
51 switch (size) {
52 case 1:
53 local_irq_save(flags);
54 ret = *(volatile unsigned char *)ptr;
55 *(volatile unsigned char *)ptr = x;
56 local_irq_restore(flags);
57 break;
58
59 case 4:
60 local_irq_save(flags);
61 ret = *(volatile unsigned long *)ptr;
62 *(volatile unsigned long *)ptr = x;
63 local_irq_restore(flags);
64 break;
65 default:
66 __bad_xchg(ptr, size), ret = 0;
67 break;
68 }
69
70 return ret;
71}
72
73void disable_hlt(void);
74void enable_hlt(void);
75void default_idle(void);
76
77#define xchg(ptr, x) \
78 ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
79
80void free_init_pages(char *what, unsigned long begin, unsigned long end);
81void free_initmem(void);
82extern char *klimit;
83extern void ret_from_fork(void);
84
85#ifdef CONFIG_DEBUG_FS
86extern struct dentry *of_debugfs_root;
87#endif
88
89#define arch_align_stack(x) (x)
90
91#endif /* _ASM_MICROBLAZE_SYSTEM_H */