diff options
author | Imre Kaloz <kaloz@openwrt.org> | 2010-02-23 10:43:53 +0000 |
---|---|---|
committer | Imre Kaloz <kaloz@openwrt.org> | 2010-02-23 10:43:53 +0000 |
commit | 437f2bd5c1001f30bc06ee334f7935d0e4de2551 (patch) | |
tree | 1bb5fdbd5fee299548456da1d002b47563a78974 /target/linux/ubicom32/files/arch | |
parent | f53f060299aa3c03f0a476178704e9bd69cb3179 (diff) | |
download | mtk-20170518-437f2bd5c1001f30bc06ee334f7935d0e4de2551.zip mtk-20170518-437f2bd5c1001f30bc06ee334f7935d0e4de2551.tar.gz mtk-20170518-437f2bd5c1001f30bc06ee334f7935d0e4de2551.tar.bz2 |
add 2.6.32 support
SVN-Revision: 19823
Diffstat (limited to 'target/linux/ubicom32/files/arch')
8 files changed, 42 insertions, 11 deletions
diff --git a/target/linux/ubicom32/files/arch/ubicom32/include/asm/atomic.h b/target/linux/ubicom32/files/arch/ubicom32/include/asm/atomic.h index 78d9fcd..aaf7726 100644 --- a/target/linux/ubicom32/files/arch/ubicom32/include/asm/atomic.h +++ b/target/linux/ubicom32/files/arch/ubicom32/include/asm/atomic.h @@ -236,7 +236,12 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u) #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) +#include <linux/version.h> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) +#include <asm-generic/atomic-long.h> +#else #include <asm-generic/atomic.h> +#endif /* * The following is not a real function. The compiler should remove the function diff --git a/target/linux/ubicom32/files/arch/ubicom32/include/asm/bitsperlong.h b/target/linux/ubicom32/files/arch/ubicom32/include/asm/bitsperlong.h new file mode 100644 index 0000000..6dc0bb0 --- /dev/null +++ b/target/linux/ubicom32/files/arch/ubicom32/include/asm/bitsperlong.h @@ -0,0 +1 @@ +#include <asm-generic/bitsperlong.h> diff --git a/target/linux/ubicom32/files/arch/ubicom32/include/asm/page.h b/target/linux/ubicom32/files/arch/ubicom32/include/asm/page.h index 89c6ce6..1ecb174 100644 --- a/target/linux/ubicom32/files/arch/ubicom32/include/asm/page.h +++ b/target/linux/ubicom32/files/arch/ubicom32/include/asm/page.h @@ -28,10 +28,12 @@ #ifndef _ASM_UBICOM32_PAGE_H #define _ASM_UBICOM32_PAGE_H +#include <linux/const.h> + /* PAGE_SHIFT determines the page size */ -#define PAGE_SHIFT 12 -#define PAGE_SIZE (1 << PAGE_SHIFT) +#define PAGE_SHIFT (12) +#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) #define PAGE_MASK (~(PAGE_SIZE-1)) #include <asm/setup.h> @@ -99,7 +101,15 @@ extern unsigned long memory_end; #endif /* __ASSEMBLY__ */ -#ifdef __KERNEL__ +#define VM_DATA_DEFAULT_FLAGS \ + (VM_READ | VM_WRITE | \ + ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \ + VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) + +#include <linux/version.h> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) +#include <asm-generic/getorder.h> +#else #include <asm-generic/page.h> #endif diff --git a/target/linux/ubicom32/files/arch/ubicom32/include/asm/pgtable.h b/target/linux/ubicom32/files/arch/ubicom32/include/asm/pgtable.h index 70ad115..ffb30a9 100644 --- a/target/linux/ubicom32/files/arch/ubicom32/include/asm/pgtable.h +++ b/target/linux/ubicom32/files/arch/ubicom32/include/asm/pgtable.h @@ -114,11 +114,15 @@ extern inline void flush_pages_to_ram (unsigned long address, int n) #define VMALLOC_START 0 #define VMALLOC_END 0xffffffff +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) +#include <asm-generic/pgtable.h> +#else #define arch_enter_lazy_mmu_mode() do {} while (0) #define arch_leave_lazy_mmu_mode() do {} while (0) #define arch_flush_lazy_mmu_mode() do {} while (0) #define arch_enter_lazy_cpu_mode() do {} while (0) #define arch_leave_lazy_cpu_mode() do {} while (0) #define arch_flush_lazy_cpu_mode() do {} while (0) +#endif #endif /* _ASM_UBICOM32_PGTABLE_H */ diff --git a/target/linux/ubicom32/files/arch/ubicom32/include/asm/signal.h b/target/linux/ubicom32/files/arch/ubicom32/include/asm/signal.h index a334e19..946b3f7 100644 --- a/target/linux/ubicom32/files/arch/ubicom32/include/asm/signal.h +++ b/target/linux/ubicom32/files/arch/ubicom32/include/asm/signal.h @@ -124,7 +124,12 @@ typedef struct { #define MINSIGSTKSZ 2048 #define SIGSTKSZ 8192 +#include <linux/version.h> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) +#include <asm-generic/signal-defs.h> +#else #include <asm-generic/signal.h> +#endif #ifdef __KERNEL__ struct old_sigaction { diff --git a/target/linux/ubicom32/files/arch/ubicom32/include/asm/socket.h b/target/linux/ubicom32/files/arch/ubicom32/include/asm/socket.h index 2d95c24..24ac113 100644 --- a/target/linux/ubicom32/files/arch/ubicom32/include/asm/socket.h +++ b/target/linux/ubicom32/files/arch/ubicom32/include/asm/socket.h @@ -84,4 +84,7 @@ #define SO_TIMESTAMPING 37 #define SCM_TIMESTAMPING SO_TIMESTAMPING +#define SO_PROTOCOL 38 +#define SO_DOMAIN 39 + #endif /* _ASM_UBICOM32_SOCKET_H */ diff --git a/target/linux/ubicom32/files/arch/ubicom32/kernel/init_task.c b/target/linux/ubicom32/files/arch/ubicom32/kernel/init_task.c index ff06344..58baf52 100644 --- a/target/linux/ubicom32/files/arch/ubicom32/kernel/init_task.c +++ b/target/linux/ubicom32/files/arch/ubicom32/kernel/init_task.c @@ -34,12 +34,15 @@ #include <linux/mqueue.h> #include <linux/uaccess.h> #include <asm/pgtable.h> +#include <linux/version.h> ///static struct fs_struct init_fs = INIT_FS; static struct signal_struct init_signals = INIT_SIGNALS(init_signals); static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) struct mm_struct init_mm = INIT_MM(init_mm); EXPORT_SYMBOL(init_mm); +#endif /* * Initial task structure. diff --git a/target/linux/ubicom32/files/arch/ubicom32/kernel/timer_device.c b/target/linux/ubicom32/files/arch/ubicom32/kernel/timer_device.c index d2d094d..1943cbb 100644 --- a/target/linux/ubicom32/files/arch/ubicom32/kernel/timer_device.c +++ b/target/linux/ubicom32/files/arch/ubicom32/kernel/timer_device.c @@ -169,7 +169,7 @@ static struct clocksource timer_device_clockbase = { * timer_device_alloc_event() * Allocate a timer device event. */ -static int timer_device_alloc_event(const char *name, int cpuid, const cpumask_t *mask) +static int timer_device_alloc_event(const char *name, int cpuid, const struct cpumask *cpumask) { struct clock_event_device *dev; struct irqaction *action; @@ -208,10 +208,10 @@ static int timer_device_alloc_event(const char *name, int cpuid, const cpumask_t action->name = name; action->flags = IRQF_DISABLED | IRQF_TIMER; action->handler = timer_device_event; - cpumask_copy(&action->mask, mask); + //cpumask_copy(&action->mask, mask); action->dev_id = dev; setup_irq(dev->irq, action); - irq_set_affinity(dev->irq, mask); + irq_set_affinity(dev->irq, cpumask); ldsr_disable_vector(dev->irq); /* @@ -229,7 +229,7 @@ static int timer_device_alloc_event(const char *name, int cpuid, const cpumask_t dev->mult = div_sc(frequency, NSEC_PER_SEC, dev->shift); dev->max_delta_ns = clockevent_delta2ns(0xffffffff, dev); dev->min_delta_ns = clockevent_delta2ns(100, dev); - dev->cpumask = mask; + //dev->cpumask = mask; printk(KERN_NOTICE "timer[%d]: %s - created\n", dev->irq, dev->name); /* @@ -246,7 +246,7 @@ static int timer_device_alloc_event(const char *name, int cpuid, const cpumask_t */ int __cpuinit local_timer_setup(unsigned int cpu) { - return timer_device_alloc_event("timer-cpu", cpu, cpumask_of(cpu)); + return timer_device_alloc_event("timer-cpu", cpu); } #endif @@ -283,19 +283,19 @@ void timer_device_init(void) /* * Always allocate a primary timer. */ - timer_device_alloc_event("timer-primary", -1, CPU_MASK_ALL_PTR); + timer_device_alloc_event("timer-primary", -1, cpu_all_mask); #if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) /* * If BROADCAST is selected we need to add a broadcast timer. */ - timer_device_alloc_event("timer-broadcast", -1, CPU_MASK_ALL_PTR); + timer_device_alloc_event("timer-broadcast", -1, cpu_all_mask); #endif /* * Allocate extra timers that are requested. */ for (i = 0; i < CONFIG_TIMER_EXTRA_ALLOC; i++) { - timer_device_alloc_event("timer-extra", -1, CPU_MASK_ALL_PTR); + timer_device_alloc_event("timer-extra", -1, cpu_all_mask); } } |