Commit b1a154db authored by David Howells's avatar David Howells

Disintegrate asm/system.h for CRIS

Disintegrate asm/system.h for CRIS.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Acked-by: default avatarJesper Nilsson <jesper.nilsson@axis.com>
cc: linux-cris-kernel@axis.com
parent 6a846f3f
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <linux/capability.h> #include <linux/capability.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/system.h>
#include <arch/svinto.h> #include <arch/svinto.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/rtc.h> #include <asm/rtc.h>
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <asm/etraxgpio.h> #include <asm/etraxgpio.h>
#include <arch/svinto.h> #include <arch/svinto.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/system.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <arch/io_interface_mux.h> #include <arch/io_interface_mux.h>
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <asm/etraxi2c.h> #include <asm/etraxi2c.h>
#include <asm/system.h>
#include <arch/svinto.h> #include <arch/svinto.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/delay.h> #include <asm/delay.h>
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <linux/mutex.h> #include <linux/mutex.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/rtc.h> #include <asm/rtc.h>
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <asm/io.h> #include <asm/io.h>
#include <arch/svinto.h> #include <arch/svinto.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/sync_serial.h> #include <asm/sync_serial.h>
#include <arch/io_interface_mux.h> #include <arch/io_interface_mux.h>
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include <linux/major.h> #include <linux/major.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <asm/system.h>
#include <arch/svinto.h> #include <arch/svinto.h>
#include <asm/io.h> /* Get SIMCOUT. */ #include <asm/io.h> /* Get SIMCOUT. */
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <asm/dma.h> #include <asm/dma.h>
#include <arch/svinto.h> #include <arch/svinto.h>
#include <arch/system.h>
/* Macro to access ETRAX 100 registers */ /* Macro to access ETRAX 100 registers */
#define SETS(var, reg, field, val) var = (var & ~IO_MASK_(reg##_, field##_)) | \ #define SETS(var, reg, field, val) var = (var & ~IO_MASK_(reg##_, field##_)) | \
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <arch/svinto.h> #include <arch/svinto.h>
#include <asm/io.h> #include <asm/io.h>
#include <arch/io_interface_mux.h> #include <arch/io_interface_mux.h>
#include <arch/system.h>
#define DBG(s) #define DBG(s)
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <arch/svinto.h> #include <arch/svinto.h>
#include <linux/init.h> #include <linux/init.h>
#include <arch/system.h>
#ifdef CONFIG_ETRAX_GPIO #ifdef CONFIG_ETRAX_GPIO
void etrax_gpio_wake_up_check(void); /* drivers/gpio.c */ void etrax_gpio_wake_up_check(void); /* drivers/gpio.c */
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/system.h>
#include <asm/processor.h> #include <asm/processor.h>
/* /*
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/param.h> #include <linux/param.h>
#include <arch/system.h>
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
#define HAS_FPU 0x0001 #define HAS_FPU 0x0001
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/ucontext.h> #include <asm/ucontext.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <arch/system.h>
#define DEBUG_SIG 0 #define DEBUG_SIG 0
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <arch/sv_addr_ag.h> #include <arch/sv_addr_ag.h>
#include <arch/system.h>
void void
show_registers(struct pt_regs *regs) show_registers(struct pt_regs *regs)
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <asm/etraxi2c.h> #include <asm/etraxi2c.h>
#include <asm/system.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/delay.h> #include <asm/delay.h>
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <hwregs/gio_defs.h> #include <hwregs/gio_defs.h>
#include <hwregs/intr_vect_defs.h> #include <hwregs/intr_vect_defs.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/system.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <mach/pinmux.h> #include <mach/pinmux.h>
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include <hwregs/gio_defs.h> #include <hwregs/gio_defs.h>
#include <hwregs/intr_vect_defs.h> #include <hwregs/intr_vect_defs.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/system.h>
#include <asm/irq.h> #include <asm/irq.h>
#ifdef CONFIG_ETRAX_VIRTUAL_GPIO #ifdef CONFIG_ETRAX_VIRTUAL_GPIO
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include <linux/console.h> #include <linux/console.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/system.h>
#include <hwregs/reg_rdwr.h> #include <hwregs/reg_rdwr.h>
#include <hwregs/reg_map.h> #include <hwregs/reg_map.h>
#include <hwregs/ser_defs.h> #include <hwregs/ser_defs.h>
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/system.h>
#include <hwregs/reg_map.h> #include <hwregs/reg_map.h>
#include <hwregs/reg_rdwr.h> #include <hwregs/reg_rdwr.h>
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/system.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <arch/hwregs/supp_reg.h> #include <arch/hwregs/supp_reg.h>
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <hwregs/clkgen_defs.h> #include <hwregs/clkgen_defs.h>
#include <hwregs/strmux_defs.h> #include <hwregs/strmux_defs.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <asm/system.h>
#include <arbiter.h> #include <arbiter.h>
static char used_dma_channels[MAX_DMA_CHANNELS]; static char used_dma_channels[MAX_DMA_CHANNELS];
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <hwregs/config_defs.h> #include <hwregs/config_defs.h>
#include <hwregs/strmux_defs.h> #include <hwregs/strmux_defs.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <asm/system.h>
#include <mach/arbiter.h> #include <mach/arbiter.h>
static char used_dma_channels[MAX_DMA_CHANNELS]; static char used_dma_channels[MAX_DMA_CHANNELS];
......
#ifndef __ASMCRIS_ARCH_ELF_H #ifndef __ASMCRIS_ARCH_ELF_H
#define __ASMCRIS_ARCH_ELF_H #define __ASMCRIS_ARCH_ELF_H
#include <arch/system.h>
#define ELF_MACH EF_CRIS_VARIANT_ANY_V0_V10 #define ELF_MACH EF_CRIS_VARIANT_ANY_V0_V10
/* /*
......
#ifndef _ASM_CRIS_ELF_H #ifndef _ASM_CRIS_ELF_H
#define _ASM_CRIS_ELF_H #define _ASM_CRIS_ELF_H
#include <arch/system.h>
#define ELF_CORE_EFLAGS EF_CRIS_VARIANT_V32 #define ELF_CORE_EFLAGS EF_CRIS_VARIANT_V32
/* /*
......
...@@ -34,14 +34,4 @@ static inline unsigned long rdsp(void) ...@@ -34,14 +34,4 @@ static inline unsigned long rdsp(void)
/* Write the user-mode stack pointer. */ /* Write the user-mode stack pointer. */
#define wrusp(usp) __asm__ __volatile__ ("move %0, $usp" : : "rm" (usp)) #define wrusp(usp) __asm__ __volatile__ ("move %0, $usp" : : "rm" (usp))
#define nop() __asm__ __volatile__ ("nop");
#define xchg(ptr,x) \
((__typeof__(*(ptr)))__xchg((unsigned long) (x),(ptr),sizeof(*(ptr))))
#define tas(ptr) (xchg((ptr),1))
struct __xchg_dummy { unsigned long a[100]; };
#define __xg(x) ((struct __xchg_dummy *)(x))
#endif /* _ASM_CRIS_ARCH_SYSTEM_H */ #endif /* _ASM_CRIS_ARCH_SYSTEM_H */
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/types.h> #include <linux/types.h>
#include <asm/system.h> #include <asm/cmpxchg.h>
#include <arch/atomic.h> #include <arch/atomic.h>
/* /*
......
#ifndef __ASM_CRIS_BARRIER_H
#define __ASM_CRIS_BARRIER_H
#define nop() __asm__ __volatile__ ("nop");
#define barrier() __asm__ __volatile__("": : :"memory")
#define mb() barrier()
#define rmb() mb()
#define wmb() mb()
#define read_barrier_depends() do { } while(0)
#define set_mb(var, value) do { var = value; mb(); } while (0)
#ifdef CONFIG_SMP
#define smp_mb() mb()
#define smp_rmb() rmb()
#define smp_wmb() wmb()
#define smp_read_barrier_depends() read_barrier_depends()
#else
#define smp_mb() barrier()
#define smp_rmb() barrier()
#define smp_wmb() barrier()
#define smp_read_barrier_depends() do { } while(0)
#endif
#endif /* __ASM_CRIS_BARRIER_H */
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#endif #endif
#include <arch/bitops.h> #include <arch/bitops.h>
#include <asm/system.h>
#include <linux/atomic.h> #include <linux/atomic.h>
#include <linux/compiler.h> #include <linux/compiler.h>
......
#ifndef __ASM_CRIS_CMPXCHG__
#define __ASM_CRIS_CMPXCHG__
#include <linux/irqflags.h>
static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
{
/* since Etrax doesn't have any atomic xchg instructions, we need to disable
irq's (if enabled) and do it with move.d's */
unsigned long flags,temp;
local_irq_save(flags); /* save flags, including irq enable bit and shut off irqs */
switch (size) {
case 1:
*((unsigned char *)&temp) = x;
x = *(unsigned char *)ptr;
*(unsigned char *)ptr = *((unsigned char *)&temp);
break;
case 2:
*((unsigned short *)&temp) = x;
x = *(unsigned short *)ptr;
*(unsigned short *)ptr = *((unsigned short *)&temp);
break;
case 4:
temp = x;
x = *(unsigned long *)ptr;
*(unsigned long *)ptr = temp;
break;
}
local_irq_restore(flags); /* restore irq enable bit */
return x;
}
#define xchg(ptr,x) \
((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
#define tas(ptr) (xchg((ptr),1))
#include <asm-generic/cmpxchg-local.h>
/*
* cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
* them available.
*/
#define cmpxchg_local(ptr, o, n) \
((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
(unsigned long)(n), sizeof(*(ptr))))
#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
#ifndef CONFIG_SMP
#include <asm-generic/cmpxchg.h>
#endif
#endif /* __ASM_CRIS_CMPXCHG__ */
#ifndef __ASM_CRIS_EXEC_H
#define __ASM_CRIS_EXEC_H
#define arch_align_stack(x) (x)
#endif /* __ASM_CRIS_EXEC_H */
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
#ifndef __ASM_CRIS_PROCESSOR_H #ifndef __ASM_CRIS_PROCESSOR_H
#define __ASM_CRIS_PROCESSOR_H #define __ASM_CRIS_PROCESSOR_H
#include <asm/system.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <arch/processor.h> #include <arch/processor.h>
#include <arch/system.h>
struct task_struct; struct task_struct;
...@@ -72,4 +72,13 @@ static inline void release_thread(struct task_struct *dead_task) ...@@ -72,4 +72,13 @@ static inline void release_thread(struct task_struct *dead_task)
#define cpu_relax() barrier() #define cpu_relax() barrier()
/*
* disable hlt during certain critical i/o operations
*/
#define HAVE_DISABLE_HLT
void disable_hlt(void);
void enable_hlt(void);
void default_idle(void);
#endif /* __ASM_CRIS_PROCESSOR_H */ #endif /* __ASM_CRIS_PROCESSOR_H */
#ifndef __ASM_CRIS_SWITCH_TO_H
#define __ASM_CRIS_SWITCH_TO_H
/* the switch_to macro calls resume, an asm function in entry.S which does the actual
* task switching.
*/
extern struct task_struct *resume(struct task_struct *prev, struct task_struct *next, int);
#define switch_to(prev,next,last) last = resume(prev,next, \
(int)&((struct task_struct *)0)->thread)
#endif /* __ASM_CRIS_SWITCH_TO_H */
#ifndef __ASM_CRIS_SYSTEM_H /* FILE TO BE DELETED. DO NOT ADD STUFF HERE! */
#define __ASM_CRIS_SYSTEM_H #include <asm/barrier.h>
#include <asm/cmpxchg.h>
#include <linux/irqflags.h> #include <asm/exec.h>
#include <arch/system.h> #include <asm/switch_to.h>
/* the switch_to macro calls resume, an asm function in entry.S which does the actual
* task switching.
*/
extern struct task_struct *resume(struct task_struct *prev, struct task_struct *next, int);
#define switch_to(prev,next,last) last = resume(prev,next, \
(int)&((struct task_struct *)0)->thread)
#define barrier() __asm__ __volatile__("": : :"memory")
#define mb() barrier()
#define rmb() mb()
#define wmb() mb()
#define read_barrier_depends() do { } while(0)
#define set_mb(var, value) do { var = value; mb(); } while (0)
#ifdef CONFIG_SMP
#define smp_mb() mb()
#define smp_rmb() rmb()
#define smp_wmb() wmb()
#define smp_read_barrier_depends() read_barrier_depends()
#else
#define smp_mb() barrier()
#define smp_rmb() barrier()
#define smp_wmb() barrier()
#define smp_read_barrier_depends() do { } while(0)
#endif
#define iret()
/*
* disable hlt during certain critical i/o operations
*/
#define HAVE_DISABLE_HLT
void disable_hlt(void);
void enable_hlt(void);
static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
{
/* since Etrax doesn't have any atomic xchg instructions, we need to disable
irq's (if enabled) and do it with move.d's */
unsigned long flags,temp;
local_irq_save(flags); /* save flags, including irq enable bit and shut off irqs */
switch (size) {
case 1:
*((unsigned char *)&temp) = x;
x = *(unsigned char *)ptr;
*(unsigned char *)ptr = *((unsigned char *)&temp);
break;
case 2:
*((unsigned short *)&temp) = x;
x = *(unsigned short *)ptr;
*(unsigned short *)ptr = *((unsigned short *)&temp);
break;
case 4:
temp = x;
x = *(unsigned long *)ptr;
*(unsigned long *)ptr = temp;
break;
}
local_irq_restore(flags); /* restore irq enable bit */
return x;
}
#include <asm-generic/cmpxchg-local.h>
/*
* cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
* them available.
*/
#define cmpxchg_local(ptr, o, n) \
((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
(unsigned long)(n), sizeof(*(ptr))))
#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
#ifndef CONFIG_SMP
#include <asm-generic/cmpxchg.h>
#endif
#define arch_align_stack(x) (x)
void default_idle(void);
#endif
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/io.h> #include <asm/io.h>
#include <arch/system.h>
/* called by the assembler IRQ entry functions defined in irq.h /* called by the assembler IRQ entry functions defined in irq.h
* to dispatch the interrupts to registered handlers * to dispatch the interrupts to registered handlers
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/system.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/init_task.h> #include <linux/init_task.h>
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/system.h>
#include <asm/processor.h> #include <asm/processor.h>
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/pfn.h> #include <linux/pfn.h>
#include <linux/cpu.h> #include <linux/cpu.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <arch/system.h>
/* /*
* Setup options * Setup options
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <arch/system.h>
extern void arch_enable_nmi(void); extern void arch_enable_nmi(void);
extern void stop_watchdog(void); extern void stop_watchdog(void);
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <arch/system.h>
extern int find_fixup_code(struct pt_regs *); extern int find_fixup_code(struct pt_regs *);
extern void die_if_kernel(const char *, struct pt_regs *, long); extern void die_if_kernel(const char *, struct pt_regs *, long);
......
...@@ -37,6 +37,7 @@ static char *serial_version = "$Revision: 1.25 $"; ...@@ -37,6 +37,7 @@ static char *serial_version = "$Revision: 1.25 $";
#include <asm/system.h> #include <asm/system.h>
#include <arch/svinto.h> #include <arch/svinto.h>
#include <arch/system.h>
/* non-arch dependent serial structures are in linux/serial.h */ /* non-arch dependent serial structures are in linux/serial.h */
#include <linux/serial.h> #include <linux/serial.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment