[PATCH] xtensa: remove io_remap_page_range and minor clean-ups
Remove io_remap_page_range() from all of Linux 2.6.x (as requested and suggested by Randy Dunlap) and minor clean-ups. Signed-off-by: Chris Zankel <chris@zankel.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
fac97ae0b1
commit
288a60cf4d
12 changed files with 22 additions and 64 deletions
|
@ -402,8 +402,8 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
|
|||
__pci_mmap_set_flags(dev, vma, mmap_state);
|
||||
__pci_mmap_set_pgprot(dev, vma, mmap_state, write_combine);
|
||||
|
||||
ret = io_remap_page_range(vma, vma->vm_start, vma->vm_pgoff<<PAGE_SHIFT,
|
||||
vma->vm_end - vma->vm_start, vma->vm_page_prot);
|
||||
ret = io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
|
||||
vma->vm_end - vma->vm_start,vma->vm_page_prot);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ _F(int, pcibios_fixup, (void), { return 0; });
|
|||
_F(int, get_rtc_time, (time_t* t), { return 0; });
|
||||
_F(int, set_rtc_time, (time_t t), { return 0; });
|
||||
|
||||
#if CONFIG_XTENSA_CALIBRATE_CCOUNT
|
||||
#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
|
||||
_F(void, calibrate_ccount, (void),
|
||||
{
|
||||
printk ("ERROR: Cannot calibrate cpu frequency! Assuming 100MHz.\n");
|
||||
|
|
|
@ -457,7 +457,7 @@ int
|
|||
dump_task_fpu(struct pt_regs *regs, struct task_struct *task, elf_fpregset_t *r)
|
||||
{
|
||||
/* see asm/coprocessor.h for this magic number 16 */
|
||||
#if TOTAL_CPEXTRA_SIZE > 16
|
||||
#if XTENSA_CP_EXTRA_SIZE > 16
|
||||
do_save_fpregs (r, regs, task);
|
||||
|
||||
/* For now, bit 16 means some extra state may be present: */
|
||||
|
|
|
@ -304,7 +304,7 @@ void __init setup_arch(char **cmdline_p)
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#if CONFIG_PCI
|
||||
#ifdef CONFIG_PCI
|
||||
platform_pcibios_init();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -182,7 +182,7 @@ restore_cpextra (struct _cpstate *buf)
|
|||
|
||||
struct task_struct *tsk = current;
|
||||
release_all_cp(tsk);
|
||||
return __copy_from_user(tsk->thread.cpextra, buf, TOTAL_CPEXTRA_SIZE);
|
||||
return __copy_from_user(tsk->thread.cpextra, buf, XTENSA_CP_EXTRA_SIZE);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ void __init time_init(void)
|
|||
* speed for the CALIBRATE.
|
||||
*/
|
||||
|
||||
#if CONFIG_XTENSA_CALIBRATE_CCOUNT
|
||||
#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
|
||||
printk("Calibrating CPU frequency ");
|
||||
platform_calibrate_ccount();
|
||||
printk("%d.%02d MHz\n", (int)ccount_per_jiffy/(1000000/HZ),
|
||||
|
|
|
@ -239,7 +239,7 @@ void __init mem_init(void)
|
|||
high_memory = (void *) __va(max_mapnr << PAGE_SHIFT);
|
||||
highmemsize = 0;
|
||||
|
||||
#if CONFIG_HIGHMEM
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
#error HIGHGMEM not implemented in init.c
|
||||
#endif
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ typedef struct { volatile int counter; } atomic_t;
|
|||
#include <asm/processor.h>
|
||||
#include <asm/system.h>
|
||||
|
||||
#define ATOMIC_INIT(i) ( (atomic_t) { (i) } )
|
||||
#define ATOMIC_INIT(i) { (i) }
|
||||
|
||||
/*
|
||||
* This Xtensa implementation assumes that the right mechanism
|
||||
|
|
|
@ -174,7 +174,7 @@ static __inline__ int test_bit(int nr, const volatile void *addr)
|
|||
return 1UL & (((const volatile unsigned int *)addr)[nr>>5] >> (nr&31));
|
||||
}
|
||||
|
||||
#if XCHAL_HAVE_NSAU
|
||||
#if XCHAL_HAVE_NSA
|
||||
|
||||
static __inline__ int __cntlz (unsigned long x)
|
||||
{
|
||||
|
|
|
@ -23,6 +23,7 @@ typedef struct {
|
|||
unsigned int __nmi_count; /* arch dependent */
|
||||
} ____cacheline_aligned irq_cpustat_t;
|
||||
|
||||
void ack_bad_irq(unsigned int irq);
|
||||
#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
|
||||
|
||||
#endif /* _XTENSA_HARDIRQ_H */
|
||||
|
|
|
@ -20,28 +20,19 @@ struct semaphore {
|
|||
atomic_t count;
|
||||
int sleepers;
|
||||
wait_queue_head_t wait;
|
||||
#if WAITQUEUE_DEBUG
|
||||
long __magic;
|
||||
#endif
|
||||
};
|
||||
|
||||
#if WAITQUEUE_DEBUG
|
||||
# define __SEM_DEBUG_INIT(name) \
|
||||
, (int)&(name).__magic
|
||||
#else
|
||||
# define __SEM_DEBUG_INIT(name)
|
||||
#endif
|
||||
#define __SEMAPHORE_INITIALIZER(name,n) \
|
||||
{ \
|
||||
.count = ATOMIC_INIT(n), \
|
||||
.sleepers = 0, \
|
||||
.wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \
|
||||
}
|
||||
|
||||
#define __SEMAPHORE_INITIALIZER(name,count) \
|
||||
{ ATOMIC_INIT(count), \
|
||||
0, \
|
||||
__WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \
|
||||
__SEM_DEBUG_INIT(name) }
|
||||
|
||||
#define __MUTEX_INITIALIZER(name) \
|
||||
#define __MUTEX_INITIALIZER(name) \
|
||||
__SEMAPHORE_INITIALIZER(name, 1)
|
||||
|
||||
#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
|
||||
#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
|
||||
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
|
||||
|
||||
#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
|
||||
|
@ -49,17 +40,8 @@ struct semaphore {
|
|||
|
||||
static inline void sema_init (struct semaphore *sem, int val)
|
||||
{
|
||||
/*
|
||||
* *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val);
|
||||
*
|
||||
* i'd rather use the more flexible initialization above, but sadly
|
||||
* GCC 2.7.2.3 emits a bogus warning. EGCS doesnt. Oh well.
|
||||
*/
|
||||
atomic_set(&sem->count, val);
|
||||
init_waitqueue_head(&sem->wait);
|
||||
#if WAITQUEUE_DEBUG
|
||||
sem->__magic = (int)&sem->__magic;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void init_MUTEX (struct semaphore *sem)
|
||||
|
@ -81,9 +63,7 @@ extern spinlock_t semaphore_wake_lock;
|
|||
|
||||
static inline void down(struct semaphore * sem)
|
||||
{
|
||||
#if WAITQUEUE_DEBUG
|
||||
CHECK_MAGIC(sem->__magic);
|
||||
#endif
|
||||
might_sleep();
|
||||
|
||||
if (atomic_sub_return(1, &sem->count) < 0)
|
||||
__down(sem);
|
||||
|
@ -92,9 +72,8 @@ static inline void down(struct semaphore * sem)
|
|||
static inline int down_interruptible(struct semaphore * sem)
|
||||
{
|
||||
int ret = 0;
|
||||
#if WAITQUEUE_DEBUG
|
||||
CHECK_MAGIC(sem->__magic);
|
||||
#endif
|
||||
|
||||
might_sleep();
|
||||
|
||||
if (atomic_sub_return(1, &sem->count) < 0)
|
||||
ret = __down_interruptible(sem);
|
||||
|
@ -104,9 +83,6 @@ static inline int down_interruptible(struct semaphore * sem)
|
|||
static inline int down_trylock(struct semaphore * sem)
|
||||
{
|
||||
int ret = 0;
|
||||
#if WAITQUEUE_DEBUG
|
||||
CHECK_MAGIC(sem->__magic);
|
||||
#endif
|
||||
|
||||
if (atomic_sub_return(1, &sem->count) < 0)
|
||||
ret = __down_trylock(sem);
|
||||
|
@ -119,9 +95,6 @@ static inline int down_trylock(struct semaphore * sem)
|
|||
*/
|
||||
static inline void up(struct semaphore * sem)
|
||||
{
|
||||
#if WAITQUEUE_DEBUG
|
||||
CHECK_MAGIC(sem->__magic);
|
||||
#endif
|
||||
if (atomic_add_return(1, &sem->count) <= 0)
|
||||
__up(sem);
|
||||
}
|
||||
|
|
|
@ -189,20 +189,6 @@ static inline unsigned long xchg_u32(volatile int * m, unsigned long val)
|
|||
|
||||
#define tas(ptr) (xchg((ptr),1))
|
||||
|
||||
#if ( __XCC__ == 1 )
|
||||
|
||||
/* xt-xcc processes __inline__ differently than xt-gcc and decides to
|
||||
* insert an out-of-line copy of function __xchg. This presents the
|
||||
* unresolved symbol at link time of __xchg_called_with_bad_pointer,
|
||||
* even though such a function would never be called at run-time.
|
||||
* xt-gcc always inlines __xchg, and optimizes away the undefined
|
||||
* bad_pointer function.
|
||||
*/
|
||||
|
||||
#define xchg(ptr,x) xchg_u32(ptr,x)
|
||||
|
||||
#else /* assume xt-gcc */
|
||||
|
||||
#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
|
||||
|
||||
/*
|
||||
|
@ -224,8 +210,6 @@ __xchg(unsigned long x, volatile void * ptr, int size)
|
|||
return x;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
extern void set_except_vector(int n, void *addr);
|
||||
|
||||
static inline void spill_registers(void)
|
||||
|
|
Loading…
Reference in a new issue