Skip to content

Commit c40d04d

Browse files
committed
Disintegrate asm/system.h for Microblaze
Disintegrate asm/system.h for Microblaze. Not compiled. Signed-off-by: David Howells <dhowells@redhat.com> cc: microblaze-uclinux@itee.uq.edu.au
1 parent 803f691 commit c40d04d

17 files changed

Lines changed: 129 additions & 107 deletions

File tree

‎arch/microblaze/include/asm/atomic.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef _ASM_MICROBLAZE_ATOMIC_H
22
#define _ASM_MICROBLAZE_ATOMIC_H
33

4+
#include <asm/cmpxchg.h>
45
#include <asm-generic/atomic.h>
56
#include <asm-generic/atomic64.h>
67

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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_BARRIER_H
10+
#define _ASM_MICROBLAZE_BARRIER_H
11+
12+
#define nop() asm volatile ("nop")
13+
14+
#define smp_read_barrier_depends() do {} while (0)
15+
#define read_barrier_depends() do {} while (0)
16+
17+
#define mb() barrier()
18+
#define rmb() mb()
19+
#define wmb() mb()
20+
#define set_mb(var, value) do { var = value; mb(); } while (0)
21+
#define set_wmb(var, value) do { var = value; wmb(); } while (0)
22+
23+
#define smp_mb() mb()
24+
#define smp_rmb() rmb()
25+
#define smp_wmb() wmb()
26+
27+
#endif /* _ASM_MICROBLAZE_BARRIER_H */
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#ifndef _ASM_MICROBLAZE_CMPXCHG_H
2+
#define _ASM_MICROBLAZE_CMPXCHG_H
3+
4+
void __bad_xchg(volatile void *ptr, int size);
5+
6+
static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
7+
int size)
8+
{
9+
unsigned long ret;
10+
unsigned long flags;
11+
12+
switch (size) {
13+
case 1:
14+
local_irq_save(flags);
15+
ret = *(volatile unsigned char *)ptr;
16+
*(volatile unsigned char *)ptr = x;
17+
local_irq_restore(flags);
18+
break;
19+
20+
case 4:
21+
local_irq_save(flags);
22+
ret = *(volatile unsigned long *)ptr;
23+
*(volatile unsigned long *)ptr = x;
24+
local_irq_restore(flags);
25+
break;
26+
default:
27+
__bad_xchg(ptr, size), ret = 0;
28+
break;
29+
}
30+
31+
return ret;
32+
}
33+
34+
#define xchg(ptr, x) \
35+
((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
36+
37+
#include <asm-generic/cmpxchg.h>
38+
#include <asm-generic/cmpxchg-local.h>
39+
40+
#endif /* _ASM_MICROBLAZE_CMPXCHG_H */

‎arch/microblaze/include/asm/exec.h‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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_EXEC_H
10+
#define _ASM_MICROBLAZE_EXEC_H
11+
12+
#define arch_align_stack(x) (x)
13+
14+
#endif /* _ASM_MICROBLAZE_EXEC_H */

‎arch/microblaze/include/asm/processor.h‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ struct thread_struct {
125125
.pgdir = swapper_pg_dir, \
126126
}
127127

128-
129128
/* Free all resources held by a thread. */
130129
extern inline void release_thread(struct task_struct *dead_task)
131130
{
@@ -144,6 +143,8 @@ static inline void exit_thread(void)
144143

145144
unsigned long get_wchan(struct task_struct *p);
146145

146+
extern void ret_from_fork(void);
147+
147148
/* The size allocated for kernel stacks. This _must_ be a power of two! */
148149
# define KERNEL_STACK_SIZE 0x2000
149150

@@ -166,6 +167,14 @@ unsigned long get_wchan(struct task_struct *p);
166167
# define STACK_TOP TASK_SIZE
167168
# define STACK_TOP_MAX STACK_TOP
168169

170+
void disable_hlt(void);
171+
void enable_hlt(void);
172+
void default_idle(void);
173+
174+
#ifdef CONFIG_DEBUG_FS
175+
extern struct dentry *of_debugfs_root;
176+
#endif
177+
169178
# endif /* __ASSEMBLY__ */
170179
# endif /* CONFIG_MMU */
171180
#endif /* _ASM_MICROBLAZE_PROCESSOR_H */

‎arch/microblaze/include/asm/setup.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ extern unsigned int boot_cpuid; /* move to smp.h */
2020

2121
extern char cmd_line[COMMAND_LINE_SIZE];
2222

23+
extern char *klimit;
24+
2325
void early_printk(const char *fmt, ...);
2426

2527
int setup_early_printk(char *opt);
@@ -46,6 +48,10 @@ void machine_shutdown(void);
4648
void machine_halt(void);
4749
void machine_power_off(void);
4850

51+
void free_init_pages(char *what, unsigned long begin, unsigned long end);
52+
extern void *alloc_maybe_bootmem(size_t size, gfp_t mask);
53+
extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
54+
4955
# endif/* __KERNEL__ */
5056
# endif /* __ASSEMBLY__ */
5157
#endif /* _ASM_MICROBLAZE_SETUP_H */
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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_SWITCH_TO_H
10+
#define _ASM_MICROBLAZE_SWITCH_TO_H
11+
12+
struct task_struct;
13+
struct thread_info;
14+
15+
extern struct task_struct *_switch_to(struct thread_info *prev,
16+
struct thread_info *next);
17+
18+
#define switch_to(prev, next, last) \
19+
do { \
20+
(last) = _switch_to(task_thread_info(prev), \
21+
task_thread_info(next)); \
22+
} while (0)
23+
24+
#endif /* _ASM_MICROBLAZE_SWITCH_TO_H */
Lines changed: 7 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,7 @@
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-
#include <asm/cache.h>
16-
17-
#include <asm-generic/cmpxchg.h>
18-
#include <asm-generic/cmpxchg-local.h>
19-
20-
struct task_struct;
21-
struct thread_info;
22-
23-
extern struct task_struct *_switch_to(struct thread_info *prev,
24-
struct thread_info *next);
25-
26-
#define switch_to(prev, next, last) \
27-
do { \
28-
(last) = _switch_to(task_thread_info(prev), \
29-
task_thread_info(next)); \
30-
} while (0)
31-
32-
#define smp_read_barrier_depends() do {} while (0)
33-
#define read_barrier_depends() do {} while (0)
34-
35-
#define nop() asm volatile ("nop")
36-
#define mb() barrier()
37-
#define rmb() mb()
38-
#define wmb() mb()
39-
#define set_mb(var, value) do { var = value; mb(); } while (0)
40-
#define set_wmb(var, value) do { var = value; wmb(); } while (0)
41-
42-
#define smp_mb() mb()
43-
#define smp_rmb() rmb()
44-
#define smp_wmb() wmb()
45-
46-
void __bad_xchg(volatile void *ptr, int size);
47-
48-
static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
49-
int size)
50-
{
51-
unsigned long ret;
52-
unsigned long flags;
53-
54-
switch (size) {
55-
case 1:
56-
local_irq_save(flags);
57-
ret = *(volatile unsigned char *)ptr;
58-
*(volatile unsigned char *)ptr = x;
59-
local_irq_restore(flags);
60-
break;
61-
62-
case 4:
63-
local_irq_save(flags);
64-
ret = *(volatile unsigned long *)ptr;
65-
*(volatile unsigned long *)ptr = x;
66-
local_irq_restore(flags);
67-
break;
68-
default:
69-
__bad_xchg(ptr, size), ret = 0;
70-
break;
71-
}
72-
73-
return ret;
74-
}
75-
76-
void disable_hlt(void);
77-
void enable_hlt(void);
78-
void default_idle(void);
79-
80-
#define xchg(ptr, x) \
81-
((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
82-
83-
void free_init_pages(char *what, unsigned long begin, unsigned long end);
84-
void free_initmem(void);
85-
extern char *klimit;
86-
extern void ret_from_fork(void);
87-
88-
extern void *alloc_maybe_bootmem(size_t size, gfp_t mask);
89-
extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
90-
91-
#ifdef CONFIG_DEBUG_FS
92-
extern struct dentry *of_debugfs_root;
93-
#endif
94-
95-
#define arch_align_stack(x) (x)
96-
97-
#endif /* _ASM_MICROBLAZE_SYSTEM_H */
1+
/* FILE TO BE DELETED. DO NOT ADD STUFF HERE! */
2+
#include <asm/barrier.h>
3+
#include <asm/cmpxchg.h>
4+
#include <asm/exec.h>
5+
#include <asm/special_insns.h>
6+
#include <asm/switch_to.h>
7+
extern void free_initmem(void);

‎arch/microblaze/kernel/cpu/pvr.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#include <linux/kernel.h>
1414
#include <linux/compiler.h>
15-
#include <asm/system.h>
1615
#include <asm/exceptions.h>
1716
#include <asm/pvr.h>
1817

‎arch/microblaze/kernel/microblaze_ksyms.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <asm/cacheflush.h>
1919
#include <linux/io.h>
2020
#include <asm/page.h>
21-
#include <asm/system.h>
2221
#include <linux/ftrace.h>
2322
#include <linux/uaccess.h>
2423

0 commit comments

Comments
 (0)