diff options
Diffstat (limited to 'arch/blackfin/kernel')
-rw-r--r-- | arch/blackfin/kernel/dma-mapping.c | 23 | ||||
-rw-r--r-- | arch/blackfin/kernel/process.c | 11 | ||||
-rw-r--r-- | arch/blackfin/kernel/signal.c | 12 | ||||
-rw-r--r-- | arch/blackfin/kernel/time-ts.c | 6 | ||||
-rw-r--r-- | arch/blackfin/kernel/time.c | 6 |
5 files changed, 15 insertions, 43 deletions
diff --git a/arch/blackfin/kernel/dma-mapping.c b/arch/blackfin/kernel/dma-mapping.c index e7be6532d6a..df437e52d9d 100644 --- a/arch/blackfin/kernel/dma-mapping.c +++ b/arch/blackfin/kernel/dma-mapping.c @@ -13,6 +13,7 @@ #include <linux/dma-mapping.h> #include <linux/scatterlist.h> #include <linux/export.h> +#include <linux/bitmap.h> static spinlock_t dma_page_lock; static unsigned long *dma_page; @@ -46,24 +47,17 @@ static inline unsigned int get_pages(size_t size) static unsigned long __alloc_dma_pages(unsigned int pages) { unsigned long ret = 0, flags; - int i, count = 0; + unsigned long start; if (dma_initialized == 0) dma_alloc_init(_ramend - DMA_UNCACHED_REGION, _ramend); spin_lock_irqsave(&dma_page_lock, flags); - for (i = 0; i < dma_pages;) { - if (test_bit(i++, dma_page) == 0) { - if (++count == pages) { - while (count--) - __set_bit(--i, dma_page); - - ret = dma_base + (i << PAGE_SHIFT); - break; - } - } else - count = 0; + start = bitmap_find_next_zero_area(dma_page, dma_pages, 0, pages, 0); + if (start < dma_pages) { + ret = dma_base + (start << PAGE_SHIFT); + bitmap_set(dma_page, start, pages); } spin_unlock_irqrestore(&dma_page_lock, flags); return ret; @@ -73,7 +67,6 @@ static void __free_dma_pages(unsigned long addr, unsigned int pages) { unsigned long page = (addr - dma_base) >> PAGE_SHIFT; unsigned long flags; - int i; if ((page + pages) > dma_pages) { printk(KERN_ERR "%s: freeing outside range.\n", __func__); @@ -81,9 +74,7 @@ static void __free_dma_pages(unsigned long addr, unsigned int pages) } spin_lock_irqsave(&dma_page_lock, flags); - for (i = page; i < page + pages; i++) - __clear_bit(i, dma_page); - + bitmap_clear(dma_page, page, pages); spin_unlock_irqrestore(&dma_page_lock, flags); } diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c index 3e16ad9b0a9..9782c0329c1 100644 --- a/arch/blackfin/kernel/process.c +++ b/arch/blackfin/kernel/process.c @@ -39,12 +39,6 @@ int nr_l1stack_tasks; void *l1_stack_base; unsigned long l1_stack_len; -/* - * Powermanagement idle function, if any.. - */ -void (*pm_idle)(void) = NULL; -EXPORT_SYMBOL(pm_idle); - void (*pm_power_off)(void) = NULL; EXPORT_SYMBOL(pm_power_off); @@ -81,18 +75,15 @@ void cpu_idle(void) { /* endless idle loop with no priority at all */ while (1) { - void (*idle)(void) = pm_idle; #ifdef CONFIG_HOTPLUG_CPU if (cpu_is_offline(smp_processor_id())) cpu_die(); #endif - if (!idle) - idle = default_idle; tick_nohz_idle_enter(); rcu_idle_enter(); while (!need_resched()) - idle(); + default_idle(); rcu_idle_exit(); tick_nohz_idle_exit(); preempt_enable_no_resched(); diff --git a/arch/blackfin/kernel/signal.c b/arch/blackfin/kernel/signal.c index 84b4be05840..b022af6c48f 100644 --- a/arch/blackfin/kernel/signal.c +++ b/arch/blackfin/kernel/signal.c @@ -37,11 +37,6 @@ struct rt_sigframe { struct ucontext uc; }; -asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) -{ - return do_sigaltstack(uss, uoss, rdusp()); -} - static inline int rt_restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *pr0) { @@ -100,7 +95,7 @@ asmlinkage int sys_rt_sigreturn(void) if (rt_restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) goto badframe; - if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->usp) == -EFAULT) + if (restore_altstack(&frame->uc.uc_stack)) goto badframe; return r0; @@ -178,10 +173,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t * info, /* Create the ucontext. */ err |= __put_user(0, &frame->uc.uc_flags); err |= __put_user(0, &frame->uc.uc_link); - err |= - __put_user((void *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); - err |= __put_user(sas_ss_flags(rdusp()), &frame->uc.uc_stack.ss_flags); - err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); + err |= __save_altstack(&frame->uc.uc_stack, rdusp()); err |= rt_setup_sigcontext(&frame->uc.uc_mcontext, regs); err |= copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); diff --git a/arch/blackfin/kernel/time-ts.c b/arch/blackfin/kernel/time-ts.c index f608f02f29a..cb0a4845339 100644 --- a/arch/blackfin/kernel/time-ts.c +++ b/arch/blackfin/kernel/time-ts.c @@ -329,12 +329,6 @@ void bfin_coretmr_clockevent_init(void) evt->broadcast = smp_timer_broadcast; #endif - -#ifdef CONFIG_SMP - evt->broadcast = smp_timer_broadcast; -#endif - - evt->name = "bfin_core_timer"; evt->rating = 350; evt->irq = -1; diff --git a/arch/blackfin/kernel/time.c b/arch/blackfin/kernel/time.c index 2310b249675..3126b920a4a 100644 --- a/arch/blackfin/kernel/time.c +++ b/arch/blackfin/kernel/time.c @@ -85,7 +85,7 @@ time_sched_init(irqreturn_t(*timer_routine) (int, void *)) /* * Should return useconds since last timer tick */ -u32 arch_gettimeoffset(void) +static u32 blackfin_gettimeoffset(void) { unsigned long offset; unsigned long clocks_per_jiffy; @@ -141,6 +141,10 @@ void read_persistent_clock(struct timespec *ts) void __init time_init(void) { +#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET + arch_gettimeoffset = blackfin_gettimeoffset; +#endif + #ifdef CONFIG_RTC_DRV_BFIN /* [#2663] hack to filter junk RTC values that would cause * userspace to have to deal with time values greater than |