Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: Documentation/feature-removal-schedule.txt drivers/scsi/fcoe/fcoe.c net/core/drop_monitor.c net/core/net-traces.c
This commit is contained in:
@@ -8,3 +8,4 @@ header-y += mtd/
|
||||
header-y += rdma/
|
||||
header-y += video/
|
||||
header-y += drm/
|
||||
header-y += xen/
|
||||
|
||||
@@ -1,11 +1,33 @@
|
||||
header-y += auxvec.h
|
||||
header-y += bitsperlong.h
|
||||
header-y += errno-base.h
|
||||
header-y += errno.h
|
||||
header-y += fcntl.h
|
||||
header-y += ioctl.h
|
||||
header-y += ioctls.h
|
||||
header-y += ipcbuf.h
|
||||
header-y += mman-common.h
|
||||
header-y += mman.h
|
||||
header-y += msgbuf.h
|
||||
header-y += param.h
|
||||
header-y += poll.h
|
||||
header-y += posix_types.h
|
||||
header-y += sembuf.h
|
||||
header-y += setup.h
|
||||
header-y += shmbuf.h
|
||||
header-y += shmparam.h
|
||||
header-y += signal-defs.h
|
||||
header-y += signal.h
|
||||
header-y += socket.h
|
||||
header-y += sockios.h
|
||||
header-y += stat.h
|
||||
header-y += statfs.h
|
||||
header-y += swab.h
|
||||
header-y += termbits.h
|
||||
header-y += termios.h
|
||||
header-y += types.h
|
||||
header-y += ucontext.h
|
||||
header-y += unistd.h
|
||||
|
||||
unifdef-y += int-l64.h
|
||||
unifdef-y += int-ll64.h
|
||||
|
||||
@@ -9,6 +9,7 @@ unifdef-y += a.out.h
|
||||
endif
|
||||
unifdef-y += auxvec.h
|
||||
unifdef-y += byteorder.h
|
||||
unifdef-y += bitsperlong.h
|
||||
unifdef-y += errno.h
|
||||
unifdef-y += fcntl.h
|
||||
unifdef-y += ioctl.h
|
||||
|
||||
@@ -0,0 +1,258 @@
|
||||
#ifndef _ASM_GENERIC_ATOMIC_LONG_H
|
||||
#define _ASM_GENERIC_ATOMIC_LONG_H
|
||||
/*
|
||||
* Copyright (C) 2005 Silicon Graphics, Inc.
|
||||
* Christoph Lameter
|
||||
*
|
||||
* Allows to provide arch independent atomic definitions without the need to
|
||||
* edit all arch specific atomic.h files.
|
||||
*/
|
||||
|
||||
#include <asm/types.h>
|
||||
|
||||
/*
|
||||
* Suppport for atomic_long_t
|
||||
*
|
||||
* Casts for parameters are avoided for existing atomic functions in order to
|
||||
* avoid issues with cast-as-lval under gcc 4.x and other limitations that the
|
||||
* macros of a platform may have.
|
||||
*/
|
||||
|
||||
#if BITS_PER_LONG == 64
|
||||
|
||||
typedef atomic64_t atomic_long_t;
|
||||
|
||||
#define ATOMIC_LONG_INIT(i) ATOMIC64_INIT(i)
|
||||
|
||||
static inline long atomic_long_read(atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
return (long)atomic64_read(v);
|
||||
}
|
||||
|
||||
static inline void atomic_long_set(atomic_long_t *l, long i)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
atomic64_set(v, i);
|
||||
}
|
||||
|
||||
static inline void atomic_long_inc(atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
atomic64_inc(v);
|
||||
}
|
||||
|
||||
static inline void atomic_long_dec(atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
atomic64_dec(v);
|
||||
}
|
||||
|
||||
static inline void atomic_long_add(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
atomic64_add(i, v);
|
||||
}
|
||||
|
||||
static inline void atomic_long_sub(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
atomic64_sub(i, v);
|
||||
}
|
||||
|
||||
static inline int atomic_long_sub_and_test(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
return atomic64_sub_and_test(i, v);
|
||||
}
|
||||
|
||||
static inline int atomic_long_dec_and_test(atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
return atomic64_dec_and_test(v);
|
||||
}
|
||||
|
||||
static inline int atomic_long_inc_and_test(atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
return atomic64_inc_and_test(v);
|
||||
}
|
||||
|
||||
static inline int atomic_long_add_negative(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
return atomic64_add_negative(i, v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_add_return(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
return (long)atomic64_add_return(i, v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_sub_return(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
return (long)atomic64_sub_return(i, v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_inc_return(atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
return (long)atomic64_inc_return(v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_dec_return(atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
return (long)atomic64_dec_return(v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
return (long)atomic64_add_unless(v, a, u);
|
||||
}
|
||||
|
||||
#define atomic_long_inc_not_zero(l) atomic64_inc_not_zero((atomic64_t *)(l))
|
||||
|
||||
#define atomic_long_cmpxchg(l, old, new) \
|
||||
(atomic64_cmpxchg((atomic64_t *)(l), (old), (new)))
|
||||
#define atomic_long_xchg(v, new) \
|
||||
(atomic64_xchg((atomic64_t *)(v), (new)))
|
||||
|
||||
#else /* BITS_PER_LONG == 64 */
|
||||
|
||||
typedef atomic_t atomic_long_t;
|
||||
|
||||
#define ATOMIC_LONG_INIT(i) ATOMIC_INIT(i)
|
||||
static inline long atomic_long_read(atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return (long)atomic_read(v);
|
||||
}
|
||||
|
||||
static inline void atomic_long_set(atomic_long_t *l, long i)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
atomic_set(v, i);
|
||||
}
|
||||
|
||||
static inline void atomic_long_inc(atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
atomic_inc(v);
|
||||
}
|
||||
|
||||
static inline void atomic_long_dec(atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
atomic_dec(v);
|
||||
}
|
||||
|
||||
static inline void atomic_long_add(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
atomic_add(i, v);
|
||||
}
|
||||
|
||||
static inline void atomic_long_sub(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
atomic_sub(i, v);
|
||||
}
|
||||
|
||||
static inline int atomic_long_sub_and_test(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return atomic_sub_and_test(i, v);
|
||||
}
|
||||
|
||||
static inline int atomic_long_dec_and_test(atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return atomic_dec_and_test(v);
|
||||
}
|
||||
|
||||
static inline int atomic_long_inc_and_test(atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return atomic_inc_and_test(v);
|
||||
}
|
||||
|
||||
static inline int atomic_long_add_negative(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return atomic_add_negative(i, v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_add_return(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return (long)atomic_add_return(i, v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_sub_return(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return (long)atomic_sub_return(i, v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_inc_return(atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return (long)atomic_inc_return(v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_dec_return(atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return (long)atomic_dec_return(v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return (long)atomic_add_unless(v, a, u);
|
||||
}
|
||||
|
||||
#define atomic_long_inc_not_zero(l) atomic_inc_not_zero((atomic_t *)(l))
|
||||
|
||||
#define atomic_long_cmpxchg(l, old, new) \
|
||||
(atomic_cmpxchg((atomic_t *)(l), (old), (new)))
|
||||
#define atomic_long_xchg(v, new) \
|
||||
(atomic_xchg((atomic_t *)(v), (new)))
|
||||
|
||||
#endif /* BITS_PER_LONG == 64 */
|
||||
|
||||
#endif /* _ASM_GENERIC_ATOMIC_LONG_H */
|
||||
+123
-216
@@ -1,258 +1,165 @@
|
||||
#ifndef _ASM_GENERIC_ATOMIC_H
|
||||
#define _ASM_GENERIC_ATOMIC_H
|
||||
/*
|
||||
* Copyright (C) 2005 Silicon Graphics, Inc.
|
||||
* Christoph Lameter
|
||||
* Generic C implementation of atomic counter operations
|
||||
* Originally implemented for MN10300.
|
||||
*
|
||||
* Allows to provide arch independent atomic definitions without the need to
|
||||
* edit all arch specific atomic.h files.
|
||||
* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
|
||||
* Written by David Howells (dhowells@redhat.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public Licence
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the Licence, or (at your option) any later version.
|
||||
*/
|
||||
#ifndef __ASM_GENERIC_ATOMIC_H
|
||||
#define __ASM_GENERIC_ATOMIC_H
|
||||
|
||||
#include <asm/types.h>
|
||||
#ifdef CONFIG_SMP
|
||||
#error not SMP safe
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Suppport for atomic_long_t
|
||||
*
|
||||
* Casts for parameters are avoided for existing atomic functions in order to
|
||||
* avoid issues with cast-as-lval under gcc 4.x and other limitations that the
|
||||
* macros of a platform may have.
|
||||
* Atomic operations that C can't guarantee us. Useful for
|
||||
* resource counting etc..
|
||||
*/
|
||||
|
||||
#if BITS_PER_LONG == 64
|
||||
#define ATOMIC_INIT(i) { (i) }
|
||||
|
||||
typedef atomic64_t atomic_long_t;
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#define ATOMIC_LONG_INIT(i) ATOMIC64_INIT(i)
|
||||
/**
|
||||
* atomic_read - read atomic variable
|
||||
* @v: pointer of type atomic_t
|
||||
*
|
||||
* Atomically reads the value of @v. Note that the guaranteed
|
||||
* useful range of an atomic_t is only 24 bits.
|
||||
*/
|
||||
#define atomic_read(v) ((v)->counter)
|
||||
|
||||
static inline long atomic_long_read(atomic_long_t *l)
|
||||
/**
|
||||
* atomic_set - set atomic variable
|
||||
* @v: pointer of type atomic_t
|
||||
* @i: required value
|
||||
*
|
||||
* Atomically sets the value of @v to @i. Note that the guaranteed
|
||||
* useful range of an atomic_t is only 24 bits.
|
||||
*/
|
||||
#define atomic_set(v, i) (((v)->counter) = (i))
|
||||
|
||||
#include <asm/system.h>
|
||||
|
||||
/**
|
||||
* atomic_add_return - add integer to atomic variable
|
||||
* @i: integer value to add
|
||||
* @v: pointer of type atomic_t
|
||||
*
|
||||
* Atomically adds @i to @v and returns the result
|
||||
* Note that the guaranteed useful range of an atomic_t is only 24 bits.
|
||||
*/
|
||||
static inline int atomic_add_return(int i, atomic_t *v)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
unsigned long flags;
|
||||
int temp;
|
||||
|
||||
return (long)atomic64_read(v);
|
||||
local_irq_save(flags);
|
||||
temp = v->counter;
|
||||
temp += i;
|
||||
v->counter = temp;
|
||||
local_irq_restore(flags);
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
static inline void atomic_long_set(atomic_long_t *l, long i)
|
||||
/**
|
||||
* atomic_sub_return - subtract integer from atomic variable
|
||||
* @i: integer value to subtract
|
||||
* @v: pointer of type atomic_t
|
||||
*
|
||||
* Atomically subtracts @i from @v and returns the result
|
||||
* Note that the guaranteed useful range of an atomic_t is only 24 bits.
|
||||
*/
|
||||
static inline int atomic_sub_return(int i, atomic_t *v)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
unsigned long flags;
|
||||
int temp;
|
||||
|
||||
atomic64_set(v, i);
|
||||
local_irq_save(flags);
|
||||
temp = v->counter;
|
||||
temp -= i;
|
||||
v->counter = temp;
|
||||
local_irq_restore(flags);
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
static inline void atomic_long_inc(atomic_long_t *l)
|
||||
static inline int atomic_add_negative(int i, atomic_t *v)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
atomic64_inc(v);
|
||||
return atomic_add_return(i, v) < 0;
|
||||
}
|
||||
|
||||
static inline void atomic_long_dec(atomic_long_t *l)
|
||||
static inline void atomic_add(int i, atomic_t *v)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
atomic64_dec(v);
|
||||
atomic_add_return(i, v);
|
||||
}
|
||||
|
||||
static inline void atomic_long_add(long i, atomic_long_t *l)
|
||||
static inline void atomic_sub(int i, atomic_t *v)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
atomic64_add(i, v);
|
||||
atomic_sub_return(i, v);
|
||||
}
|
||||
|
||||
static inline void atomic_long_sub(long i, atomic_long_t *l)
|
||||
static inline void atomic_inc(atomic_t *v)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
atomic64_sub(i, v);
|
||||
atomic_add_return(1, v);
|
||||
}
|
||||
|
||||
static inline int atomic_long_sub_and_test(long i, atomic_long_t *l)
|
||||
static inline void atomic_dec(atomic_t *v)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
return atomic64_sub_and_test(i, v);
|
||||
atomic_sub_return(1, v);
|
||||
}
|
||||
|
||||
static inline int atomic_long_dec_and_test(atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
#define atomic_dec_return(v) atomic_sub_return(1, (v))
|
||||
#define atomic_inc_return(v) atomic_add_return(1, (v))
|
||||
|
||||
return atomic64_dec_and_test(v);
|
||||
#define atomic_sub_and_test(i, v) (atomic_sub_return((i), (v)) == 0)
|
||||
#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
|
||||
#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0)
|
||||
|
||||
#define atomic_add_unless(v, a, u) \
|
||||
({ \
|
||||
int c, old; \
|
||||
c = atomic_read(v); \
|
||||
while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \
|
||||
c = old; \
|
||||
c != (u); \
|
||||
})
|
||||
|
||||
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
|
||||
|
||||
static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
mask = ~mask;
|
||||
local_irq_save(flags);
|
||||
*addr &= mask;
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
static inline int atomic_long_inc_and_test(atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
#define atomic_xchg(ptr, v) (xchg(&(ptr)->counter, (v)))
|
||||
#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new)))
|
||||
|
||||
return atomic64_inc_and_test(v);
|
||||
}
|
||||
#define cmpxchg_local(ptr, o, n) \
|
||||
((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
|
||||
(unsigned long)(n), sizeof(*(ptr))))
|
||||
|
||||
static inline int atomic_long_add_negative(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
|
||||
|
||||
return atomic64_add_negative(i, v);
|
||||
}
|
||||
/* Assume that atomic operations are already serializing */
|
||||
#define smp_mb__before_atomic_dec() barrier()
|
||||
#define smp_mb__after_atomic_dec() barrier()
|
||||
#define smp_mb__before_atomic_inc() barrier()
|
||||
#define smp_mb__after_atomic_inc() barrier()
|
||||
|
||||
static inline long atomic_long_add_return(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
#include <asm-generic/atomic-long.h>
|
||||
|
||||
return (long)atomic64_add_return(i, v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_sub_return(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
return (long)atomic64_sub_return(i, v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_inc_return(atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
return (long)atomic64_inc_return(v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_dec_return(atomic_long_t *l)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
return (long)atomic64_dec_return(v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u)
|
||||
{
|
||||
atomic64_t *v = (atomic64_t *)l;
|
||||
|
||||
return (long)atomic64_add_unless(v, a, u);
|
||||
}
|
||||
|
||||
#define atomic_long_inc_not_zero(l) atomic64_inc_not_zero((atomic64_t *)(l))
|
||||
|
||||
#define atomic_long_cmpxchg(l, old, new) \
|
||||
(atomic64_cmpxchg((atomic64_t *)(l), (old), (new)))
|
||||
#define atomic_long_xchg(v, new) \
|
||||
(atomic64_xchg((atomic64_t *)(l), (new)))
|
||||
|
||||
#else /* BITS_PER_LONG == 64 */
|
||||
|
||||
typedef atomic_t atomic_long_t;
|
||||
|
||||
#define ATOMIC_LONG_INIT(i) ATOMIC_INIT(i)
|
||||
static inline long atomic_long_read(atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return (long)atomic_read(v);
|
||||
}
|
||||
|
||||
static inline void atomic_long_set(atomic_long_t *l, long i)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
atomic_set(v, i);
|
||||
}
|
||||
|
||||
static inline void atomic_long_inc(atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
atomic_inc(v);
|
||||
}
|
||||
|
||||
static inline void atomic_long_dec(atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
atomic_dec(v);
|
||||
}
|
||||
|
||||
static inline void atomic_long_add(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
atomic_add(i, v);
|
||||
}
|
||||
|
||||
static inline void atomic_long_sub(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
atomic_sub(i, v);
|
||||
}
|
||||
|
||||
static inline int atomic_long_sub_and_test(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return atomic_sub_and_test(i, v);
|
||||
}
|
||||
|
||||
static inline int atomic_long_dec_and_test(atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return atomic_dec_and_test(v);
|
||||
}
|
||||
|
||||
static inline int atomic_long_inc_and_test(atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return atomic_inc_and_test(v);
|
||||
}
|
||||
|
||||
static inline int atomic_long_add_negative(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return atomic_add_negative(i, v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_add_return(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return (long)atomic_add_return(i, v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_sub_return(long i, atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return (long)atomic_sub_return(i, v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_inc_return(atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return (long)atomic_inc_return(v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_dec_return(atomic_long_t *l)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return (long)atomic_dec_return(v);
|
||||
}
|
||||
|
||||
static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u)
|
||||
{
|
||||
atomic_t *v = (atomic_t *)l;
|
||||
|
||||
return (long)atomic_add_unless(v, a, u);
|
||||
}
|
||||
|
||||
#define atomic_long_inc_not_zero(l) atomic_inc_not_zero((atomic_t *)(l))
|
||||
|
||||
#define atomic_long_cmpxchg(l, old, new) \
|
||||
(atomic_cmpxchg((atomic_t *)(l), (old), (new)))
|
||||
#define atomic_long_xchg(v, new) \
|
||||
(atomic_xchg((atomic_t *)(v), (new)))
|
||||
|
||||
#endif /* BITS_PER_LONG == 64 */
|
||||
|
||||
#endif /* _ASM_GENERIC_ATOMIC_H */
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __ASM_GENERIC_ATOMIC_H */
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef __ASM_GENERIC_AUXVEC_H
|
||||
#define __ASM_GENERIC_AUXVEC_H
|
||||
/*
|
||||
* Not all architectures need their own auxvec.h, the most
|
||||
* common definitions are already in linux/auxvec.h.
|
||||
*/
|
||||
|
||||
#endif /* __ASM_GENERIC_AUXVEC_H */
|
||||
@@ -1,19 +1,29 @@
|
||||
#ifndef _ASM_GENERIC_BITOPS_H_
|
||||
#define _ASM_GENERIC_BITOPS_H_
|
||||
#ifndef __ASM_GENERIC_BITOPS_H
|
||||
#define __ASM_GENERIC_BITOPS_H
|
||||
|
||||
/*
|
||||
* For the benefit of those who are trying to port Linux to another
|
||||
* architecture, here are some C-language equivalents. You should
|
||||
* recode these in the native assembly language, if at all possible.
|
||||
*
|
||||
*
|
||||
* C language equivalents written by Theodore Ts'o, 9/26/92
|
||||
*/
|
||||
|
||||
#include <asm-generic/bitops/atomic.h>
|
||||
#include <asm-generic/bitops/non-atomic.h>
|
||||
#include <linux/irqflags.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
/*
|
||||
* clear_bit may not imply a memory barrier
|
||||
*/
|
||||
#ifndef smp_mb__before_clear_bit
|
||||
#define smp_mb__before_clear_bit() smp_mb()
|
||||
#define smp_mb__after_clear_bit() smp_mb()
|
||||
#endif
|
||||
|
||||
#include <asm-generic/bitops/__ffs.h>
|
||||
#include <asm-generic/bitops/ffz.h>
|
||||
#include <asm-generic/bitops/fls.h>
|
||||
#include <asm-generic/bitops/__fls.h>
|
||||
#include <asm-generic/bitops/fls64.h>
|
||||
#include <asm-generic/bitops/find.h>
|
||||
|
||||
@@ -26,8 +36,10 @@
|
||||
#include <asm-generic/bitops/hweight.h>
|
||||
#include <asm-generic/bitops/lock.h>
|
||||
|
||||
#include <asm-generic/bitops/atomic.h>
|
||||
#include <asm-generic/bitops/non-atomic.h>
|
||||
#include <asm-generic/bitops/ext2-non-atomic.h>
|
||||
#include <asm-generic/bitops/ext2-atomic.h>
|
||||
#include <asm-generic/bitops/minix.h>
|
||||
|
||||
#endif /* _ASM_GENERIC_BITOPS_H */
|
||||
#endif /* __ASM_GENERIC_BITOPS_H */
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define _ASM_GENERIC_BITOPS_ATOMIC_H_
|
||||
|
||||
#include <asm/types.h>
|
||||
#include <asm/system.h>
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
#include <asm/spinlock.h>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef __ASM_GENERIC_BITS_PER_LONG
|
||||
#define __ASM_GENERIC_BITS_PER_LONG
|
||||
|
||||
/*
|
||||
* There seems to be no way of detecting this automatically from user
|
||||
* space, so 64 bit architectures should override this in their
|
||||
* bitsperlong.h. In particular, an architecture that supports
|
||||
* both 32 and 64 bit user space must not rely on CONFIG_64BIT
|
||||
* to decide it, but rather check a compiler provided macro.
|
||||
*/
|
||||
#ifndef __BITS_PER_LONG
|
||||
#define __BITS_PER_LONG 32
|
||||
#endif
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#ifdef CONFIG_64BIT
|
||||
#define BITS_PER_LONG 64
|
||||
#else
|
||||
#define BITS_PER_LONG 32
|
||||
#endif /* CONFIG_64BIT */
|
||||
|
||||
/*
|
||||
* FIXME: The check currently breaks x86-64 build, so it's
|
||||
* temporarily disabled. Please fix x86-64 and reenable
|
||||
*/
|
||||
#if 0 && BITS_PER_LONG != __BITS_PER_LONG
|
||||
#error Inconsistent word size. Check asm/bitsperlong.h
|
||||
#endif
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __ASM_GENERIC_BITS_PER_LONG */
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef __ASM_GENERIC_BUGS_H
|
||||
#define __ASM_GENERIC_BUGS_H
|
||||
/*
|
||||
* This file is included by 'init/main.c' to check for
|
||||
* architecture-dependent bugs.
|
||||
*/
|
||||
|
||||
static inline void check_bugs(void) { }
|
||||
|
||||
#endif /* __ASM_GENERIC_BUGS_H */
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef __ASM_GENERIC_CACHE_H
|
||||
#define __ASM_GENERIC_CACHE_H
|
||||
/*
|
||||
* 32 bytes appears to be the most common cache line size,
|
||||
* so make that the default here. Architectures with larger
|
||||
* cache lines need to provide their own cache.h.
|
||||
*/
|
||||
|
||||
#define L1_CACHE_SHIFT 5
|
||||
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
|
||||
|
||||
#endif /* __ASM_GENERIC_CACHE_H */
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef __ASM_CACHEFLUSH_H
|
||||
#define __ASM_CACHEFLUSH_H
|
||||
|
||||
/* Keep includes the same across arches. */
|
||||
#include <linux/mm.h>
|
||||
|
||||
/*
|
||||
* The cache doesn't need to be flushed when TLB entries change when
|
||||
* the cache is mapped to physical memory, not virtual memory
|
||||
*/
|
||||
#define flush_cache_all() do { } while (0)
|
||||
#define flush_cache_mm(mm) do { } while (0)
|
||||
#define flush_cache_dup_mm(mm) do { } while (0)
|
||||
#define flush_cache_range(vma, start, end) do { } while (0)
|
||||
#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
|
||||
#define flush_dcache_page(page) do { } while (0)
|
||||
#define flush_dcache_mmap_lock(mapping) do { } while (0)
|
||||
#define flush_dcache_mmap_unlock(mapping) do { } while (0)
|
||||
#define flush_icache_range(start, end) do { } while (0)
|
||||
#define flush_icache_page(vma,pg) do { } while (0)
|
||||
#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
|
||||
#define flush_cache_vmap(start, end) do { } while (0)
|
||||
#define flush_cache_vunmap(start, end) do { } while (0)
|
||||
|
||||
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
|
||||
memcpy(dst, src, len)
|
||||
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
|
||||
memcpy(dst, src, len)
|
||||
|
||||
#endif /* __ASM_CACHEFLUSH_H */
|
||||
@@ -0,0 +1,79 @@
|
||||
#ifndef __ASM_GENERIC_CHECKSUM_H
|
||||
#define __ASM_GENERIC_CHECKSUM_H
|
||||
|
||||
/*
|
||||
* computes the checksum of a memory block at buff, length len,
|
||||
* and adds in "sum" (32-bit)
|
||||
*
|
||||
* returns a 32-bit number suitable for feeding into itself
|
||||
* or csum_tcpudp_magic
|
||||
*
|
||||
* this function must be called with even lengths, except
|
||||
* for the last fragment, which may be odd
|
||||
*
|
||||
* it's best to have buff aligned on a 32-bit boundary
|
||||
*/
|
||||
extern __wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* the same as csum_partial, but copies from src while it
|
||||
* checksums
|
||||
*
|
||||
* here even more important to align src and dst on a 32-bit (or even
|
||||
* better 64-bit) boundary
|
||||
*/
|
||||
extern __wsum csum_partial_copy(const void *src, void *dst, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* the same as csum_partial_copy, but copies from user space.
|
||||
*
|
||||
* here even more important to align src and dst on a 32-bit (or even
|
||||
* better 64-bit) boundary
|
||||
*/
|
||||
extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
|
||||
int len, __wsum sum, int *csum_err);
|
||||
|
||||
#define csum_partial_copy_nocheck(src, dst, len, sum) \
|
||||
csum_partial_copy((src), (dst), (len), (sum))
|
||||
|
||||
/*
|
||||
* This is a version of ip_compute_csum() optimized for IP headers,
|
||||
* which always checksum on 4 octet boundaries.
|
||||
*/
|
||||
extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl);
|
||||
|
||||
/*
|
||||
* Fold a partial checksum
|
||||
*/
|
||||
static inline __sum16 csum_fold(__wsum csum)
|
||||
{
|
||||
u32 sum = (__force u32)csum;
|
||||
sum = (sum & 0xffff) + (sum >> 16);
|
||||
sum = (sum & 0xffff) + (sum >> 16);
|
||||
return (__force __sum16)~sum;
|
||||
}
|
||||
|
||||
#ifndef csum_tcpudp_nofold
|
||||
/*
|
||||
* computes the checksum of the TCP/UDP pseudo-header
|
||||
* returns a 16-bit checksum, already complemented
|
||||
*/
|
||||
extern __wsum
|
||||
csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum);
|
||||
#endif
|
||||
|
||||
static inline __sum16
|
||||
csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
|
||||
}
|
||||
|
||||
/*
|
||||
* this routine is used for miscellaneous IP-like checksums, mainly
|
||||
* in icmp.c
|
||||
*/
|
||||
extern __sum16 ip_compute_csum(const void *buff, int len);
|
||||
|
||||
#endif /* __ASM_GENERIC_CHECKSUM_H */
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef __ASM_GENERIC_CURRENT_H
|
||||
#define __ASM_GENERIC_CURRENT_H
|
||||
|
||||
#include <linux/thread_info.h>
|
||||
|
||||
#define get_current() (current_thread_info()->task)
|
||||
#define current get_current()
|
||||
|
||||
#endif /* __ASM_GENERIC_CURRENT_H */
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef __ASM_GENERIC_DELAY_H
|
||||
#define __ASM_GENERIC_DELAY_H
|
||||
|
||||
extern void __udelay(unsigned long usecs);
|
||||
extern void __delay(unsigned long loops);
|
||||
|
||||
#define udelay(n) __udelay(n)
|
||||
|
||||
#endif /* __ASM_GENERIC_DELAY_H */
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef __ASM_GENERIC_DMA_H
|
||||
#define __ASM_GENERIC_DMA_H
|
||||
/*
|
||||
* This file traditionally describes the i8237 PC style DMA controller.
|
||||
* Most architectures don't have these any more and can get the minimal
|
||||
* implementation from kernel/dma.c by not defining MAX_DMA_CHANNELS.
|
||||
*
|
||||
* Some code relies on seeing MAX_DMA_ADDRESS though.
|
||||
*/
|
||||
#define MAX_DMA_ADDRESS PAGE_OFFSET
|
||||
|
||||
extern int request_dma(unsigned int dmanr, const char *device_id);
|
||||
extern void free_dma(unsigned int dmanr);
|
||||
|
||||
#endif /* __ASM_GENERIC_DMA_H */
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef __ASM_GENERIC_FB_H_
|
||||
#define __ASM_GENERIC_FB_H_
|
||||
#include <linux/fb.h>
|
||||
|
||||
#define fb_pgprotect(...) do {} while (0)
|
||||
|
||||
static inline int fb_is_primary_device(struct fb_info *info)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* __ASM_GENERIC_FB_H_ */
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef __ASM_GENERIC_GETORDER_H
|
||||
#define __ASM_GENERIC_GETORDER_H
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
/* Pure 2^n version of get_order */
|
||||
static inline __attribute_const__ int get_order(unsigned long size)
|
||||
{
|
||||
int order;
|
||||
|
||||
size = (size - 1) >> (PAGE_SHIFT - 1);
|
||||
order = -1;
|
||||
do {
|
||||
size >>= 1;
|
||||
order++;
|
||||
} while (size);
|
||||
return order;
|
||||
}
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* __ASM_GENERIC_GETORDER_H */
|
||||
@@ -0,0 +1,34 @@
|
||||
#ifndef __ASM_GENERIC_HARDIRQ_H
|
||||
#define __ASM_GENERIC_HARDIRQ_H
|
||||
|
||||
#include <linux/cache.h>
|
||||
#include <linux/threads.h>
|
||||
#include <linux/irq.h>
|
||||
|
||||
typedef struct {
|
||||
unsigned long __softirq_pending;
|
||||
} ____cacheline_aligned irq_cpustat_t;
|
||||
|
||||
#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
|
||||
|
||||
#ifndef HARDIRQ_BITS
|
||||
#define HARDIRQ_BITS 8
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The hardirq mask has to be large enough to have
|
||||
* space for potentially all IRQ sources in the system
|
||||
* nesting on a single CPU:
|
||||
*/
|
||||
#if (1 << HARDIRQ_BITS) < NR_IRQS
|
||||
# error HARDIRQ_BITS is too low!
|
||||
#endif
|
||||
|
||||
#ifndef ack_bad_irq
|
||||
static inline void ack_bad_irq(unsigned int irq)
|
||||
{
|
||||
printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_GENERIC_HARDIRQ_H */
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef __ASM_GENERIC_HW_IRQ_H
|
||||
#define __ASM_GENERIC_HW_IRQ_H
|
||||
/*
|
||||
* hw_irq.h has internal declarations for the low-level interrupt
|
||||
* controller, like the original i8259A.
|
||||
* In general, this is not needed for new architectures.
|
||||
*/
|
||||
|
||||
#endif /* __ASM_GENERIC_HW_IRQ_H */
|
||||
@@ -8,6 +8,8 @@
|
||||
#ifndef _ASM_GENERIC_INT_L64_H
|
||||
#define _ASM_GENERIC_INT_L64_H
|
||||
|
||||
#include <asm/bitsperlong.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
/*
|
||||
* __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#ifndef _ASM_GENERIC_INT_LL64_H
|
||||
#define _ASM_GENERIC_INT_LL64_H
|
||||
|
||||
#include <asm/bitsperlong.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
/*
|
||||
* __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
|
||||
|
||||
@@ -0,0 +1,300 @@
|
||||
/* Generic I/O port emulation, based on MN10300 code
|
||||
*
|
||||
* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
|
||||
* Written by David Howells (dhowells@redhat.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public Licence
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the Licence, or (at your option) any later version.
|
||||
*/
|
||||
#ifndef __ASM_GENERIC_IO_H
|
||||
#define __ASM_GENERIC_IO_H
|
||||
|
||||
#include <asm/page.h> /* I/O is all done through memory accesses */
|
||||
#include <asm/cacheflush.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#ifdef CONFIG_GENERIC_IOMAP
|
||||
#include <asm-generic/iomap.h>
|
||||
#endif
|
||||
|
||||
#define mmiowb() do {} while (0)
|
||||
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
* readX/writeX() are used to access memory mapped devices. On some
|
||||
* architectures the memory mapped IO stuff needs to be accessed
|
||||
* differently. On the simple architectures, we just read/write the
|
||||
* memory location directly.
|
||||
*/
|
||||
static inline u8 __raw_readb(const volatile void __iomem *addr)
|
||||
{
|
||||
return *(const volatile u8 __force *) addr;
|
||||
}
|
||||
|
||||
static inline u16 __raw_readw(const volatile void __iomem *addr)
|
||||
{
|
||||
return *(const volatile u16 __force *) addr;
|
||||
}
|
||||
|
||||
static inline u32 __raw_readl(const volatile void __iomem *addr)
|
||||
{
|
||||
return *(const volatile u32 __force *) addr;
|
||||
}
|
||||
|
||||
#define readb __raw_readb
|
||||
#define readw(addr) __le16_to_cpu(__raw_readw(addr))
|
||||
#define readl(addr) __le32_to_cpu(__raw_readl(addr))
|
||||
|
||||
static inline void __raw_writeb(u8 b, volatile void __iomem *addr)
|
||||
{
|
||||
*(volatile u8 __force *) addr = b;
|
||||
}
|
||||
|
||||
static inline void __raw_writew(u16 b, volatile void __iomem *addr)
|
||||
{
|
||||
*(volatile u16 __force *) addr = b;
|
||||
}
|
||||
|
||||
static inline void __raw_writel(u32 b, volatile void __iomem *addr)
|
||||
{
|
||||
*(volatile u32 __force *) addr = b;
|
||||
}
|
||||
|
||||
#define writeb __raw_writeb
|
||||
#define writew(b,addr) __raw_writew(__cpu_to_le16(b),addr)
|
||||
#define writel(b,addr) __raw_writel(__cpu_to_le32(b),addr)
|
||||
|
||||
#ifdef CONFIG_64BIT
|
||||
static inline u64 __raw_readq(const volatile void __iomem *addr)
|
||||
{
|
||||
return *(const volatile u64 __force *) addr;
|
||||
}
|
||||
#define readq(addr) __le64_to_cpu(__raw_readq(addr))
|
||||
|
||||
static inline void __raw_writeq(u64 b, volatile void __iomem *addr)
|
||||
{
|
||||
*(volatile u64 __force *) addr = b;
|
||||
}
|
||||
#define writeq(b,addr) __raw_writeq(__cpu_to_le64(b),addr)
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
* traditional input/output functions
|
||||
*/
|
||||
|
||||
static inline u8 inb(unsigned long addr)
|
||||
{
|
||||
return readb((volatile void __iomem *) addr);
|
||||
}
|
||||
|
||||
static inline u16 inw(unsigned long addr)
|
||||
{
|
||||
return readw((volatile void __iomem *) addr);
|
||||
}
|
||||
|
||||
static inline u32 inl(unsigned long addr)
|
||||
{
|
||||
return readl((volatile void __iomem *) addr);
|
||||
}
|
||||
|
||||
static inline void outb(u8 b, unsigned long addr)
|
||||
{
|
||||
writeb(b, (volatile void __iomem *) addr);
|
||||
}
|
||||
|
||||
static inline void outw(u16 b, unsigned long addr)
|
||||
{
|
||||
writew(b, (volatile void __iomem *) addr);
|
||||
}
|
||||
|
||||
static inline void outl(u32 b, unsigned long addr)
|
||||
{
|
||||
writel(b, (volatile void __iomem *) addr);
|
||||
}
|
||||
|
||||
#define inb_p(addr) inb(addr)
|
||||
#define inw_p(addr) inw(addr)
|
||||
#define inl_p(addr) inl(addr)
|
||||
#define outb_p(x, addr) outb((x), (addr))
|
||||
#define outw_p(x, addr) outw((x), (addr))
|
||||
#define outl_p(x, addr) outl((x), (addr))
|
||||
|
||||
static inline void insb(unsigned long addr, void *buffer, int count)
|
||||
{
|
||||
if (count) {
|
||||
u8 *buf = buffer;
|
||||
do {
|
||||
u8 x = inb(addr);
|
||||
*buf++ = x;
|
||||
} while (--count);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void insw(unsigned long addr, void *buffer, int count)
|
||||
{
|
||||
if (count) {
|
||||
u16 *buf = buffer;
|
||||
do {
|
||||
u16 x = inw(addr);
|
||||
*buf++ = x;
|
||||
} while (--count);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void insl(unsigned long addr, void *buffer, int count)
|
||||
{
|
||||
if (count) {
|
||||
u32 *buf = buffer;
|
||||
do {
|
||||
u32 x = inl(addr);
|
||||
*buf++ = x;
|
||||
} while (--count);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void outsb(unsigned long addr, const void *buffer, int count)
|
||||
{
|
||||
if (count) {
|
||||
const u8 *buf = buffer;
|
||||
do {
|
||||
outb(*buf++, addr);
|
||||
} while (--count);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void outsw(unsigned long addr, const void *buffer, int count)
|
||||
{
|
||||
if (count) {
|
||||
const u16 *buf = buffer;
|
||||
do {
|
||||
outw(*buf++, addr);
|
||||
} while (--count);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void outsl(unsigned long addr, const void *buffer, int count)
|
||||
{
|
||||
if (count) {
|
||||
const u32 *buf = buffer;
|
||||
do {
|
||||
outl(*buf++, addr);
|
||||
} while (--count);
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef CONFIG_GENERIC_IOMAP
|
||||
#define ioread8(addr) readb(addr)
|
||||
#define ioread16(addr) readw(addr)
|
||||
#define ioread32(addr) readl(addr)
|
||||
|
||||
#define iowrite8(v, addr) writeb((v), (addr))
|
||||
#define iowrite16(v, addr) writew((v), (addr))
|
||||
#define iowrite32(v, addr) writel((v), (addr))
|
||||
|
||||
#define ioread8_rep(p, dst, count) \
|
||||
insb((unsigned long) (p), (dst), (count))
|
||||
#define ioread16_rep(p, dst, count) \
|
||||
insw((unsigned long) (p), (dst), (count))
|
||||
#define ioread32_rep(p, dst, count) \
|
||||
insl((unsigned long) (p), (dst), (count))
|
||||
|
||||
#define iowrite8_rep(p, src, count) \
|
||||
outsb((unsigned long) (p), (src), (count))
|
||||
#define iowrite16_rep(p, src, count) \
|
||||
outsw((unsigned long) (p), (src), (count))
|
||||
#define iowrite32_rep(p, src, count) \
|
||||
outsl((unsigned long) (p), (src), (count))
|
||||
#endif /* CONFIG_GENERIC_IOMAP */
|
||||
|
||||
|
||||
#define IO_SPACE_LIMIT 0xffffffff
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/vmalloc.h>
|
||||
#define __io_virt(x) ((void __force *) (x))
|
||||
|
||||
#ifndef CONFIG_GENERIC_IOMAP
|
||||
/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
|
||||
struct pci_dev;
|
||||
extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
|
||||
static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p)
|
||||
{
|
||||
}
|
||||
#endif /* CONFIG_GENERIC_IOMAP */
|
||||
|
||||
/*
|
||||
* Change virtual addresses to physical addresses and vv.
|
||||
* These are pretty trivial
|
||||
*/
|
||||
static inline unsigned long virt_to_phys(volatile void *address)
|
||||
{
|
||||
return __pa((unsigned long)address);
|
||||
}
|
||||
|
||||
static inline void *phys_to_virt(unsigned long address)
|
||||
{
|
||||
return __va(address);
|
||||
}
|
||||
|
||||
/*
|
||||
* Change "struct page" to physical address.
|
||||
*/
|
||||
static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size)
|
||||
{
|
||||
return (void __iomem*) (unsigned long)offset;
|
||||
}
|
||||
|
||||
#define __ioremap(offset, size, flags) ioremap(offset, size)
|
||||
|
||||
#ifndef ioremap_nocache
|
||||
#define ioremap_nocache ioremap
|
||||
#endif
|
||||
|
||||
#ifndef ioremap_wc
|
||||
#define ioremap_wc ioremap_nocache
|
||||
#endif
|
||||
|
||||
static inline void iounmap(void *addr)
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef CONFIG_GENERIC_IOMAP
|
||||
static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
|
||||
{
|
||||
return (void __iomem *) port;
|
||||
}
|
||||
|
||||
static inline void ioport_unmap(void __iomem *p)
|
||||
{
|
||||
}
|
||||
#else /* CONFIG_GENERIC_IOMAP */
|
||||
extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
|
||||
extern void ioport_unmap(void __iomem *p);
|
||||
#endif /* CONFIG_GENERIC_IOMAP */
|
||||
|
||||
#define xlate_dev_kmem_ptr(p) p
|
||||
#define xlate_dev_mem_ptr(p) ((void *) (p))
|
||||
|
||||
#ifndef virt_to_bus
|
||||
static inline unsigned long virt_to_bus(volatile void *address)
|
||||
{
|
||||
return ((unsigned long) address);
|
||||
}
|
||||
|
||||
static inline void *bus_to_virt(unsigned long address)
|
||||
{
|
||||
return (void *) address;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define memset_io(a, b, c) memset(__io_virt(a), (b), (c))
|
||||
#define memcpy_fromio(a, b, c) memcpy((a), __io_virt(b), (c))
|
||||
#define memcpy_toio(a, b, c) memcpy(__io_virt(a), (b), (c))
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* __ASM_GENERIC_IO_H */
|
||||
@@ -0,0 +1,110 @@
|
||||
#ifndef __ASM_GENERIC_IOCTLS_H
|
||||
#define __ASM_GENERIC_IOCTLS_H
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
/*
|
||||
* These are the most common definitions for tty ioctl numbers.
|
||||
* Most of them do not use the recommended _IOC(), but there is
|
||||
* probably some source code out there hardcoding the number,
|
||||
* so we might as well use them for all new platforms.
|
||||
*
|
||||
* The architectures that use different values here typically
|
||||
* try to be compatible with some Unix variants for the same
|
||||
* architecture.
|
||||
*/
|
||||
|
||||
/* 0x54 is just a magic number to make these relatively unique ('T') */
|
||||
|
||||
#define TCGETS 0x5401
|
||||
#define TCSETS 0x5402
|
||||
#define TCSETSW 0x5403
|
||||
#define TCSETSF 0x5404
|
||||
#define TCGETA 0x5405
|
||||
#define TCSETA 0x5406
|
||||
#define TCSETAW 0x5407
|
||||
#define TCSETAF 0x5408
|
||||
#define TCSBRK 0x5409
|
||||
#define TCXONC 0x540A
|
||||
#define TCFLSH 0x540B
|
||||
#define TIOCEXCL 0x540C
|
||||
#define TIOCNXCL 0x540D
|
||||
#define TIOCSCTTY 0x540E
|
||||
#define TIOCGPGRP 0x540F
|
||||
#define TIOCSPGRP 0x5410
|
||||
#define TIOCOUTQ 0x5411
|
||||
#define TIOCSTI 0x5412
|
||||
#define TIOCGWINSZ 0x5413
|
||||
#define TIOCSWINSZ 0x5414
|
||||
#define TIOCMGET 0x5415
|
||||
#define TIOCMBIS 0x5416
|
||||
#define TIOCMBIC 0x5417
|
||||
#define TIOCMSET 0x5418
|
||||
#define TIOCGSOFTCAR 0x5419
|
||||
#define TIOCSSOFTCAR 0x541A
|
||||
#define FIONREAD 0x541B
|
||||
#define TIOCINQ FIONREAD
|
||||
#define TIOCLINUX 0x541C
|
||||
#define TIOCCONS 0x541D
|
||||
#define TIOCGSERIAL 0x541E
|
||||
#define TIOCSSERIAL 0x541F
|
||||
#define TIOCPKT 0x5420
|
||||
#define FIONBIO 0x5421
|
||||
#define TIOCNOTTY 0x5422
|
||||
#define TIOCSETD 0x5423
|
||||
#define TIOCGETD 0x5424
|
||||
#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
|
||||
#define TIOCSBRK 0x5427 /* BSD compatibility */
|
||||
#define TIOCCBRK 0x5428 /* BSD compatibility */
|
||||
#define TIOCGSID 0x5429 /* Return the session ID of FD */
|
||||
#define TCGETS2 _IOR('T', 0x2A, struct termios2)
|
||||
#define TCSETS2 _IOW('T', 0x2B, struct termios2)
|
||||
#define TCSETSW2 _IOW('T', 0x2C, struct termios2)
|
||||
#define TCSETSF2 _IOW('T', 0x2D, struct termios2)
|
||||
#define TIOCGRS485 0x542E
|
||||
#define TIOCSRS485 0x542F
|
||||
#define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
|
||||
#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */
|
||||
#define TCGETX 0x5432 /* SYS5 TCGETX compatibility */
|
||||
#define TCSETX 0x5433
|
||||
#define TCSETXF 0x5434
|
||||
#define TCSETXW 0x5435
|
||||
|
||||
#define FIONCLEX 0x5450
|
||||
#define FIOCLEX 0x5451
|
||||
#define FIOASYNC 0x5452
|
||||
#define TIOCSERCONFIG 0x5453
|
||||
#define TIOCSERGWILD 0x5454
|
||||
#define TIOCSERSWILD 0x5455
|
||||
#define TIOCGLCKTRMIOS 0x5456
|
||||
#define TIOCSLCKTRMIOS 0x5457
|
||||
#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
|
||||
#define TIOCSERGETLSR 0x5459 /* Get line status register */
|
||||
#define TIOCSERGETMULTI 0x545A /* Get multiport config */
|
||||
#define TIOCSERSETMULTI 0x545B /* Set multiport config */
|
||||
|
||||
#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
|
||||
#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
|
||||
|
||||
/*
|
||||
* some architectures define FIOQSIZE as 0x545E, which is used for
|
||||
* TIOCGHAYESESP on others
|
||||
*/
|
||||
#ifndef FIOQSIZE
|
||||
# define TIOCGHAYESESP 0x545E /* Get Hayes ESP configuration */
|
||||
# define TIOCSHAYESESP 0x545F /* Set Hayes ESP configuration */
|
||||
# define FIOQSIZE 0x5460
|
||||
#endif
|
||||
|
||||
/* Used for packet mode */
|
||||
#define TIOCPKT_DATA 0
|
||||
#define TIOCPKT_FLUSHREAD 1
|
||||
#define TIOCPKT_FLUSHWRITE 2
|
||||
#define TIOCPKT_STOP 4
|
||||
#define TIOCPKT_START 8
|
||||
#define TIOCPKT_NOSTOP 16
|
||||
#define TIOCPKT_DOSTOP 32
|
||||
|
||||
#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
|
||||
|
||||
#endif /* __ASM_GENERIC_IOCTLS_H */
|
||||
@@ -0,0 +1,34 @@
|
||||
#ifndef __ASM_GENERIC_IPCBUF_H
|
||||
#define __ASM_GENERIC_IPCBUF_H
|
||||
|
||||
/*
|
||||
* The generic ipc64_perm structure:
|
||||
* Note extra padding because this structure is passed back and forth
|
||||
* between kernel and user space.
|
||||
*
|
||||
* ipc64_perm was originally meant to be architecture specific, but
|
||||
* everyone just ended up making identical copies without specific
|
||||
* optimizations, so we may just as well all use the same one.
|
||||
*
|
||||
* Pad space is left for:
|
||||
* - 32-bit mode_t on architectures that only had 16 bit
|
||||
* - 32-bit seq
|
||||
* - 2 miscellaneous 32-bit values
|
||||
*/
|
||||
|
||||
struct ipc64_perm {
|
||||
__kernel_key_t key;
|
||||
__kernel_uid32_t uid;
|
||||
__kernel_gid32_t gid;
|
||||
__kernel_uid32_t cuid;
|
||||
__kernel_gid32_t cgid;
|
||||
__kernel_mode_t mode;
|
||||
/* pad if mode_t is u16: */
|
||||
unsigned char __pad1[4 - sizeof(__kernel_mode_t)];
|
||||
unsigned short seq;
|
||||
unsigned short __pad2;
|
||||
unsigned long __unused1;
|
||||
unsigned long __unused2;
|
||||
};
|
||||
|
||||
#endif /* __ASM_GENERIC_IPCBUF_H */
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef __ASM_GENERIC_IRQ_H
|
||||
#define __ASM_GENERIC_IRQ_H
|
||||
|
||||
/*
|
||||
* NR_IRQS is the upper bound of how many interrupts can be handled
|
||||
* in the platform. It is used to size the static irq_map array,
|
||||
* so don't make it too big.
|
||||
*/
|
||||
#ifndef NR_IRQS
|
||||
#define NR_IRQS 64
|
||||
#endif
|
||||
|
||||
static inline int irq_canonicalize(int irq)
|
||||
{
|
||||
return irq;
|
||||
}
|
||||
|
||||
#endif /* __ASM_GENERIC_IRQ_H */
|
||||
@@ -0,0 +1,72 @@
|
||||
#ifndef __ASM_GENERIC_IRQFLAGS_H
|
||||
#define __ASM_GENERIC_IRQFLAGS_H
|
||||
|
||||
/*
|
||||
* All architectures should implement at least the first two functions,
|
||||
* usually inline assembly will be the best way.
|
||||
*/
|
||||
#ifndef RAW_IRQ_DISABLED
|
||||
#define RAW_IRQ_DISABLED 0
|
||||
#define RAW_IRQ_ENABLED 1
|
||||
#endif
|
||||
|
||||
/* read interrupt enabled status */
|
||||
#ifndef __raw_local_save_flags
|
||||
unsigned long __raw_local_save_flags(void);
|
||||
#endif
|
||||
|
||||
/* set interrupt enabled status */
|
||||
#ifndef raw_local_irq_restore
|
||||
void raw_local_irq_restore(unsigned long flags);
|
||||
#endif
|
||||
|
||||
/* get status and disable interrupts */
|
||||
#ifndef __raw_local_irq_save
|
||||
static inline unsigned long __raw_local_irq_save(void)
|
||||
{
|
||||
unsigned long flags;
|
||||
flags = __raw_local_save_flags();
|
||||
raw_local_irq_restore(RAW_IRQ_DISABLED);
|
||||
return flags;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* test flags */
|
||||
#ifndef raw_irqs_disabled_flags
|
||||
static inline int raw_irqs_disabled_flags(unsigned long flags)
|
||||
{
|
||||
return flags == RAW_IRQ_DISABLED;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* unconditionally enable interrupts */
|
||||
#ifndef raw_local_irq_enable
|
||||
static inline void raw_local_irq_enable(void)
|
||||
{
|
||||
raw_local_irq_restore(RAW_IRQ_ENABLED);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* unconditionally disable interrupts */
|
||||
#ifndef raw_local_irq_disable
|
||||
static inline void raw_local_irq_disable(void)
|
||||
{
|
||||
raw_local_irq_restore(RAW_IRQ_DISABLED);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* test hardware interrupt enable bit */
|
||||
#ifndef raw_irqs_disabled
|
||||
static inline int raw_irqs_disabled(void)
|
||||
{
|
||||
return raw_irqs_disabled_flags(__raw_local_save_flags());
|
||||
}
|
||||
#endif
|
||||
|
||||
#define raw_local_save_flags(flags) \
|
||||
do { (flags) = __raw_local_save_flags(); } while (0)
|
||||
|
||||
#define raw_local_irq_save(flags) \
|
||||
do { (flags) = __raw_local_irq_save(); } while (0)
|
||||
|
||||
#endif /* __ASM_GENERIC_IRQFLAGS_H */
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef _ASM_GENERIC_KMAP_TYPES_H
|
||||
#define _ASM_GENERIC_KMAP_TYPES_H
|
||||
|
||||
#ifdef CONFIG_DEBUG_HIGHMEM
|
||||
# define D(n) __KM_FENCE_##n ,
|
||||
#else
|
||||
# define D(n)
|
||||
#endif
|
||||
|
||||
enum km_type {
|
||||
D(0) KM_BOUNCE_READ,
|
||||
D(1) KM_SKB_SUNRPC_DATA,
|
||||
D(2) KM_SKB_DATA_SOFTIRQ,
|
||||
D(3) KM_USER0,
|
||||
D(4) KM_USER1,
|
||||
D(5) KM_BIO_SRC_IRQ,
|
||||
D(6) KM_BIO_DST_IRQ,
|
||||
D(7) KM_PTE0,
|
||||
D(8) KM_PTE1,
|
||||
D(9) KM_IRQ0,
|
||||
D(10) KM_IRQ1,
|
||||
D(11) KM_SOFTIRQ0,
|
||||
D(12) KM_SOFTIRQ1,
|
||||
D(13) KM_SYNC_ICACHE,
|
||||
D(14) KM_SYNC_DCACHE,
|
||||
D(15) KM_UML_USERCOPY, /* UML specific, for copy_*_user - used in do_op_one_page */
|
||||
D(16) KM_TYPE_NR
|
||||
};
|
||||
|
||||
#undef D
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef __ASM_GENERIC_LINKAGE_H
|
||||
#define __ASM_GENERIC_LINKAGE_H
|
||||
/*
|
||||
* linux/linkage.h provides reasonable defaults.
|
||||
* an architecture can override them by providing its own version.
|
||||
*/
|
||||
|
||||
#endif /* __ASM_GENERIC_LINKAGE_H */
|
||||
@@ -42,7 +42,7 @@ typedef struct
|
||||
|
||||
#define local_cmpxchg(l, o, n) atomic_long_cmpxchg((&(l)->a), (o), (n))
|
||||
#define local_xchg(l, n) atomic_long_xchg((&(l)->a), (n))
|
||||
#define local_add_unless(l, a, u) atomic_long_add_unless((&(l)->a), (a), (u))
|
||||
#define local_add_unless(l, _a, u) atomic_long_add_unless((&(l)->a), (_a), (u))
|
||||
#define local_inc_not_zero(l) atomic_long_inc_not_zero(&(l)->a)
|
||||
|
||||
/* Non-atomic variants, ie. preemption disabled and won't be touched
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
#ifndef __ASM_GENERIC_MMAN_COMMON_H
|
||||
#define __ASM_GENERIC_MMAN_COMMON_H
|
||||
|
||||
/*
|
||||
Author: Michael S. Tsirkin <mst@mellanox.co.il>, Mellanox Technologies Ltd.
|
||||
Based on: asm-xxx/mman.h
|
||||
*/
|
||||
|
||||
#define PROT_READ 0x1 /* page can be read */
|
||||
#define PROT_WRITE 0x2 /* page can be written */
|
||||
#define PROT_EXEC 0x4 /* page can be executed */
|
||||
#define PROT_SEM 0x8 /* page may be used for atomic ops */
|
||||
#define PROT_NONE 0x0 /* page can not be accessed */
|
||||
#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
|
||||
#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
|
||||
|
||||
#define MAP_SHARED 0x01 /* Share changes */
|
||||
#define MAP_PRIVATE 0x02 /* Changes are private */
|
||||
#define MAP_TYPE 0x0f /* Mask for type of mapping */
|
||||
#define MAP_FIXED 0x10 /* Interpret addr exactly */
|
||||
#define MAP_ANONYMOUS 0x20 /* don't use a file */
|
||||
|
||||
#define MS_ASYNC 1 /* sync memory asynchronously */
|
||||
#define MS_INVALIDATE 2 /* invalidate the caches */
|
||||
#define MS_SYNC 4 /* synchronous memory sync */
|
||||
|
||||
#define MADV_NORMAL 0 /* no further special treatment */
|
||||
#define MADV_RANDOM 1 /* expect random page references */
|
||||
#define MADV_SEQUENTIAL 2 /* expect sequential page references */
|
||||
#define MADV_WILLNEED 3 /* will need these pages */
|
||||
#define MADV_DONTNEED 4 /* don't need these pages */
|
||||
|
||||
/* common parameters: try to keep these consistent across architectures */
|
||||
#define MADV_REMOVE 9 /* remove these pages & resources */
|
||||
#define MADV_DONTFORK 10 /* don't inherit across fork */
|
||||
#define MADV_DOFORK 11 /* do inherit across fork */
|
||||
|
||||
/* compatibility flags */
|
||||
#define MAP_FILE 0
|
||||
|
||||
#endif /* __ASM_GENERIC_MMAN_COMMON_H */
|
||||
+14
-37
@@ -1,41 +1,18 @@
|
||||
#ifndef _ASM_GENERIC_MMAN_H
|
||||
#define _ASM_GENERIC_MMAN_H
|
||||
#ifndef __ASM_GENERIC_MMAN_H
|
||||
#define __ASM_GENERIC_MMAN_H
|
||||
|
||||
/*
|
||||
Author: Michael S. Tsirkin <mst@mellanox.co.il>, Mellanox Technologies Ltd.
|
||||
Based on: asm-xxx/mman.h
|
||||
*/
|
||||
#include <asm-generic/mman-common.h>
|
||||
|
||||
#define PROT_READ 0x1 /* page can be read */
|
||||
#define PROT_WRITE 0x2 /* page can be written */
|
||||
#define PROT_EXEC 0x4 /* page can be executed */
|
||||
#define PROT_SEM 0x8 /* page may be used for atomic ops */
|
||||
#define PROT_NONE 0x0 /* page can not be accessed */
|
||||
#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
|
||||
#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
|
||||
#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
|
||||
#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
|
||||
#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
|
||||
#define MAP_LOCKED 0x2000 /* pages are locked */
|
||||
#define MAP_NORESERVE 0x4000 /* don't check for reservations */
|
||||
#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
|
||||
#define MAP_NONBLOCK 0x10000 /* do not block on IO */
|
||||
#define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */
|
||||
|
||||
#define MAP_SHARED 0x01 /* Share changes */
|
||||
#define MAP_PRIVATE 0x02 /* Changes are private */
|
||||
#define MAP_TYPE 0x0f /* Mask for type of mapping */
|
||||
#define MAP_FIXED 0x10 /* Interpret addr exactly */
|
||||
#define MAP_ANONYMOUS 0x20 /* don't use a file */
|
||||
#define MCL_CURRENT 1 /* lock all current mappings */
|
||||
#define MCL_FUTURE 2 /* lock all future mappings */
|
||||
|
||||
#define MS_ASYNC 1 /* sync memory asynchronously */
|
||||
#define MS_INVALIDATE 2 /* invalidate the caches */
|
||||
#define MS_SYNC 4 /* synchronous memory sync */
|
||||
|
||||
#define MADV_NORMAL 0 /* no further special treatment */
|
||||
#define MADV_RANDOM 1 /* expect random page references */
|
||||
#define MADV_SEQUENTIAL 2 /* expect sequential page references */
|
||||
#define MADV_WILLNEED 3 /* will need these pages */
|
||||
#define MADV_DONTNEED 4 /* don't need these pages */
|
||||
|
||||
/* common parameters: try to keep these consistent across architectures */
|
||||
#define MADV_REMOVE 9 /* remove these pages & resources */
|
||||
#define MADV_DONTFORK 10 /* don't inherit across fork */
|
||||
#define MADV_DOFORK 11 /* do inherit across fork */
|
||||
|
||||
/* compatibility flags */
|
||||
#define MAP_FILE 0
|
||||
|
||||
#endif
|
||||
#endif /* __ASM_GENERIC_MMAN_H */
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef __ASM_GENERIC_MMU_H
|
||||
#define __ASM_GENERIC_MMU_H
|
||||
|
||||
/*
|
||||
* This is the mmu.h header for nommu implementations.
|
||||
* Architectures with an MMU need something more complex.
|
||||
*/
|
||||
#ifndef __ASSEMBLY__
|
||||
typedef struct {
|
||||
struct vm_list_struct *vmlist;
|
||||
unsigned long end_brk;
|
||||
} mm_context_t;
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_GENERIC_MMU_H */
|
||||
@@ -0,0 +1,45 @@
|
||||
#ifndef __ASM_GENERIC_MMU_CONTEXT_H
|
||||
#define __ASM_GENERIC_MMU_CONTEXT_H
|
||||
|
||||
/*
|
||||
* Generic hooks for NOMMU architectures, which do not need to do
|
||||
* anything special here.
|
||||
*/
|
||||
|
||||
#include <asm-generic/mm_hooks.h>
|
||||
|
||||
struct task_struct;
|
||||
struct mm_struct;
|
||||
|
||||
static inline void enter_lazy_tlb(struct mm_struct *mm,
|
||||
struct task_struct *tsk)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int init_new_context(struct task_struct *tsk,
|
||||
struct mm_struct *mm)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void destroy_context(struct mm_struct *mm)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void deactivate_mm(struct task_struct *task,
|
||||
struct mm_struct *mm)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void switch_mm(struct mm_struct *prev,
|
||||
struct mm_struct *next,
|
||||
struct task_struct *tsk)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void activate_mm(struct mm_struct *prev_mm,
|
||||
struct mm_struct *next_mm)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* __ASM_GENERIC_MMU_CONTEXT_H */
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef __ASM_GENERIC_MODULE_H
|
||||
#define __ASM_GENERIC_MODULE_H
|
||||
|
||||
/*
|
||||
* Many architectures just need a simple module
|
||||
* loader without arch specific data.
|
||||
*/
|
||||
struct mod_arch_specific
|
||||
{
|
||||
};
|
||||
|
||||
#ifdef CONFIG_64BIT
|
||||
#define Elf_Shdr Elf64_Shdr
|
||||
#define Elf_Sym Elf64_Sym
|
||||
#define Elf_Ehdr Elf64_Ehdr
|
||||
#else
|
||||
#define Elf_Shdr Elf32_Shdr
|
||||
#define Elf_Sym Elf32_Sym
|
||||
#define Elf_Ehdr Elf32_Ehdr
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_GENERIC_MODULE_H */
|
||||
@@ -0,0 +1,47 @@
|
||||
#ifndef __ASM_GENERIC_MSGBUF_H
|
||||
#define __ASM_GENERIC_MSGBUF_H
|
||||
|
||||
#include <asm/bitsperlong.h>
|
||||
/*
|
||||
* generic msqid64_ds structure.
|
||||
*
|
||||
* Note extra padding because this structure is passed back and forth
|
||||
* between kernel and user space.
|
||||
*
|
||||
* msqid64_ds was originally meant to be architecture specific, but
|
||||
* everyone just ended up making identical copies without specific
|
||||
* optimizations, so we may just as well all use the same one.
|
||||
*
|
||||
* 64 bit architectures typically define a 64 bit __kernel_time_t,
|
||||
* so they do not need the first three padding words.
|
||||
* On big-endian systems, the padding is in the wrong place.
|
||||
*
|
||||
* Pad space is left for:
|
||||
* - 64-bit time_t to solve y2038 problem
|
||||
* - 2 miscellaneous 32-bit values
|
||||
*/
|
||||
|
||||
struct msqid64_ds {
|
||||
struct ipc64_perm msg_perm;
|
||||
__kernel_time_t msg_stime; /* last msgsnd time */
|
||||
#if __BITS_PER_LONG != 64
|
||||
unsigned long __unused1;
|
||||
#endif
|
||||
__kernel_time_t msg_rtime; /* last msgrcv time */
|
||||
#if __BITS_PER_LONG != 64
|
||||
unsigned long __unused2;
|
||||
#endif
|
||||
__kernel_time_t msg_ctime; /* last change time */
|
||||
#if __BITS_PER_LONG != 64
|
||||
unsigned long __unused3;
|
||||
#endif
|
||||
unsigned long msg_cbytes; /* current number of bytes on queue */
|
||||
unsigned long msg_qnum; /* number of messages in queue */
|
||||
unsigned long msg_qbytes; /* max number of bytes on queue */
|
||||
__kernel_pid_t msg_lspid; /* pid of last msgsnd */
|
||||
__kernel_pid_t msg_lrpid; /* last receive pid */
|
||||
unsigned long __unused4;
|
||||
unsigned long __unused5;
|
||||
};
|
||||
|
||||
#endif /* __ASM_GENERIC_MSGBUF_H */
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef __ASM_GENERIC_MUTEX_H
|
||||
#define __ASM_GENERIC_MUTEX_H
|
||||
/*
|
||||
* Pull in the generic implementation for the mutex fastpath,
|
||||
* which is a reasonable default on many architectures.
|
||||
*/
|
||||
|
||||
#include <asm-generic/mutex-dec.h>
|
||||
#endif /* __ASM_GENERIC_MUTEX_H */
|
||||
+92
-17
@@ -1,24 +1,99 @@
|
||||
#ifndef _ASM_GENERIC_PAGE_H
|
||||
#define _ASM_GENERIC_PAGE_H
|
||||
#ifndef __ASM_GENERIC_PAGE_H
|
||||
#define __ASM_GENERIC_PAGE_H
|
||||
/*
|
||||
* Generic page.h implementation, for NOMMU architectures.
|
||||
* This provides the dummy definitions for the memory management.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_MMU
|
||||
#error need to prove a real asm/page.h
|
||||
#endif
|
||||
|
||||
|
||||
/* PAGE_SHIFT determines the page size */
|
||||
|
||||
#define PAGE_SHIFT 12
|
||||
#ifdef __ASSEMBLY__
|
||||
#define PAGE_SIZE (1 << PAGE_SHIFT)
|
||||
#else
|
||||
#define PAGE_SIZE (1UL << PAGE_SHIFT)
|
||||
#endif
|
||||
#define PAGE_MASK (~(PAGE_SIZE-1))
|
||||
|
||||
#include <asm/setup.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
|
||||
#define free_user_page(page, addr) free_page(addr)
|
||||
|
||||
/* Pure 2^n version of get_order */
|
||||
static __inline__ __attribute_const__ int get_order(unsigned long size)
|
||||
{
|
||||
int order;
|
||||
#define clear_page(page) memset((page), 0, PAGE_SIZE)
|
||||
#define copy_page(to,from) memcpy((to), (from), PAGE_SIZE)
|
||||
|
||||
size = (size - 1) >> (PAGE_SHIFT - 1);
|
||||
order = -1;
|
||||
do {
|
||||
size >>= 1;
|
||||
order++;
|
||||
} while (size);
|
||||
return order;
|
||||
}
|
||||
#define clear_user_page(page, vaddr, pg) clear_page(page)
|
||||
#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
/*
|
||||
* These are used to make use of C type-checking..
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned long pte;
|
||||
} pte_t;
|
||||
typedef struct {
|
||||
unsigned long pmd[16];
|
||||
} pmd_t;
|
||||
typedef struct {
|
||||
unsigned long pgd;
|
||||
} pgd_t;
|
||||
typedef struct {
|
||||
unsigned long pgprot;
|
||||
} pgprot_t;
|
||||
typedef struct page *pgtable_t;
|
||||
|
||||
#endif /* _ASM_GENERIC_PAGE_H */
|
||||
#define pte_val(x) ((x).pte)
|
||||
#define pmd_val(x) ((&x)->pmd[0])
|
||||
#define pgd_val(x) ((x).pgd)
|
||||
#define pgprot_val(x) ((x).pgprot)
|
||||
|
||||
#define __pte(x) ((pte_t) { (x) } )
|
||||
#define __pmd(x) ((pmd_t) { (x) } )
|
||||
#define __pgd(x) ((pgd_t) { (x) } )
|
||||
#define __pgprot(x) ((pgprot_t) { (x) } )
|
||||
|
||||
extern unsigned long memory_start;
|
||||
extern unsigned long memory_end;
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
||||
#ifdef CONFIG_KERNEL_RAM_BASE_ADDRESS
|
||||
#define PAGE_OFFSET (CONFIG_KERNEL_RAM_BASE_ADDRESS)
|
||||
#else
|
||||
#define PAGE_OFFSET (0)
|
||||
#endif
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET))
|
||||
#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET)
|
||||
|
||||
#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
|
||||
#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
|
||||
|
||||
#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT))
|
||||
#define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET)
|
||||
|
||||
#ifndef page_to_phys
|
||||
#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
|
||||
#endif
|
||||
|
||||
#define pfn_valid(pfn) ((pfn) < max_mapnr)
|
||||
|
||||
#define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
|
||||
((void *)(kaddr) < (void *)memory_end))
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#include <asm-generic/memory_model.h>
|
||||
#include <asm-generic/getorder.h>
|
||||
|
||||
#endif /* __ASM_GENERIC_PAGE_H */
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef __ASM_GENERIC_PARAM_H
|
||||
#define __ASM_GENERIC_PARAM_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
# define HZ CONFIG_HZ /* Internal kernel timer frequency */
|
||||
# define USER_HZ 100 /* some user interfaces are */
|
||||
# define CLOCKS_PER_SEC (USER_HZ) /* in "ticks" like times() */
|
||||
#endif
|
||||
|
||||
#ifndef HZ
|
||||
#define HZ 100
|
||||
#endif
|
||||
|
||||
#ifndef EXEC_PAGESIZE
|
||||
#define EXEC_PAGESIZE 4096
|
||||
#endif
|
||||
|
||||
#ifndef NOGROUP
|
||||
#define NOGROUP (-1)
|
||||
#endif
|
||||
|
||||
#define MAXHOSTNAMELEN 64 /* max length of hostname */
|
||||
|
||||
#endif /* __ASM_GENERIC_PARAM_H */
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef __ASM_GENERIC_PARPORT_H
|
||||
#define __ASM_GENERIC_PARPORT_H
|
||||
|
||||
/*
|
||||
* An ISA bus may have i8255 parallel ports at well-known
|
||||
* locations in the I/O space, which are scanned by
|
||||
* parport_pc_find_isa_ports.
|
||||
*
|
||||
* Without ISA support, the driver will only attach
|
||||
* to devices on the PCI bus.
|
||||
*/
|
||||
|
||||
static int __devinit parport_pc_find_isa_ports(int autoirq, int autodma);
|
||||
static int __devinit parport_pc_find_nonpci_ports(int autoirq, int autodma)
|
||||
{
|
||||
#ifdef CONFIG_ISA
|
||||
return parport_pc_find_isa_ports(autoirq, autodma);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* __ASM_GENERIC_PARPORT_H */
|
||||
@@ -52,4 +52,12 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
|
||||
}
|
||||
#endif /* HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ */
|
||||
|
||||
/*
|
||||
* By default, assume that no iommu is in use and that the PCI
|
||||
* space is mapped to address physical 0.
|
||||
*/
|
||||
#ifndef PCI_DMA_BUS_IS_PHYS
|
||||
#define PCI_DMA_BUS_IS_PHYS (1)
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_GENERIC_PCI_H */
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef __ASM_GENERIC_PGALLOC_H
|
||||
#define __ASM_GENERIC_PGALLOC_H
|
||||
/*
|
||||
* an empty file is enough for a nommu architecture
|
||||
*/
|
||||
#ifdef CONFIG_MMU
|
||||
#error need to implement an architecture specific asm/pgalloc.h
|
||||
#endif
|
||||
|
||||
#define check_pgt_cache() do { } while (0)
|
||||
|
||||
#endif /* __ASM_GENERIC_PGALLOC_H */
|
||||
@@ -280,17 +280,18 @@ static inline void ptep_modify_prot_commit(struct mm_struct *mm,
|
||||
#endif
|
||||
|
||||
/*
|
||||
* A facility to provide batching of the reload of page tables with the
|
||||
* actual context switch code for paravirtualized guests. By convention,
|
||||
* only one of the lazy modes (CPU, MMU) should be active at any given
|
||||
* time, entry should never be nested, and entry and exits should always
|
||||
* be paired. This is for sanity of maintaining and reasoning about the
|
||||
* kernel code.
|
||||
* A facility to provide batching of the reload of page tables and
|
||||
* other process state with the actual context switch code for
|
||||
* paravirtualized guests. By convention, only one of the batched
|
||||
* update (lazy) modes (CPU, MMU) should be active at any given time,
|
||||
* entry should never be nested, and entry and exits should always be
|
||||
* paired. This is for sanity of maintaining and reasoning about the
|
||||
* kernel code. In this case, the exit (end of the context switch) is
|
||||
* in architecture-specific code, and so doesn't need a generic
|
||||
* definition.
|
||||
*/
|
||||
#ifndef __HAVE_ARCH_ENTER_LAZY_CPU_MODE
|
||||
#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)
|
||||
#ifndef __HAVE_ARCH_START_CONTEXT_SWITCH
|
||||
#define arch_start_context_switch(prev) do {} while (0)
|
||||
#endif
|
||||
|
||||
#ifndef __HAVE_PFNMAP_TRACKING
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
#ifndef __ASM_GENERIC_POSIX_TYPES_H
|
||||
#define __ASM_GENERIC_POSIX_TYPES_H
|
||||
|
||||
#include <asm/bitsperlong.h>
|
||||
/*
|
||||
* This file is generally used by user-level software, so you need to
|
||||
* be a little careful about namespace pollution etc.
|
||||
*
|
||||
* First the types that are often defined in different ways across
|
||||
* architectures, so that you can override them.
|
||||
*/
|
||||
|
||||
#ifndef __kernel_ino_t
|
||||
typedef unsigned long __kernel_ino_t;
|
||||
#endif
|
||||
|
||||
#ifndef __kernel_mode_t
|
||||
typedef unsigned int __kernel_mode_t;
|
||||
#endif
|
||||
|
||||
#ifndef __kernel_nlink_t
|
||||
typedef unsigned long __kernel_nlink_t;
|
||||
#endif
|
||||
|
||||
#ifndef __kernel_pid_t
|
||||
typedef int __kernel_pid_t;
|
||||
#endif
|
||||
|
||||
#ifndef __kernel_ipc_pid_t
|
||||
typedef int __kernel_ipc_pid_t;
|
||||
#endif
|
||||
|
||||
#ifndef __kernel_uid_t
|
||||
typedef unsigned int __kernel_uid_t;
|
||||
typedef unsigned int __kernel_gid_t;
|
||||
#endif
|
||||
|
||||
#ifndef __kernel_suseconds_t
|
||||
typedef long __kernel_suseconds_t;
|
||||
#endif
|
||||
|
||||
#ifndef __kernel_daddr_t
|
||||
typedef int __kernel_daddr_t;
|
||||
#endif
|
||||
|
||||
#ifndef __kernel_uid32_t
|
||||
typedef __kernel_uid_t __kernel_uid32_t;
|
||||
typedef __kernel_gid_t __kernel_gid32_t;
|
||||
#endif
|
||||
|
||||
#ifndef __kernel_old_uid_t
|
||||
typedef __kernel_uid_t __kernel_old_uid_t;
|
||||
typedef __kernel_gid_t __kernel_old_gid_t;
|
||||
#endif
|
||||
|
||||
#ifndef __kernel_old_dev_t
|
||||
typedef unsigned int __kernel_old_dev_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Most 32 bit architectures use "unsigned int" size_t,
|
||||
* and all 64 bit architectures use "unsigned long" size_t.
|
||||
*/
|
||||
#ifndef __kernel_size_t
|
||||
#if __BITS_PER_LONG != 64
|
||||
typedef unsigned int __kernel_size_t;
|
||||
typedef int __kernel_ssize_t;
|
||||
typedef int __kernel_ptrdiff_t;
|
||||
#else
|
||||
typedef unsigned long __kernel_size_t;
|
||||
typedef long __kernel_ssize_t;
|
||||
typedef long __kernel_ptrdiff_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* anything below here should be completely generic
|
||||
*/
|
||||
typedef long __kernel_off_t;
|
||||
typedef long long __kernel_loff_t;
|
||||
typedef long __kernel_time_t;
|
||||
typedef long __kernel_clock_t;
|
||||
typedef int __kernel_timer_t;
|
||||
typedef int __kernel_clockid_t;
|
||||
typedef char * __kernel_caddr_t;
|
||||
typedef unsigned short __kernel_uid16_t;
|
||||
typedef unsigned short __kernel_gid16_t;
|
||||
|
||||
typedef struct {
|
||||
int val[2];
|
||||
} __kernel_fsid_t;
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#undef __FD_SET
|
||||
static inline void __FD_SET(unsigned long __fd, __kernel_fd_set *__fdsetp)
|
||||
{
|
||||
unsigned long __tmp = __fd / __NFDBITS;
|
||||
unsigned long __rem = __fd % __NFDBITS;
|
||||
__fdsetp->fds_bits[__tmp] |= (1UL<<__rem);
|
||||
}
|
||||
|
||||
#undef __FD_CLR
|
||||
static inline void __FD_CLR(unsigned long __fd, __kernel_fd_set *__fdsetp)
|
||||
{
|
||||
unsigned long __tmp = __fd / __NFDBITS;
|
||||
unsigned long __rem = __fd % __NFDBITS;
|
||||
__fdsetp->fds_bits[__tmp] &= ~(1UL<<__rem);
|
||||
}
|
||||
|
||||
#undef __FD_ISSET
|
||||
static inline int __FD_ISSET(unsigned long __fd, const __kernel_fd_set *__p)
|
||||
{
|
||||
unsigned long __tmp = __fd / __NFDBITS;
|
||||
unsigned long __rem = __fd % __NFDBITS;
|
||||
return (__p->fds_bits[__tmp] & (1UL<<__rem)) != 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* This will unroll the loop for the normal constant case (8 ints,
|
||||
* for a 256-bit fd_set)
|
||||
*/
|
||||
#undef __FD_ZERO
|
||||
static inline void __FD_ZERO(__kernel_fd_set *__p)
|
||||
{
|
||||
unsigned long *__tmp = __p->fds_bits;
|
||||
int __i;
|
||||
|
||||
if (__builtin_constant_p(__FDSET_LONGS)) {
|
||||
switch (__FDSET_LONGS) {
|
||||
case 16:
|
||||
__tmp[ 0] = 0; __tmp[ 1] = 0;
|
||||
__tmp[ 2] = 0; __tmp[ 3] = 0;
|
||||
__tmp[ 4] = 0; __tmp[ 5] = 0;
|
||||
__tmp[ 6] = 0; __tmp[ 7] = 0;
|
||||
__tmp[ 8] = 0; __tmp[ 9] = 0;
|
||||
__tmp[10] = 0; __tmp[11] = 0;
|
||||
__tmp[12] = 0; __tmp[13] = 0;
|
||||
__tmp[14] = 0; __tmp[15] = 0;
|
||||
return;
|
||||
|
||||
case 8:
|
||||
__tmp[ 0] = 0; __tmp[ 1] = 0;
|
||||
__tmp[ 2] = 0; __tmp[ 3] = 0;
|
||||
__tmp[ 4] = 0; __tmp[ 5] = 0;
|
||||
__tmp[ 6] = 0; __tmp[ 7] = 0;
|
||||
return;
|
||||
|
||||
case 4:
|
||||
__tmp[ 0] = 0; __tmp[ 1] = 0;
|
||||
__tmp[ 2] = 0; __tmp[ 3] = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
__i = __FDSET_LONGS;
|
||||
while (__i) {
|
||||
__i--;
|
||||
*__tmp = 0;
|
||||
__tmp++;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* __ASM_GENERIC_POSIX_TYPES_H */
|
||||
@@ -202,7 +202,7 @@ static inline unsigned int get_rtc_ss(void)
|
||||
{
|
||||
struct rtc_time h;
|
||||
|
||||
__get_rtc_time(&h);
|
||||
get_rtc_time(&h);
|
||||
return h.tm_sec;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
#ifndef __ASM_GENERIC_SCATTERLIST_H
|
||||
#define __ASM_GENERIC_SCATTERLIST_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct scatterlist {
|
||||
#ifdef CONFIG_DEBUG_SG
|
||||
unsigned long sg_magic;
|
||||
#endif
|
||||
unsigned long page_link;
|
||||
unsigned int offset;
|
||||
unsigned int length;
|
||||
dma_addr_t dma_address;
|
||||
unsigned int dma_length;
|
||||
};
|
||||
|
||||
/*
|
||||
* These macros should be used after a dma_map_sg call has been done
|
||||
* to get bus addresses of each of the SG entries and their lengths.
|
||||
* You should only work with the number of sg entries pci_map_sg
|
||||
* returns, or alternatively stop on the first sg_dma_len(sg) which
|
||||
* is 0.
|
||||
*/
|
||||
#define sg_dma_address(sg) ((sg)->dma_address)
|
||||
#ifndef sg_dma_len
|
||||
/*
|
||||
* Normally, you have an iommu on 64 bit machines, but not on 32 bit
|
||||
* machines. Architectures that are differnt should override this.
|
||||
*/
|
||||
#if __BITS_PER_LONG == 64
|
||||
#define sg_dma_len(sg) ((sg)->dma_length)
|
||||
#else
|
||||
#define sg_dma_len(sg) ((sg)->length)
|
||||
#endif /* 64 bit */
|
||||
#endif /* sg_dma_len */
|
||||
|
||||
#ifndef ISA_DMA_THRESHOLD
|
||||
#define ISA_DMA_THRESHOLD (~0UL)
|
||||
#endif
|
||||
|
||||
#define ARCH_HAS_SG_CHAIN
|
||||
|
||||
#endif /* __ASM_GENERIC_SCATTERLIST_H */
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef __ASM_GENERIC_SEGMENT_H
|
||||
#define __ASM_GENERIC_SEGMENT_H
|
||||
/*
|
||||
* Only here because we have some old header files that expect it...
|
||||
*
|
||||
* New architectures probably don't want to have their own version.
|
||||
*/
|
||||
|
||||
#endif /* __ASM_GENERIC_SEGMENT_H */
|
||||
@@ -0,0 +1,38 @@
|
||||
#ifndef __ASM_GENERIC_SEMBUF_H
|
||||
#define __ASM_GENERIC_SEMBUF_H
|
||||
|
||||
#include <asm/bitsperlong.h>
|
||||
|
||||
/*
|
||||
* The semid64_ds structure for x86 architecture.
|
||||
* Note extra padding because this structure is passed back and forth
|
||||
* between kernel and user space.
|
||||
*
|
||||
* semid64_ds was originally meant to be architecture specific, but
|
||||
* everyone just ended up making identical copies without specific
|
||||
* optimizations, so we may just as well all use the same one.
|
||||
*
|
||||
* 64 bit architectures typically define a 64 bit __kernel_time_t,
|
||||
* so they do not need the first two padding words.
|
||||
* On big-endian systems, the padding is in the wrong place.
|
||||
*
|
||||
* Pad space is left for:
|
||||
* - 64-bit time_t to solve y2038 problem
|
||||
* - 2 miscellaneous 32-bit values
|
||||
*/
|
||||
struct semid64_ds {
|
||||
struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
|
||||
__kernel_time_t sem_otime; /* last semop time */
|
||||
#if __BITS_PER_LONG != 64
|
||||
unsigned long __unused1;
|
||||
#endif
|
||||
__kernel_time_t sem_ctime; /* last change time */
|
||||
#if __BITS_PER_LONG != 64
|
||||
unsigned long __unused2;
|
||||
#endif
|
||||
unsigned long sem_nsems; /* no. of semaphores in array */
|
||||
unsigned long __unused3;
|
||||
unsigned long __unused4;
|
||||
};
|
||||
|
||||
#endif /* __ASM_GENERIC_SEMBUF_H */
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef __ASM_GENERIC_SERIAL_H
|
||||
#define __ASM_GENERIC_SERIAL_H
|
||||
|
||||
/*
|
||||
* This should not be an architecture specific #define, oh well.
|
||||
*
|
||||
* Traditionally, it just describes i8250 and related serial ports
|
||||
* that have this clock rate.
|
||||
*/
|
||||
|
||||
#define BASE_BAUD (1843200 / 16)
|
||||
|
||||
#endif /* __ASM_GENERIC_SERIAL_H */
|
||||
@@ -0,0 +1,6 @@
|
||||
#ifndef __ASM_GENERIC_SETUP_H
|
||||
#define __ASM_GENERIC_SETUP_H
|
||||
|
||||
#define COMMAND_LINE_SIZE 512
|
||||
|
||||
#endif /* __ASM_GENERIC_SETUP_H */
|
||||
@@ -0,0 +1,59 @@
|
||||
#ifndef __ASM_GENERIC_SHMBUF_H
|
||||
#define __ASM_GENERIC_SHMBUF_H
|
||||
|
||||
#include <asm/bitsperlong.h>
|
||||
|
||||
/*
|
||||
* The shmid64_ds structure for x86 architecture.
|
||||
* Note extra padding because this structure is passed back and forth
|
||||
* between kernel and user space.
|
||||
*
|
||||
* shmid64_ds was originally meant to be architecture specific, but
|
||||
* everyone just ended up making identical copies without specific
|
||||
* optimizations, so we may just as well all use the same one.
|
||||
*
|
||||
* 64 bit architectures typically define a 64 bit __kernel_time_t,
|
||||
* so they do not need the first two padding words.
|
||||
* On big-endian systems, the padding is in the wrong place.
|
||||
*
|
||||
*
|
||||
* Pad space is left for:
|
||||
* - 64-bit time_t to solve y2038 problem
|
||||
* - 2 miscellaneous 32-bit values
|
||||
*/
|
||||
|
||||
struct shmid64_ds {
|
||||
struct ipc64_perm shm_perm; /* operation perms */
|
||||
size_t shm_segsz; /* size of segment (bytes) */
|
||||
__kernel_time_t shm_atime; /* last attach time */
|
||||
#if __BITS_PER_LONG != 64
|
||||
unsigned long __unused1;
|
||||
#endif
|
||||
__kernel_time_t shm_dtime; /* last detach time */
|
||||
#if __BITS_PER_LONG != 64
|
||||
unsigned long __unused2;
|
||||
#endif
|
||||
__kernel_time_t shm_ctime; /* last change time */
|
||||
#if __BITS_PER_LONG != 64
|
||||
unsigned long __unused3;
|
||||
#endif
|
||||
__kernel_pid_t shm_cpid; /* pid of creator */
|
||||
__kernel_pid_t shm_lpid; /* pid of last operator */
|
||||
unsigned long shm_nattch; /* no. of current attaches */
|
||||
unsigned long __unused4;
|
||||
unsigned long __unused5;
|
||||
};
|
||||
|
||||
struct shminfo64 {
|
||||
unsigned long shmmax;
|
||||
unsigned long shmmin;
|
||||
unsigned long shmmni;
|
||||
unsigned long shmseg;
|
||||
unsigned long shmall;
|
||||
unsigned long __unused1;
|
||||
unsigned long __unused2;
|
||||
unsigned long __unused3;
|
||||
unsigned long __unused4;
|
||||
};
|
||||
|
||||
#endif /* __ASM_GENERIC_SHMBUF_H */
|
||||
@@ -0,0 +1,6 @@
|
||||
#ifndef __ASM_GENERIC_SHMPARAM_H
|
||||
#define __ASM_GENERIC_SHMPARAM_H
|
||||
|
||||
#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
|
||||
|
||||
#endif /* _ASM_GENERIC_SHMPARAM_H */
|
||||
@@ -0,0 +1,28 @@
|
||||
#ifndef __ASM_GENERIC_SIGNAL_DEFS_H
|
||||
#define __ASM_GENERIC_SIGNAL_DEFS_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
#ifndef SIG_BLOCK
|
||||
#define SIG_BLOCK 0 /* for blocking signals */
|
||||
#endif
|
||||
#ifndef SIG_UNBLOCK
|
||||
#define SIG_UNBLOCK 1 /* for unblocking signals */
|
||||
#endif
|
||||
#ifndef SIG_SETMASK
|
||||
#define SIG_SETMASK 2 /* for setting the signal mask */
|
||||
#endif
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
typedef void __signalfn_t(int);
|
||||
typedef __signalfn_t __user *__sighandler_t;
|
||||
|
||||
typedef void __restorefn_t(void);
|
||||
typedef __restorefn_t __user *__sigrestore_t;
|
||||
|
||||
#define SIG_DFL ((__force __sighandler_t)0) /* default signal handling */
|
||||
#define SIG_IGN ((__force __sighandler_t)1) /* ignore signal */
|
||||
#define SIG_ERR ((__force __sighandler_t)-1) /* error return from signal */
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_GENERIC_SIGNAL_DEFS_H */
|
||||
+120
-17
@@ -1,28 +1,131 @@
|
||||
#ifndef __ASM_GENERIC_SIGNAL_H
|
||||
#define __ASM_GENERIC_SIGNAL_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#ifndef SIG_BLOCK
|
||||
#define SIG_BLOCK 0 /* for blocking signals */
|
||||
#endif
|
||||
#ifndef SIG_UNBLOCK
|
||||
#define SIG_UNBLOCK 1 /* for unblocking signals */
|
||||
#endif
|
||||
#ifndef SIG_SETMASK
|
||||
#define SIG_SETMASK 2 /* for setting the signal mask */
|
||||
#define _NSIG 64
|
||||
#define _NSIG_BPW __BITS_PER_LONG
|
||||
#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
|
||||
|
||||
#define SIGHUP 1
|
||||
#define SIGINT 2
|
||||
#define SIGQUIT 3
|
||||
#define SIGILL 4
|
||||
#define SIGTRAP 5
|
||||
#define SIGABRT 6
|
||||
#define SIGIOT 6
|
||||
#define SIGBUS 7
|
||||
#define SIGFPE 8
|
||||
#define SIGKILL 9
|
||||
#define SIGUSR1 10
|
||||
#define SIGSEGV 11
|
||||
#define SIGUSR2 12
|
||||
#define SIGPIPE 13
|
||||
#define SIGALRM 14
|
||||
#define SIGTERM 15
|
||||
#define SIGSTKFLT 16
|
||||
#define SIGCHLD 17
|
||||
#define SIGCONT 18
|
||||
#define SIGSTOP 19
|
||||
#define SIGTSTP 20
|
||||
#define SIGTTIN 21
|
||||
#define SIGTTOU 22
|
||||
#define SIGURG 23
|
||||
#define SIGXCPU 24
|
||||
#define SIGXFSZ 25
|
||||
#define SIGVTALRM 26
|
||||
#define SIGPROF 27
|
||||
#define SIGWINCH 28
|
||||
#define SIGIO 29
|
||||
#define SIGPOLL SIGIO
|
||||
/*
|
||||
#define SIGLOST 29
|
||||
*/
|
||||
#define SIGPWR 30
|
||||
#define SIGSYS 31
|
||||
#define SIGUNUSED 31
|
||||
|
||||
/* These should not be considered constants from userland. */
|
||||
#define SIGRTMIN 32
|
||||
#ifndef SIGRTMAX
|
||||
#define SIGRTMAX _NSIG
|
||||
#endif
|
||||
|
||||
/*
|
||||
* SA_FLAGS values:
|
||||
*
|
||||
* SA_ONSTACK indicates that a registered stack_t will be used.
|
||||
* SA_RESTART flag to get restarting signals (which were the default long ago)
|
||||
* SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
|
||||
* SA_RESETHAND clears the handler when the signal is delivered.
|
||||
* SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
|
||||
* SA_NODEFER prevents the current signal from being masked in the handler.
|
||||
*
|
||||
* SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
|
||||
* Unix names RESETHAND and NODEFER respectively.
|
||||
*/
|
||||
#define SA_NOCLDSTOP 0x00000001
|
||||
#define SA_NOCLDWAIT 0x00000002
|
||||
#define SA_SIGINFO 0x00000004
|
||||
#define SA_ONSTACK 0x08000000
|
||||
#define SA_RESTART 0x10000000
|
||||
#define SA_NODEFER 0x40000000
|
||||
#define SA_RESETHAND 0x80000000
|
||||
|
||||
#define SA_NOMASK SA_NODEFER
|
||||
#define SA_ONESHOT SA_RESETHAND
|
||||
|
||||
/*
|
||||
* New architectures should not define the obsolete
|
||||
* SA_RESTORER 0x04000000
|
||||
*/
|
||||
|
||||
/*
|
||||
* sigaltstack controls
|
||||
*/
|
||||
#define SS_ONSTACK 1
|
||||
#define SS_DISABLE 2
|
||||
|
||||
#define MINSIGSTKSZ 2048
|
||||
#define SIGSTKSZ 8192
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
typedef void __signalfn_t(int);
|
||||
typedef __signalfn_t __user *__sighandler_t;
|
||||
typedef struct {
|
||||
unsigned long sig[_NSIG_WORDS];
|
||||
} sigset_t;
|
||||
|
||||
typedef void __restorefn_t(void);
|
||||
typedef __restorefn_t __user *__sigrestore_t;
|
||||
/* not actually used, but required for linux/syscalls.h */
|
||||
typedef unsigned long old_sigset_t;
|
||||
|
||||
#define SIG_DFL ((__force __sighandler_t)0) /* default signal handling */
|
||||
#define SIG_IGN ((__force __sighandler_t)1) /* ignore signal */
|
||||
#define SIG_ERR ((__force __sighandler_t)-1) /* error return from signal */
|
||||
#include <asm-generic/signal-defs.h>
|
||||
|
||||
struct sigaction {
|
||||
__sighandler_t sa_handler;
|
||||
unsigned long sa_flags;
|
||||
#ifdef SA_RESTORER
|
||||
__sigrestore_t sa_restorer;
|
||||
#endif
|
||||
sigset_t sa_mask; /* mask last for extensibility */
|
||||
};
|
||||
|
||||
#endif /* __ASM_GENERIC_SIGNAL_H */
|
||||
struct k_sigaction {
|
||||
struct sigaction sa;
|
||||
};
|
||||
|
||||
typedef struct sigaltstack {
|
||||
void __user *ss_sp;
|
||||
int ss_flags;
|
||||
size_t ss_size;
|
||||
} stack_t;
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <asm/sigcontext.h>
|
||||
#undef __HAVE_ARCH_SIG_BITOPS
|
||||
|
||||
#define ptrace_signal_deliver(regs, cookie) do { } while (0)
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* _ASM_GENERIC_SIGNAL_H */
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
#ifndef __ASM_GENERIC_SOCKET_H
|
||||
#define __ASM_GENERIC_SOCKET_H
|
||||
|
||||
#include <asm/sockios.h>
|
||||
|
||||
/* For setsockopt(2) */
|
||||
#define SOL_SOCKET 1
|
||||
|
||||
#define SO_DEBUG 1
|
||||
#define SO_REUSEADDR 2
|
||||
#define SO_TYPE 3
|
||||
#define SO_ERROR 4
|
||||
#define SO_DONTROUTE 5
|
||||
#define SO_BROADCAST 6
|
||||
#define SO_SNDBUF 7
|
||||
#define SO_RCVBUF 8
|
||||
#define SO_SNDBUFFORCE 32
|
||||
#define SO_RCVBUFFORCE 33
|
||||
#define SO_KEEPALIVE 9
|
||||
#define SO_OOBINLINE 10
|
||||
#define SO_NO_CHECK 11
|
||||
#define SO_PRIORITY 12
|
||||
#define SO_LINGER 13
|
||||
#define SO_BSDCOMPAT 14
|
||||
/* To add :#define SO_REUSEPORT 15 */
|
||||
|
||||
#ifndef SO_PASSCRED /* powerpc only differs in these */
|
||||
#define SO_PASSCRED 16
|
||||
#define SO_PEERCRED 17
|
||||
#define SO_RCVLOWAT 18
|
||||
#define SO_SNDLOWAT 19
|
||||
#define SO_RCVTIMEO 20
|
||||
#define SO_SNDTIMEO 21
|
||||
#endif
|
||||
|
||||
/* Security levels - as per NRL IPv6 - don't actually do anything */
|
||||
#define SO_SECURITY_AUTHENTICATION 22
|
||||
#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
|
||||
#define SO_SECURITY_ENCRYPTION_NETWORK 24
|
||||
|
||||
#define SO_BINDTODEVICE 25
|
||||
|
||||
/* Socket filtering */
|
||||
#define SO_ATTACH_FILTER 26
|
||||
#define SO_DETACH_FILTER 27
|
||||
|
||||
#define SO_PEERNAME 28
|
||||
#define SO_TIMESTAMP 29
|
||||
#define SCM_TIMESTAMP SO_TIMESTAMP
|
||||
|
||||
#define SO_ACCEPTCONN 30
|
||||
|
||||
#define SO_PEERSEC 31
|
||||
#define SO_PASSSEC 34
|
||||
#define SO_TIMESTAMPNS 35
|
||||
#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
|
||||
|
||||
#define SO_MARK 36
|
||||
|
||||
#define SO_TIMESTAMPING 37
|
||||
#define SCM_TIMESTAMPING SO_TIMESTAMPING
|
||||
|
||||
#endif /* __ASM_GENERIC_SOCKET_H */
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef __ASM_GENERIC_SOCKIOS_H
|
||||
#define __ASM_GENERIC_SOCKIOS_H
|
||||
|
||||
/* Socket-level I/O control calls. */
|
||||
#define FIOSETOWN 0x8901
|
||||
#define SIOCSPGRP 0x8902
|
||||
#define FIOGETOWN 0x8903
|
||||
#define SIOCGPGRP 0x8904
|
||||
#define SIOCATMARK 0x8905
|
||||
#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
|
||||
#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
|
||||
|
||||
#endif /* __ASM_GENERIC_SOCKIOS_H */
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef __ASM_GENERIC_SPINLOCK_H
|
||||
#define __ASM_GENERIC_SPINLOCK_H
|
||||
/*
|
||||
* You need to implement asm/spinlock.h for SMP support. The generic
|
||||
* version does not handle SMP.
|
||||
*/
|
||||
#ifdef CONFIG_SMP
|
||||
#error need an architecture specific asm/spinlock.h
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_GENERIC_SPINLOCK_H */
|
||||
@@ -0,0 +1,72 @@
|
||||
#ifndef __ASM_GENERIC_STAT_H
|
||||
#define __ASM_GENERIC_STAT_H
|
||||
|
||||
/*
|
||||
* Everybody gets this wrong and has to stick with it for all
|
||||
* eternity. Hopefully, this version gets used by new architectures
|
||||
* so they don't fall into the same traps.
|
||||
*
|
||||
* stat64 is copied from powerpc64, with explicit padding added.
|
||||
* stat is the same structure layout on 64-bit, without the 'long long'
|
||||
* types.
|
||||
*
|
||||
* By convention, 64 bit architectures use the stat interface, while
|
||||
* 32 bit architectures use the stat64 interface. Note that we don't
|
||||
* provide an __old_kernel_stat here, which new architecture should
|
||||
* not have to start with.
|
||||
*/
|
||||
|
||||
#include <asm/bitsperlong.h>
|
||||
|
||||
#define STAT_HAVE_NSEC 1
|
||||
|
||||
struct stat {
|
||||
unsigned long st_dev; /* Device. */
|
||||
unsigned long st_ino; /* File serial number. */
|
||||
unsigned int st_mode; /* File mode. */
|
||||
unsigned int st_nlink; /* Link count. */
|
||||
unsigned int st_uid; /* User ID of the file's owner. */
|
||||
unsigned int st_gid; /* Group ID of the file's group. */
|
||||
unsigned long st_rdev; /* Device number, if device. */
|
||||
unsigned long __pad1;
|
||||
long st_size; /* Size of file, in bytes. */
|
||||
int st_blksize; /* Optimal block size for I/O. */
|
||||
int __pad2;
|
||||
long st_blocks; /* Number 512-byte blocks allocated. */
|
||||
int st_atime; /* Time of last access. */
|
||||
unsigned int st_atime_nsec;
|
||||
int st_mtime; /* Time of last modification. */
|
||||
unsigned int st_mtime_nsec;
|
||||
int st_ctime; /* Time of last status change. */
|
||||
unsigned int st_ctime_nsec;
|
||||
unsigned int __unused4;
|
||||
unsigned int __unused5;
|
||||
};
|
||||
|
||||
#if __BITS_PER_LONG != 64
|
||||
/* This matches struct stat64 in glibc2.1. Only used for 32 bit. */
|
||||
struct stat64 {
|
||||
unsigned long long st_dev; /* Device. */
|
||||
unsigned long long st_ino; /* File serial number. */
|
||||
unsigned int st_mode; /* File mode. */
|
||||
unsigned int st_nlink; /* Link count. */
|
||||
unsigned int st_uid; /* User ID of the file's owner. */
|
||||
unsigned int st_gid; /* Group ID of the file's group. */
|
||||
unsigned long long st_rdev; /* Device number, if device. */
|
||||
unsigned long long __pad1;
|
||||
long long st_size; /* Size of file, in bytes. */
|
||||
int st_blksize; /* Optimal block size for I/O. */
|
||||
int __pad2;
|
||||
long long st_blocks; /* Number 512-byte blocks allocated. */
|
||||
int st_atime; /* Time of last access. */
|
||||
unsigned int st_atime_nsec;
|
||||
int st_mtime; /* Time of last modification. */
|
||||
unsigned int st_mtime_nsec;
|
||||
int st_ctime; /* Time of last status change. */
|
||||
unsigned int st_ctime_nsec;
|
||||
unsigned int __unused4;
|
||||
unsigned int __unused5;
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_GENERIC_STAT_H */
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef __ASM_GENERIC_STRING_H
|
||||
#define __ASM_GENERIC_STRING_H
|
||||
/*
|
||||
* The kernel provides all required functions in lib/string.c
|
||||
*
|
||||
* Architectures probably want to provide at least their own optimized
|
||||
* memcpy and memset functions though.
|
||||
*/
|
||||
|
||||
#endif /* __ASM_GENERIC_STRING_H */
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef _ASM_GENERIC_SWAB_H
|
||||
#define _ASM_GENERIC_SWAB_H
|
||||
|
||||
#include <asm/bitsperlong.h>
|
||||
|
||||
/*
|
||||
* 32 bit architectures typically (but not always) want to
|
||||
* set __SWAB_64_THRU_32__. In user space, this is only
|
||||
* valid if the compiler supports 64 bit data types.
|
||||
*/
|
||||
|
||||
#if __BITS_PER_LONG == 32
|
||||
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
|
||||
#define __SWAB_64_THRU_32__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_GENERIC_SWAB_H */
|
||||
@@ -0,0 +1,60 @@
|
||||
#ifndef __ASM_GENERIC_SYSCALLS_H
|
||||
#define __ASM_GENERIC_SYSCALLS_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
/*
|
||||
* Calling conventions for these system calls can differ, so
|
||||
* it's possible to override them.
|
||||
*/
|
||||
#ifndef sys_clone
|
||||
asmlinkage long sys_clone(unsigned long clone_flags, unsigned long newsp,
|
||||
void __user *parent_tid, void __user *child_tid,
|
||||
struct pt_regs *regs);
|
||||
#endif
|
||||
|
||||
#ifndef sys_fork
|
||||
asmlinkage long sys_fork(struct pt_regs *regs);
|
||||
#endif
|
||||
|
||||
#ifndef sys_vfork
|
||||
asmlinkage long sys_vfork(struct pt_regs *regs);
|
||||
#endif
|
||||
|
||||
#ifndef sys_execve
|
||||
asmlinkage long sys_execve(char __user *filename, char __user * __user *argv,
|
||||
char __user * __user *envp, struct pt_regs *regs);
|
||||
#endif
|
||||
|
||||
#ifndef sys_mmap2
|
||||
asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
|
||||
unsigned long prot, unsigned long flags,
|
||||
unsigned long fd, unsigned long pgoff);
|
||||
#endif
|
||||
|
||||
#ifndef sys_mmap
|
||||
asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
|
||||
unsigned long prot, unsigned long flags,
|
||||
unsigned long fd, off_t pgoff);
|
||||
#endif
|
||||
|
||||
#ifndef sys_sigaltstack
|
||||
asmlinkage long sys_sigaltstack(const stack_t __user *, stack_t __user *,
|
||||
struct pt_regs *);
|
||||
#endif
|
||||
|
||||
#ifndef sys_rt_sigreturn
|
||||
asmlinkage long sys_rt_sigreturn(struct pt_regs *regs);
|
||||
#endif
|
||||
|
||||
#ifndef sys_rt_sigsuspend
|
||||
asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize);
|
||||
#endif
|
||||
|
||||
#ifndef sys_rt_sigaction
|
||||
asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act,
|
||||
struct sigaction __user *oact, size_t sigsetsize);
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_GENERIC_SYSCALLS_H */
|
||||
@@ -0,0 +1,161 @@
|
||||
/* Generic system definitions, based on MN10300 definitions.
|
||||
*
|
||||
* It should be possible to use these on really simple architectures,
|
||||
* but it serves more as a starting point for new ports.
|
||||
*
|
||||
* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
|
||||
* Written by David Howells (dhowells@redhat.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public Licence
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the Licence, or (at your option) any later version.
|
||||
*/
|
||||
#ifndef __ASM_GENERIC_SYSTEM_H
|
||||
#define __ASM_GENERIC_SYSTEM_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/irqflags.h>
|
||||
|
||||
#include <asm/cmpxchg-local.h>
|
||||
|
||||
struct task_struct;
|
||||
|
||||
/* context switching is now performed out-of-line in switch_to.S */
|
||||
extern struct task_struct *__switch_to(struct task_struct *,
|
||||
struct task_struct *);
|
||||
#define switch_to(prev, next, last) \
|
||||
do { \
|
||||
((last) = __switch_to((prev), (next))); \
|
||||
} while (0)
|
||||
|
||||
#define arch_align_stack(x) (x)
|
||||
|
||||
#define nop() asm volatile ("nop")
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
||||
/*
|
||||
* Force strict CPU ordering.
|
||||
* And yes, this is required on UP too when we're talking
|
||||
* to devices.
|
||||
*
|
||||
* This implementation only contains a compiler barrier.
|
||||
*/
|
||||
|
||||
#define mb() asm volatile ("": : :"memory")
|
||||
#define rmb() mb()
|
||||
#define wmb() asm volatile ("": : :"memory")
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
#define smp_mb() mb()
|
||||
#define smp_rmb() rmb()
|
||||
#define smp_wmb() wmb()
|
||||
#else
|
||||
#define smp_mb() barrier()
|
||||
#define smp_rmb() barrier()
|
||||
#define smp_wmb() barrier()
|
||||
#endif
|
||||
|
||||
#define set_mb(var, value) do { var = value; mb(); } while (0)
|
||||
#define set_wmb(var, value) do { var = value; wmb(); } while (0)
|
||||
|
||||
#define read_barrier_depends() do {} while (0)
|
||||
#define smp_read_barrier_depends() do {} while (0)
|
||||
|
||||
/*
|
||||
* we make sure local_irq_enable() doesn't cause priority inversion
|
||||
*/
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/* This function doesn't exist, so you'll get a linker error
|
||||
* if something tries to do an invalid xchg(). */
|
||||
extern void __xchg_called_with_bad_pointer(void);
|
||||
|
||||
static inline
|
||||
unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
|
||||
{
|
||||
unsigned long ret, flags;
|
||||
|
||||
switch (size) {
|
||||
case 1:
|
||||
#ifdef __xchg_u8
|
||||
return __xchg_u8(x, ptr);
|
||||
#else
|
||||
local_irq_save(flags);
|
||||
ret = *(volatile u8 *)ptr;
|
||||
*(volatile u8 *)ptr = x;
|
||||
local_irq_restore(flags);
|
||||
return ret;
|
||||
#endif /* __xchg_u8 */
|
||||
|
||||
case 2:
|
||||
#ifdef __xchg_u16
|
||||
return __xchg_u16(x, ptr);
|
||||
#else
|
||||
local_irq_save(flags);
|
||||
ret = *(volatile u16 *)ptr;
|
||||
*(volatile u16 *)ptr = x;
|
||||
local_irq_restore(flags);
|
||||
return ret;
|
||||
#endif /* __xchg_u16 */
|
||||
|
||||
case 4:
|
||||
#ifdef __xchg_u32
|
||||
return __xchg_u32(x, ptr);
|
||||
#else
|
||||
local_irq_save(flags);
|
||||
ret = *(volatile u32 *)ptr;
|
||||
*(volatile u32 *)ptr = x;
|
||||
local_irq_restore(flags);
|
||||
return ret;
|
||||
#endif /* __xchg_u32 */
|
||||
|
||||
#ifdef CONFIG_64BIT
|
||||
case 8:
|
||||
#ifdef __xchg_u64
|
||||
return __xchg_u64(x, ptr);
|
||||
#else
|
||||
local_irq_save(flags);
|
||||
ret = *(volatile u64 *)ptr;
|
||||
*(volatile u64 *)ptr = x;
|
||||
local_irq_restore(flags);
|
||||
return ret;
|
||||
#endif /* __xchg_u64 */
|
||||
#endif /* CONFIG_64BIT */
|
||||
|
||||
default:
|
||||
__xchg_called_with_bad_pointer();
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
||||
#define xchg(ptr, x) \
|
||||
((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
|
||||
|
||||
static inline unsigned long __cmpxchg(volatile unsigned long *m,
|
||||
unsigned long old, unsigned long new)
|
||||
{
|
||||
unsigned long retval;
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
retval = *m;
|
||||
if (retval == old)
|
||||
*m = new;
|
||||
local_irq_restore(flags);
|
||||
return retval;
|
||||
}
|
||||
|
||||
#define cmpxchg(ptr, o, n) \
|
||||
((__typeof__(*(ptr))) __cmpxchg((unsigned long *)(ptr), \
|
||||
(unsigned long)(o), \
|
||||
(unsigned long)(n)))
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __ASM_GENERIC_SYSTEM_H */
|
||||
@@ -0,0 +1,198 @@
|
||||
#ifndef __ASM_GENERIC_TERMBITS_H
|
||||
#define __ASM_GENERIC_TERMBITS_H
|
||||
|
||||
#include <linux/posix_types.h>
|
||||
|
||||
typedef unsigned char cc_t;
|
||||
typedef unsigned int speed_t;
|
||||
typedef unsigned int tcflag_t;
|
||||
|
||||
#define NCCS 19
|
||||
struct termios {
|
||||
tcflag_t c_iflag; /* input mode flags */
|
||||
tcflag_t c_oflag; /* output mode flags */
|
||||
tcflag_t c_cflag; /* control mode flags */
|
||||
tcflag_t c_lflag; /* local mode flags */
|
||||
cc_t c_line; /* line discipline */
|
||||
cc_t c_cc[NCCS]; /* control characters */
|
||||
};
|
||||
|
||||
struct termios2 {
|
||||
tcflag_t c_iflag; /* input mode flags */
|
||||
tcflag_t c_oflag; /* output mode flags */
|
||||
tcflag_t c_cflag; /* control mode flags */
|
||||
tcflag_t c_lflag; /* local mode flags */
|
||||
cc_t c_line; /* line discipline */
|
||||
cc_t c_cc[NCCS]; /* control characters */
|
||||
speed_t c_ispeed; /* input speed */
|
||||
speed_t c_ospeed; /* output speed */
|
||||
};
|
||||
|
||||
struct ktermios {
|
||||
tcflag_t c_iflag; /* input mode flags */
|
||||
tcflag_t c_oflag; /* output mode flags */
|
||||
tcflag_t c_cflag; /* control mode flags */
|
||||
tcflag_t c_lflag; /* local mode flags */
|
||||
cc_t c_line; /* line discipline */
|
||||
cc_t c_cc[NCCS]; /* control characters */
|
||||
speed_t c_ispeed; /* input speed */
|
||||
speed_t c_ospeed; /* output speed */
|
||||
};
|
||||
|
||||
/* c_cc characters */
|
||||
#define VINTR 0
|
||||
#define VQUIT 1
|
||||
#define VERASE 2
|
||||
#define VKILL 3
|
||||
#define VEOF 4
|
||||
#define VTIME 5
|
||||
#define VMIN 6
|
||||
#define VSWTC 7
|
||||
#define VSTART 8
|
||||
#define VSTOP 9
|
||||
#define VSUSP 10
|
||||
#define VEOL 11
|
||||
#define VREPRINT 12
|
||||
#define VDISCARD 13
|
||||
#define VWERASE 14
|
||||
#define VLNEXT 15
|
||||
#define VEOL2 16
|
||||
|
||||
/* c_iflag bits */
|
||||
#define IGNBRK 0000001
|
||||
#define BRKINT 0000002
|
||||
#define IGNPAR 0000004
|
||||
#define PARMRK 0000010
|
||||
#define INPCK 0000020
|
||||
#define ISTRIP 0000040
|
||||
#define INLCR 0000100
|
||||
#define IGNCR 0000200
|
||||
#define ICRNL 0000400
|
||||
#define IUCLC 0001000
|
||||
#define IXON 0002000
|
||||
#define IXANY 0004000
|
||||
#define IXOFF 0010000
|
||||
#define IMAXBEL 0020000
|
||||
#define IUTF8 0040000
|
||||
|
||||
/* c_oflag bits */
|
||||
#define OPOST 0000001
|
||||
#define OLCUC 0000002
|
||||
#define ONLCR 0000004
|
||||
#define OCRNL 0000010
|
||||
#define ONOCR 0000020
|
||||
#define ONLRET 0000040
|
||||
#define OFILL 0000100
|
||||
#define OFDEL 0000200
|
||||
#define NLDLY 0000400
|
||||
#define NL0 0000000
|
||||
#define NL1 0000400
|
||||
#define CRDLY 0003000
|
||||
#define CR0 0000000
|
||||
#define CR1 0001000
|
||||
#define CR2 0002000
|
||||
#define CR3 0003000
|
||||
#define TABDLY 0014000
|
||||
#define TAB0 0000000
|
||||
#define TAB1 0004000
|
||||
#define TAB2 0010000
|
||||
#define TAB3 0014000
|
||||
#define XTABS 0014000
|
||||
#define BSDLY 0020000
|
||||
#define BS0 0000000
|
||||
#define BS1 0020000
|
||||
#define VTDLY 0040000
|
||||
#define VT0 0000000
|
||||
#define VT1 0040000
|
||||
#define FFDLY 0100000
|
||||
#define FF0 0000000
|
||||
#define FF1 0100000
|
||||
|
||||
/* c_cflag bit meaning */
|
||||
#define CBAUD 0010017
|
||||
#define B0 0000000 /* hang up */
|
||||
#define B50 0000001
|
||||
#define B75 0000002
|
||||
#define B110 0000003
|
||||
#define B134 0000004
|
||||
#define B150 0000005
|
||||
#define B200 0000006
|
||||
#define B300 0000007
|
||||
#define B600 0000010
|
||||
#define B1200 0000011
|
||||
#define B1800 0000012
|
||||
#define B2400 0000013
|
||||
#define B4800 0000014
|
||||
#define B9600 0000015
|
||||
#define B19200 0000016
|
||||
#define B38400 0000017
|
||||
#define EXTA B19200
|
||||
#define EXTB B38400
|
||||
#define CSIZE 0000060
|
||||
#define CS5 0000000
|
||||
#define CS6 0000020
|
||||
#define CS7 0000040
|
||||
#define CS8 0000060
|
||||
#define CSTOPB 0000100
|
||||
#define CREAD 0000200
|
||||
#define PARENB 0000400
|
||||
#define PARODD 0001000
|
||||
#define HUPCL 0002000
|
||||
#define CLOCAL 0004000
|
||||
#define CBAUDEX 0010000
|
||||
#define BOTHER 0010000
|
||||
#define B57600 0010001
|
||||
#define B115200 0010002
|
||||
#define B230400 0010003
|
||||
#define B460800 0010004
|
||||
#define B500000 0010005
|
||||
#define B576000 0010006
|
||||
#define B921600 0010007
|
||||
#define B1000000 0010010
|
||||
#define B1152000 0010011
|
||||
#define B1500000 0010012
|
||||
#define B2000000 0010013
|
||||
#define B2500000 0010014
|
||||
#define B3000000 0010015
|
||||
#define B3500000 0010016
|
||||
#define B4000000 0010017
|
||||
#define CIBAUD 002003600000 /* input baud rate */
|
||||
#define CMSPAR 010000000000 /* mark or space (stick) parity */
|
||||
#define CRTSCTS 020000000000 /* flow control */
|
||||
|
||||
#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
|
||||
|
||||
/* c_lflag bits */
|
||||
#define ISIG 0000001
|
||||
#define ICANON 0000002
|
||||
#define XCASE 0000004
|
||||
#define ECHO 0000010
|
||||
#define ECHOE 0000020
|
||||
#define ECHOK 0000040
|
||||
#define ECHONL 0000100
|
||||
#define NOFLSH 0000200
|
||||
#define TOSTOP 0000400
|
||||
#define ECHOCTL 0001000
|
||||
#define ECHOPRT 0002000
|
||||
#define ECHOKE 0004000
|
||||
#define FLUSHO 0010000
|
||||
#define PENDIN 0040000
|
||||
#define IEXTEN 0100000
|
||||
|
||||
/* tcflow() and TCXONC use these */
|
||||
#define TCOOFF 0
|
||||
#define TCOON 1
|
||||
#define TCIOFF 2
|
||||
#define TCION 3
|
||||
|
||||
/* tcflush() and TCFLSH use these */
|
||||
#define TCIFLUSH 0
|
||||
#define TCOFLUSH 1
|
||||
#define TCIOFLUSH 2
|
||||
|
||||
/* tcsetattr uses these */
|
||||
#define TCSANOW 0
|
||||
#define TCSADRAIN 1
|
||||
#define TCSAFLUSH 2
|
||||
|
||||
#endif /* __ASM_GENERIC_TERMBITS_H */
|
||||
@@ -0,0 +1,77 @@
|
||||
/* termios.h: generic termios/termio user copying/translation
|
||||
*/
|
||||
|
||||
#ifndef _ASM_GENERIC_TERMIOS_BASE_H
|
||||
#define _ASM_GENERIC_TERMIOS_BASE_H
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#ifndef __ARCH_TERMIO_GETPUT
|
||||
|
||||
/*
|
||||
* Translate a "termio" structure into a "termios". Ugh.
|
||||
*/
|
||||
static inline int user_termio_to_kernel_termios(struct ktermios *termios,
|
||||
struct termio __user *termio)
|
||||
{
|
||||
unsigned short tmp;
|
||||
|
||||
if (get_user(tmp, &termio->c_iflag) < 0)
|
||||
goto fault;
|
||||
termios->c_iflag = (0xffff0000 & termios->c_iflag) | tmp;
|
||||
|
||||
if (get_user(tmp, &termio->c_oflag) < 0)
|
||||
goto fault;
|
||||
termios->c_oflag = (0xffff0000 & termios->c_oflag) | tmp;
|
||||
|
||||
if (get_user(tmp, &termio->c_cflag) < 0)
|
||||
goto fault;
|
||||
termios->c_cflag = (0xffff0000 & termios->c_cflag) | tmp;
|
||||
|
||||
if (get_user(tmp, &termio->c_lflag) < 0)
|
||||
goto fault;
|
||||
termios->c_lflag = (0xffff0000 & termios->c_lflag) | tmp;
|
||||
|
||||
if (get_user(termios->c_line, &termio->c_line) < 0)
|
||||
goto fault;
|
||||
|
||||
if (copy_from_user(termios->c_cc, termio->c_cc, NCC) != 0)
|
||||
goto fault;
|
||||
|
||||
return 0;
|
||||
|
||||
fault:
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
/*
|
||||
* Translate a "termios" structure into a "termio". Ugh.
|
||||
*/
|
||||
static inline int kernel_termios_to_user_termio(struct termio __user *termio,
|
||||
struct ktermios *termios)
|
||||
{
|
||||
if (put_user(termios->c_iflag, &termio->c_iflag) < 0 ||
|
||||
put_user(termios->c_oflag, &termio->c_oflag) < 0 ||
|
||||
put_user(termios->c_cflag, &termio->c_cflag) < 0 ||
|
||||
put_user(termios->c_lflag, &termio->c_lflag) < 0 ||
|
||||
put_user(termios->c_line, &termio->c_line) < 0 ||
|
||||
copy_to_user(termio->c_cc, termios->c_cc, NCC) != 0)
|
||||
return -EFAULT;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef user_termios_to_kernel_termios
|
||||
#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios))
|
||||
#endif
|
||||
|
||||
#ifndef kernel_termios_to_user_termios
|
||||
#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios))
|
||||
#endif
|
||||
|
||||
#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
|
||||
#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
|
||||
|
||||
#endif /* __ARCH_TERMIO_GETPUT */
|
||||
|
||||
#endif /* _ASM_GENERIC_TERMIOS_BASE_H */
|
||||
@@ -1,18 +1,68 @@
|
||||
/* termios.h: generic termios/termio user copying/translation
|
||||
*/
|
||||
|
||||
#ifndef _ASM_GENERIC_TERMIOS_H
|
||||
#define _ASM_GENERIC_TERMIOS_H
|
||||
/*
|
||||
* Most architectures have straight copies of the x86 code, with
|
||||
* varying levels of bug fixes on top. Usually it's a good idea
|
||||
* to use this generic version instead, but be careful to avoid
|
||||
* ABI changes.
|
||||
* New architectures should not provide their own version.
|
||||
*/
|
||||
|
||||
#include <asm/termbits.h>
|
||||
#include <asm/ioctls.h>
|
||||
|
||||
struct winsize {
|
||||
unsigned short ws_row;
|
||||
unsigned short ws_col;
|
||||
unsigned short ws_xpixel;
|
||||
unsigned short ws_ypixel;
|
||||
};
|
||||
|
||||
#define NCC 8
|
||||
struct termio {
|
||||
unsigned short c_iflag; /* input mode flags */
|
||||
unsigned short c_oflag; /* output mode flags */
|
||||
unsigned short c_cflag; /* control mode flags */
|
||||
unsigned short c_lflag; /* local mode flags */
|
||||
unsigned char c_line; /* line discipline */
|
||||
unsigned char c_cc[NCC]; /* control characters */
|
||||
};
|
||||
|
||||
/* modem lines */
|
||||
#define TIOCM_LE 0x001
|
||||
#define TIOCM_DTR 0x002
|
||||
#define TIOCM_RTS 0x004
|
||||
#define TIOCM_ST 0x008
|
||||
#define TIOCM_SR 0x010
|
||||
#define TIOCM_CTS 0x020
|
||||
#define TIOCM_CAR 0x040
|
||||
#define TIOCM_RNG 0x080
|
||||
#define TIOCM_DSR 0x100
|
||||
#define TIOCM_CD TIOCM_CAR
|
||||
#define TIOCM_RI TIOCM_RNG
|
||||
#define TIOCM_OUT1 0x2000
|
||||
#define TIOCM_OUT2 0x4000
|
||||
#define TIOCM_LOOP 0x8000
|
||||
|
||||
/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#ifndef __ARCH_TERMIO_GETPUT
|
||||
/* intr=^C quit=^\ erase=del kill=^U
|
||||
eof=^D vtime=\0 vmin=\1 sxtc=\0
|
||||
start=^Q stop=^S susp=^Z eol=\0
|
||||
reprint=^R discard=^U werase=^W lnext=^V
|
||||
eol2=\0
|
||||
*/
|
||||
#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
|
||||
|
||||
/*
|
||||
* Translate a "termio" structure into a "termios". Ugh.
|
||||
*/
|
||||
static inline int user_termio_to_kernel_termios(struct ktermios *termios,
|
||||
struct termio __user *termio)
|
||||
const struct termio __user *termio)
|
||||
{
|
||||
unsigned short tmp;
|
||||
|
||||
@@ -61,17 +111,44 @@ static inline int kernel_termios_to_user_termio(struct termio __user *termio,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef user_termios_to_kernel_termios
|
||||
#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios))
|
||||
#endif
|
||||
#ifdef TCGETS2
|
||||
static inline int user_termios_to_kernel_termios(struct ktermios *k,
|
||||
struct termios2 __user *u)
|
||||
{
|
||||
return copy_from_user(k, u, sizeof(struct termios2));
|
||||
}
|
||||
|
||||
#ifndef kernel_termios_to_user_termios
|
||||
#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios))
|
||||
#endif
|
||||
static inline int kernel_termios_to_user_termios(struct termios2 __user *u,
|
||||
struct ktermios *k)
|
||||
{
|
||||
return copy_to_user(u, k, sizeof(struct termios2));
|
||||
}
|
||||
|
||||
#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
|
||||
#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
|
||||
static inline int user_termios_to_kernel_termios_1(struct ktermios *k,
|
||||
struct termios __user *u)
|
||||
{
|
||||
return copy_from_user(k, u, sizeof(struct termios));
|
||||
}
|
||||
|
||||
#endif /* __ARCH_TERMIO_GETPUT */
|
||||
static inline int kernel_termios_to_user_termios_1(struct termios __user *u,
|
||||
struct ktermios *k)
|
||||
{
|
||||
return copy_to_user(u, k, sizeof(struct termios));
|
||||
}
|
||||
#else /* TCGETS2 */
|
||||
static inline int user_termios_to_kernel_termios(struct ktermios *k,
|
||||
struct termios __user *u)
|
||||
{
|
||||
return copy_from_user(k, u, sizeof(struct termios));
|
||||
}
|
||||
|
||||
static inline int kernel_termios_to_user_termios(struct termios __user *u,
|
||||
struct ktermios *k)
|
||||
{
|
||||
return copy_to_user(u, k, sizeof(struct termios));
|
||||
}
|
||||
#endif /* TCGETS2 */
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _ASM_GENERIC_TERMIOS_H */
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef __ASM_GENERIC_TIMEX_H
|
||||
#define __ASM_GENERIC_TIMEX_H
|
||||
|
||||
/*
|
||||
* If you have a cycle counter, return the value here.
|
||||
*/
|
||||
typedef unsigned long cycles_t;
|
||||
#ifndef get_cycles
|
||||
static inline cycles_t get_cycles(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Architectures are encouraged to implement read_current_timer
|
||||
* and define this in order to avoid the expensive delay loop
|
||||
* calibration during boot.
|
||||
*/
|
||||
#undef ARCH_HAS_READ_CURRENT_TIMER
|
||||
|
||||
#endif /* __ASM_GENERIC_TIMEX_H */
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef __ASM_GENERIC_TLBFLUSH_H
|
||||
#define __ASM_GENERIC_TLBFLUSH_H
|
||||
/*
|
||||
* This is a dummy tlbflush implementation that can be used on all
|
||||
* nommu architectures.
|
||||
* If you have an MMU, you need to write your own functions.
|
||||
*/
|
||||
#ifdef CONFIG_MMU
|
||||
#error need to implement an architecture specific asm/tlbflush.h
|
||||
#endif
|
||||
|
||||
static inline void flush_tlb_mm(struct mm_struct *mm)
|
||||
{
|
||||
BUG();
|
||||
}
|
||||
|
||||
|
||||
#endif /* __ASM_GENERIC_TLBFLUSH_H */
|
||||
@@ -0,0 +1,42 @@
|
||||
#ifndef _ASM_GENERIC_TYPES_H
|
||||
#define _ASM_GENERIC_TYPES_H
|
||||
/*
|
||||
* int-ll64 is used practically everywhere now,
|
||||
* so use it as a reasonable default.
|
||||
*/
|
||||
#include <asm-generic/int-ll64.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
typedef unsigned short umode_t;
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
/*
|
||||
* These aren't exported outside the kernel to avoid name space clashes
|
||||
*/
|
||||
#ifdef __KERNEL__
|
||||
#ifndef __ASSEMBLY__
|
||||
/*
|
||||
* DMA addresses may be very different from physical addresses
|
||||
* and pointers. i386 and powerpc may have 64 bit DMA on 32 bit
|
||||
* systems, while sparc64 uses 32 bit DMA addresses for 64 bit
|
||||
* physical addresses.
|
||||
* This default defines dma_addr_t to have the same size as
|
||||
* phys_addr_t, which is the most common way.
|
||||
* Do not define the dma64_addr_t type, which never really
|
||||
* worked.
|
||||
*/
|
||||
#ifndef dma_addr_t
|
||||
#ifdef CONFIG_PHYS_ADDR_T_64BIT
|
||||
typedef u64 dma_addr_t;
|
||||
#else
|
||||
typedef u32 dma_addr_t;
|
||||
#endif /* CONFIG_PHYS_ADDR_T_64BIT */
|
||||
#endif /* dma_addr_t */
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _ASM_GENERIC_TYPES_H */
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef __ASM_GENERIC_UACCESS_UNALIGNED_H
|
||||
#define __ASM_GENERIC_UACCESS_UNALIGNED_H
|
||||
|
||||
/*
|
||||
* This macro should be used instead of __get_user() when accessing
|
||||
* values at locations that are not known to be aligned.
|
||||
*/
|
||||
#define __get_user_unaligned(x, ptr) \
|
||||
({ \
|
||||
__typeof__ (*(ptr)) __x; \
|
||||
__copy_from_user(&__x, (ptr), sizeof(*(ptr))) ? -EFAULT : 0; \
|
||||
(x) = __x; \
|
||||
})
|
||||
|
||||
|
||||
/*
|
||||
* This macro should be used instead of __put_user() when accessing
|
||||
* values at locations that are not known to be aligned.
|
||||
*/
|
||||
#define __put_user_unaligned(x, ptr) \
|
||||
({ \
|
||||
__typeof__ (*(ptr)) __x = (x); \
|
||||
__copy_to_user((ptr), &__x, sizeof(*(ptr))) ? -EFAULT : 0; \
|
||||
})
|
||||
|
||||
#endif /* __ASM_GENERIC_UACCESS_UNALIGNED_H */
|
||||
+316
-17
@@ -1,26 +1,325 @@
|
||||
#ifndef _ASM_GENERIC_UACCESS_H_
|
||||
#define _ASM_GENERIC_UACCESS_H_
|
||||
#ifndef __ASM_GENERIC_UACCESS_H
|
||||
#define __ASM_GENERIC_UACCESS_H
|
||||
|
||||
/*
|
||||
* This macro should be used instead of __get_user() when accessing
|
||||
* values at locations that are not known to be aligned.
|
||||
* User space memory access functions, these should work
|
||||
* on a ny machine that has kernel and user data in the same
|
||||
* address space, e.g. all NOMMU machines.
|
||||
*/
|
||||
#define __get_user_unaligned(x, ptr) \
|
||||
({ \
|
||||
__typeof__ (*(ptr)) __x; \
|
||||
__copy_from_user(&__x, (ptr), sizeof(*(ptr))) ? -EFAULT : 0; \
|
||||
(x) = __x; \
|
||||
})
|
||||
#include <linux/sched.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/string.h>
|
||||
|
||||
#include <asm/segment.h>
|
||||
|
||||
#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
|
||||
|
||||
#ifndef KERNEL_DS
|
||||
#define KERNEL_DS MAKE_MM_SEG(~0UL)
|
||||
#endif
|
||||
|
||||
#ifndef USER_DS
|
||||
#define USER_DS MAKE_MM_SEG(TASK_SIZE - 1)
|
||||
#endif
|
||||
|
||||
#ifndef get_fs
|
||||
#define get_ds() (KERNEL_DS)
|
||||
#define get_fs() (current_thread_info()->addr_limit)
|
||||
|
||||
static inline void set_fs(mm_segment_t fs)
|
||||
{
|
||||
current_thread_info()->addr_limit = fs;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define segment_eq(a, b) ((a).seg == (b).seg)
|
||||
|
||||
#define VERIFY_READ 0
|
||||
#define VERIFY_WRITE 1
|
||||
|
||||
#define access_ok(type, addr, size) __access_ok((unsigned long)(addr),(size))
|
||||
|
||||
/*
|
||||
* This macro should be used instead of __put_user() when accessing
|
||||
* values at locations that are not known to be aligned.
|
||||
* The architecture should really override this if possible, at least
|
||||
* doing a check on the get_fs()
|
||||
*/
|
||||
#define __put_user_unaligned(x, ptr) \
|
||||
({ \
|
||||
__typeof__ (*(ptr)) __x = (x); \
|
||||
__copy_to_user((ptr), &__x, sizeof(*(ptr))) ? -EFAULT : 0; \
|
||||
#ifndef __access_ok
|
||||
static inline int __access_ok(unsigned long addr, unsigned long size)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The exception table consists of pairs of addresses: the first is the
|
||||
* address of an instruction that is allowed to fault, and the second is
|
||||
* the address at which the program should continue. No registers are
|
||||
* modified, so it is entirely up to the continuation code to figure out
|
||||
* what to do.
|
||||
*
|
||||
* All the routines below use bits of fixup code that are out of line
|
||||
* with the main instruction path. This means when everything is well,
|
||||
* we don't even have to jump over them. Further, they do not intrude
|
||||
* on our cache or tlb entries.
|
||||
*/
|
||||
|
||||
struct exception_table_entry
|
||||
{
|
||||
unsigned long insn, fixup;
|
||||
};
|
||||
|
||||
/* Returns 0 if exception not found and fixup otherwise. */
|
||||
extern unsigned long search_exception_table(unsigned long);
|
||||
|
||||
/*
|
||||
* architectures with an MMU should override these two
|
||||
*/
|
||||
#ifndef __copy_from_user
|
||||
static inline __must_check long __copy_from_user(void *to,
|
||||
const void __user * from, unsigned long n)
|
||||
{
|
||||
if (__builtin_constant_p(n)) {
|
||||
switch(n) {
|
||||
case 1:
|
||||
*(u8 *)to = *(u8 __force *)from;
|
||||
return 0;
|
||||
case 2:
|
||||
*(u16 *)to = *(u16 __force *)from;
|
||||
return 0;
|
||||
case 4:
|
||||
*(u32 *)to = *(u32 __force *)from;
|
||||
return 0;
|
||||
#ifdef CONFIG_64BIT
|
||||
case 8:
|
||||
*(u64 *)to = *(u64 __force *)from;
|
||||
return 0;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(to, (const void __force *)from, n);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef __copy_to_user
|
||||
static inline __must_check long __copy_to_user(void __user *to,
|
||||
const void *from, unsigned long n)
|
||||
{
|
||||
if (__builtin_constant_p(n)) {
|
||||
switch(n) {
|
||||
case 1:
|
||||
*(u8 __force *)to = *(u8 *)from;
|
||||
return 0;
|
||||
case 2:
|
||||
*(u16 __force *)to = *(u16 *)from;
|
||||
return 0;
|
||||
case 4:
|
||||
*(u32 __force *)to = *(u32 *)from;
|
||||
return 0;
|
||||
#ifdef CONFIG_64BIT
|
||||
case 8:
|
||||
*(u64 __force *)to = *(u64 *)from;
|
||||
return 0;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy((void __force *)to, from, n);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These are the main single-value transfer routines. They automatically
|
||||
* use the right size if we just have the right pointer type.
|
||||
* This version just falls back to copy_{from,to}_user, which should
|
||||
* provide a fast-path for small values.
|
||||
*/
|
||||
#define __put_user(x, ptr) \
|
||||
({ \
|
||||
__typeof__(*(ptr)) __x = (x); \
|
||||
int __pu_err = -EFAULT; \
|
||||
__chk_user_ptr(ptr); \
|
||||
switch (sizeof (*(ptr))) { \
|
||||
case 1: \
|
||||
case 2: \
|
||||
case 4: \
|
||||
case 8: \
|
||||
__pu_err = __put_user_fn(sizeof (*(ptr)), \
|
||||
ptr, &__x); \
|
||||
break; \
|
||||
default: \
|
||||
__put_user_bad(); \
|
||||
break; \
|
||||
} \
|
||||
__pu_err; \
|
||||
})
|
||||
|
||||
#endif /* _ASM_GENERIC_UACCESS_H */
|
||||
#define put_user(x, ptr) \
|
||||
({ \
|
||||
might_sleep(); \
|
||||
__access_ok(ptr, sizeof (*ptr)) ? \
|
||||
__put_user(x, ptr) : \
|
||||
-EFAULT; \
|
||||
})
|
||||
|
||||
static inline int __put_user_fn(size_t size, void __user *ptr, void *x)
|
||||
{
|
||||
size = __copy_to_user(ptr, x, size);
|
||||
return size ? -EFAULT : size;
|
||||
}
|
||||
|
||||
extern int __put_user_bad(void) __attribute__((noreturn));
|
||||
|
||||
#define __get_user(x, ptr) \
|
||||
({ \
|
||||
int __gu_err = -EFAULT; \
|
||||
__chk_user_ptr(ptr); \
|
||||
switch (sizeof(*(ptr))) { \
|
||||
case 1: { \
|
||||
unsigned char __x; \
|
||||
__gu_err = __get_user_fn(sizeof (*(ptr)), \
|
||||
ptr, &__x); \
|
||||
(x) = *(__force __typeof__(*(ptr)) *) &__x; \
|
||||
break; \
|
||||
}; \
|
||||
case 2: { \
|
||||
unsigned short __x; \
|
||||
__gu_err = __get_user_fn(sizeof (*(ptr)), \
|
||||
ptr, &__x); \
|
||||
(x) = *(__force __typeof__(*(ptr)) *) &__x; \
|
||||
break; \
|
||||
}; \
|
||||
case 4: { \
|
||||
unsigned int __x; \
|
||||
__gu_err = __get_user_fn(sizeof (*(ptr)), \
|
||||
ptr, &__x); \
|
||||
(x) = *(__force __typeof__(*(ptr)) *) &__x; \
|
||||
break; \
|
||||
}; \
|
||||
case 8: { \
|
||||
unsigned long long __x; \
|
||||
__gu_err = __get_user_fn(sizeof (*(ptr)), \
|
||||
ptr, &__x); \
|
||||
(x) = *(__force __typeof__(*(ptr)) *) &__x; \
|
||||
break; \
|
||||
}; \
|
||||
default: \
|
||||
__get_user_bad(); \
|
||||
break; \
|
||||
} \
|
||||
__gu_err; \
|
||||
})
|
||||
|
||||
#define get_user(x, ptr) \
|
||||
({ \
|
||||
might_sleep(); \
|
||||
__access_ok(ptr, sizeof (*ptr)) ? \
|
||||
__get_user(x, ptr) : \
|
||||
-EFAULT; \
|
||||
})
|
||||
|
||||
static inline int __get_user_fn(size_t size, const void __user *ptr, void *x)
|
||||
{
|
||||
size = __copy_from_user(x, ptr, size);
|
||||
return size ? -EFAULT : size;
|
||||
}
|
||||
|
||||
extern int __get_user_bad(void) __attribute__((noreturn));
|
||||
|
||||
#ifndef __copy_from_user_inatomic
|
||||
#define __copy_from_user_inatomic __copy_from_user
|
||||
#endif
|
||||
|
||||
#ifndef __copy_to_user_inatomic
|
||||
#define __copy_to_user_inatomic __copy_to_user
|
||||
#endif
|
||||
|
||||
static inline long copy_from_user(void *to,
|
||||
const void __user * from, unsigned long n)
|
||||
{
|
||||
might_sleep();
|
||||
if (__access_ok(from, n))
|
||||
return __copy_from_user(to, from, n);
|
||||
else
|
||||
return n;
|
||||
}
|
||||
|
||||
static inline long copy_to_user(void __user *to,
|
||||
const void *from, unsigned long n)
|
||||
{
|
||||
might_sleep();
|
||||
if (__access_ok(to, n))
|
||||
return __copy_to_user(to, from, n);
|
||||
else
|
||||
return n;
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy a null terminated string from userspace.
|
||||
*/
|
||||
#ifndef __strncpy_from_user
|
||||
static inline long
|
||||
__strncpy_from_user(char *dst, const char __user *src, long count)
|
||||
{
|
||||
char *tmp;
|
||||
strncpy(dst, (const char __force *)src, count);
|
||||
for (tmp = dst; *tmp && count > 0; tmp++, count--)
|
||||
;
|
||||
return (tmp - dst);
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline long
|
||||
strncpy_from_user(char *dst, const char __user *src, long count)
|
||||
{
|
||||
if (!__access_ok(src, 1))
|
||||
return -EFAULT;
|
||||
return __strncpy_from_user(dst, src, count);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the size of a string (including the ending 0)
|
||||
*
|
||||
* Return 0 on exception, a value greater than N if too long
|
||||
*/
|
||||
#ifndef strnlen_user
|
||||
static inline long strnlen_user(const char __user *src, long n)
|
||||
{
|
||||
return strlen((void * __force)src) + 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline long strlen_user(const char __user *src)
|
||||
{
|
||||
return strnlen_user(src, 32767);
|
||||
}
|
||||
|
||||
/*
|
||||
* Zero Userspace
|
||||
*/
|
||||
#ifndef __clear_user
|
||||
static inline __must_check unsigned long
|
||||
__clear_user(void __user *to, unsigned long n)
|
||||
{
|
||||
memset((void __force *)to, 0, n);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline __must_check unsigned long
|
||||
clear_user(void __user *to, unsigned long n)
|
||||
{
|
||||
might_sleep();
|
||||
if (!__access_ok(to, n))
|
||||
return n;
|
||||
|
||||
return __clear_user(to, n);
|
||||
}
|
||||
|
||||
#endif /* __ASM_GENERIC_UACCESS_H */
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef __ASM_GENERIC_UCONTEXT_H
|
||||
#define __ASM_GENERIC_UCONTEXT_H
|
||||
|
||||
struct ucontext {
|
||||
unsigned long uc_flags;
|
||||
struct ucontext *uc_link;
|
||||
stack_t uc_stack;
|
||||
struct sigcontext uc_mcontext;
|
||||
sigset_t uc_sigmask; /* mask last for extensibility */
|
||||
};
|
||||
|
||||
#endif /* __ASM_GENERIC_UCONTEXT_H */
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef __ASM_GENERIC_UNALIGNED_H
|
||||
#define __ASM_GENERIC_UNALIGNED_H
|
||||
|
||||
/*
|
||||
* This is the most generic implementation of unaligned accesses
|
||||
* and should work almost anywhere.
|
||||
*
|
||||
* If an architecture can handle unaligned accesses in hardware,
|
||||
* it may want to use the linux/unaligned/access_ok.h implementation
|
||||
* instead.
|
||||
*/
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#if defined(__LITTLE_ENDIAN)
|
||||
# include <linux/unaligned/le_struct.h>
|
||||
# include <linux/unaligned/be_byteshift.h>
|
||||
# include <linux/unaligned/generic.h>
|
||||
# define get_unaligned __get_unaligned_le
|
||||
# define put_unaligned __put_unaligned_le
|
||||
#elif defined(__BIG_ENDIAN)
|
||||
# include <linux/unaligned/be_struct.h>
|
||||
# include <linux/unaligned/le_byteshift.h>
|
||||
# include <linux/unaligned/generic.h>
|
||||
# define get_unaligned __get_unaligned_be
|
||||
# define put_unaligned __put_unaligned_be
|
||||
#else
|
||||
# error need to define endianess
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_GENERIC_UNALIGNED_H */
|
||||
@@ -0,0 +1,854 @@
|
||||
#if !defined(_ASM_GENERIC_UNISTD_H) || defined(__SYSCALL)
|
||||
#define _ASM_GENERIC_UNISTD_H
|
||||
|
||||
#include <asm/bitsperlong.h>
|
||||
|
||||
/*
|
||||
* This file contains the system call numbers, based on the
|
||||
* layout of the x86-64 architecture, which embeds the
|
||||
* pointer to the syscall in the table.
|
||||
*
|
||||
* As a basic principle, no duplication of functionality
|
||||
* should be added, e.g. we don't use lseek when llseek
|
||||
* is present. New architectures should use this file
|
||||
* and implement the less feature-full calls in user space.
|
||||
*/
|
||||
|
||||
#ifndef __SYSCALL
|
||||
#define __SYSCALL(x, y)
|
||||
#endif
|
||||
|
||||
#if __BITS_PER_LONG == 32
|
||||
#define __SC_3264(_nr, _32, _64) __SYSCALL(_nr, _32)
|
||||
#else
|
||||
#define __SC_3264(_nr, _32, _64) __SYSCALL(_nr, _64)
|
||||
#endif
|
||||
|
||||
#define __NR_io_setup 0
|
||||
__SYSCALL(__NR_io_setup, sys_io_setup)
|
||||
#define __NR_io_destroy 1
|
||||
__SYSCALL(__NR_io_destroy, sys_io_destroy)
|
||||
#define __NR_io_submit 2
|
||||
__SYSCALL(__NR_io_submit, sys_io_submit)
|
||||
#define __NR_io_cancel 3
|
||||
__SYSCALL(__NR_io_cancel, sys_io_cancel)
|
||||
#define __NR_io_getevents 4
|
||||
__SYSCALL(__NR_io_getevents, sys_io_getevents)
|
||||
|
||||
/* fs/xattr.c */
|
||||
#define __NR_setxattr 5
|
||||
__SYSCALL(__NR_setxattr, sys_setxattr)
|
||||
#define __NR_lsetxattr 6
|
||||
__SYSCALL(__NR_lsetxattr, sys_lsetxattr)
|
||||
#define __NR_fsetxattr 7
|
||||
__SYSCALL(__NR_fsetxattr, sys_fsetxattr)
|
||||
#define __NR_getxattr 8
|
||||
__SYSCALL(__NR_getxattr, sys_getxattr)
|
||||
#define __NR_lgetxattr 9
|
||||
__SYSCALL(__NR_lgetxattr, sys_lgetxattr)
|
||||
#define __NR_fgetxattr 10
|
||||
__SYSCALL(__NR_fgetxattr, sys_fgetxattr)
|
||||
#define __NR_listxattr 11
|
||||
__SYSCALL(__NR_listxattr, sys_listxattr)
|
||||
#define __NR_llistxattr 12
|
||||
__SYSCALL(__NR_llistxattr, sys_llistxattr)
|
||||
#define __NR_flistxattr 13
|
||||
__SYSCALL(__NR_flistxattr, sys_flistxattr)
|
||||
#define __NR_removexattr 14
|
||||
__SYSCALL(__NR_removexattr, sys_removexattr)
|
||||
#define __NR_lremovexattr 15
|
||||
__SYSCALL(__NR_lremovexattr, sys_lremovexattr)
|
||||
#define __NR_fremovexattr 16
|
||||
__SYSCALL(__NR_fremovexattr, sys_fremovexattr)
|
||||
|
||||
/* fs/dcache.c */
|
||||
#define __NR_getcwd 17
|
||||
__SYSCALL(__NR_getcwd, sys_getcwd)
|
||||
|
||||
/* fs/cookies.c */
|
||||
#define __NR_lookup_dcookie 18
|
||||
__SYSCALL(__NR_lookup_dcookie, sys_lookup_dcookie)
|
||||
|
||||
/* fs/eventfd.c */
|
||||
#define __NR_eventfd2 19
|
||||
__SYSCALL(__NR_eventfd2, sys_eventfd2)
|
||||
|
||||
/* fs/eventpoll.c */
|
||||
#define __NR_epoll_create1 20
|
||||
__SYSCALL(__NR_epoll_create1, sys_epoll_create1)
|
||||
#define __NR_epoll_ctl 21
|
||||
__SYSCALL(__NR_epoll_ctl, sys_epoll_ctl)
|
||||
#define __NR_epoll_pwait 22
|
||||
__SYSCALL(__NR_epoll_pwait, sys_epoll_pwait)
|
||||
|
||||
/* fs/fcntl.c */
|
||||
#define __NR_dup 23
|
||||
__SYSCALL(__NR_dup, sys_dup)
|
||||
#define __NR_dup3 24
|
||||
__SYSCALL(__NR_dup3, sys_dup3)
|
||||
#define __NR3264_fcntl 25
|
||||
__SC_3264(__NR3264_fcntl, sys_fcntl64, sys_fcntl)
|
||||
|
||||
/* fs/inotify_user.c */
|
||||
#define __NR_inotify_init1 26
|
||||
__SYSCALL(__NR_inotify_init1, sys_inotify_init1)
|
||||
#define __NR_inotify_add_watch 27
|
||||
__SYSCALL(__NR_inotify_add_watch, sys_inotify_add_watch)
|
||||
#define __NR_inotify_rm_watch 28
|
||||
__SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch)
|
||||
|
||||
/* fs/ioctl.c */
|
||||
#define __NR_ioctl 29
|
||||
__SYSCALL(__NR_ioctl, sys_ioctl)
|
||||
|
||||
/* fs/ioprio.c */
|
||||
#define __NR_ioprio_set 30
|
||||
__SYSCALL(__NR_ioprio_set, sys_ioprio_set)
|
||||
#define __NR_ioprio_get 31
|
||||
__SYSCALL(__NR_ioprio_get, sys_ioprio_get)
|
||||
|
||||
/* fs/locks.c */
|
||||
#define __NR_flock 32
|
||||
__SYSCALL(__NR_flock, sys_flock)
|
||||
|
||||
/* fs/namei.c */
|
||||
#define __NR_mknodat 33
|
||||
__SYSCALL(__NR_mknodat, sys_mknodat)
|
||||
#define __NR_mkdirat 34
|
||||
__SYSCALL(__NR_mkdirat, sys_mkdirat)
|
||||
#define __NR_unlinkat 35
|
||||
__SYSCALL(__NR_unlinkat, sys_unlinkat)
|
||||
#define __NR_symlinkat 36
|
||||
__SYSCALL(__NR_symlinkat, sys_symlinkat)
|
||||
#define __NR_linkat 37
|
||||
__SYSCALL(__NR_linkat, sys_linkat)
|
||||
#define __NR_renameat 38
|
||||
__SYSCALL(__NR_renameat, sys_renameat)
|
||||
|
||||
/* fs/namespace.c */
|
||||
#define __NR_umount2 39
|
||||
__SYSCALL(__NR_umount2, sys_umount)
|
||||
#define __NR_mount 40
|
||||
__SYSCALL(__NR_mount, sys_mount)
|
||||
#define __NR_pivot_root 41
|
||||
__SYSCALL(__NR_pivot_root, sys_pivot_root)
|
||||
|
||||
/* fs/nfsctl.c */
|
||||
#define __NR_nfsservctl 42
|
||||
__SYSCALL(__NR_nfsservctl, sys_nfsservctl)
|
||||
|
||||
/* fs/open.c */
|
||||
#define __NR3264_statfs 43
|
||||
__SC_3264(__NR3264_statfs, sys_statfs64, sys_statfs)
|
||||
#define __NR3264_fstatfs 44
|
||||
__SC_3264(__NR3264_fstatfs, sys_fstatfs64, sys_fstatfs)
|
||||
#define __NR3264_truncate 45
|
||||
__SC_3264(__NR3264_truncate, sys_truncate64, sys_truncate)
|
||||
#define __NR3264_ftruncate 46
|
||||
__SC_3264(__NR3264_ftruncate, sys_ftruncate64, sys_ftruncate)
|
||||
|
||||
#define __NR_fallocate 47
|
||||
__SYSCALL(__NR_fallocate, sys_fallocate)
|
||||
#define __NR_faccessat 48
|
||||
__SYSCALL(__NR_faccessat, sys_faccessat)
|
||||
#define __NR_chdir 49
|
||||
__SYSCALL(__NR_chdir, sys_chdir)
|
||||
#define __NR_fchdir 50
|
||||
__SYSCALL(__NR_fchdir, sys_fchdir)
|
||||
#define __NR_chroot 51
|
||||
__SYSCALL(__NR_chroot, sys_chroot)
|
||||
#define __NR_fchmod 52
|
||||
__SYSCALL(__NR_fchmod, sys_fchmod)
|
||||
#define __NR_fchmodat 53
|
||||
__SYSCALL(__NR_fchmodat, sys_fchmodat)
|
||||
#define __NR_fchownat 54
|
||||
__SYSCALL(__NR_fchownat, sys_fchownat)
|
||||
#define __NR_fchown 55
|
||||
__SYSCALL(__NR_fchown, sys_fchown)
|
||||
#define __NR_openat 56
|
||||
__SYSCALL(__NR_openat, sys_openat)
|
||||
#define __NR_close 57
|
||||
__SYSCALL(__NR_close, sys_close)
|
||||
#define __NR_vhangup 58
|
||||
__SYSCALL(__NR_vhangup, sys_vhangup)
|
||||
|
||||
/* fs/pipe.c */
|
||||
#define __NR_pipe2 59
|
||||
__SYSCALL(__NR_pipe2, sys_pipe2)
|
||||
|
||||
/* fs/quota.c */
|
||||
#define __NR_quotactl 60
|
||||
__SYSCALL(__NR_quotactl, sys_quotactl)
|
||||
|
||||
/* fs/readdir.c */
|
||||
#define __NR_getdents64 61
|
||||
__SYSCALL(__NR_getdents64, sys_getdents64)
|
||||
|
||||
/* fs/read_write.c */
|
||||
#define __NR3264_lseek 62
|
||||
__SC_3264(__NR3264_lseek, sys_llseek, sys_lseek)
|
||||
#define __NR_read 63
|
||||
__SYSCALL(__NR_read, sys_read)
|
||||
#define __NR_write 64
|
||||
__SYSCALL(__NR_write, sys_write)
|
||||
#define __NR_readv 65
|
||||
__SYSCALL(__NR_readv, sys_readv)
|
||||
#define __NR_writev 66
|
||||
__SYSCALL(__NR_writev, sys_writev)
|
||||
#define __NR_pread64 67
|
||||
__SYSCALL(__NR_pread64, sys_pread64)
|
||||
#define __NR_pwrite64 68
|
||||
__SYSCALL(__NR_pwrite64, sys_pwrite64)
|
||||
#define __NR_preadv 69
|
||||
__SYSCALL(__NR_preadv, sys_preadv)
|
||||
#define __NR_pwritev 70
|
||||
__SYSCALL(__NR_pwritev, sys_pwritev)
|
||||
|
||||
/* fs/sendfile.c */
|
||||
#define __NR3264_sendfile 71
|
||||
__SC_3264(__NR3264_sendfile, sys_sendfile64, sys_sendfile)
|
||||
|
||||
/* fs/select.c */
|
||||
#define __NR_pselect6 72
|
||||
__SYSCALL(__NR_pselect6, sys_pselect6)
|
||||
#define __NR_ppoll 73
|
||||
__SYSCALL(__NR_ppoll, sys_ppoll)
|
||||
|
||||
/* fs/signalfd.c */
|
||||
#define __NR_signalfd4 74
|
||||
__SYSCALL(__NR_signalfd4, sys_signalfd4)
|
||||
|
||||
/* fs/splice.c */
|
||||
#define __NR_vmsplice 75
|
||||
__SYSCALL(__NR_vmsplice, sys_vmsplice)
|
||||
#define __NR_splice 76
|
||||
__SYSCALL(__NR_splice, sys_splice)
|
||||
#define __NR_tee 77
|
||||
__SYSCALL(__NR_tee, sys_tee)
|
||||
|
||||
/* fs/stat.c */
|
||||
#define __NR_readlinkat 78
|
||||
__SYSCALL(__NR_readlinkat, sys_readlinkat)
|
||||
#define __NR3264_fstatat 79
|
||||
__SC_3264(__NR3264_fstatat, sys_fstatat64, sys_newfstatat)
|
||||
#define __NR3264_fstat 80
|
||||
__SC_3264(__NR3264_fstat, sys_fstat64, sys_newfstat)
|
||||
|
||||
/* fs/sync.c */
|
||||
#define __NR_sync 81
|
||||
__SYSCALL(__NR_sync, sys_sync)
|
||||
#define __NR_fsync 82
|
||||
__SYSCALL(__NR_fsync, sys_fsync)
|
||||
#define __NR_fdatasync 83
|
||||
__SYSCALL(__NR_fdatasync, sys_fdatasync)
|
||||
#define __NR_sync_file_range 84
|
||||
__SYSCALL(__NR_sync_file_range, sys_sync_file_range) /* .long sys_sync_file_range2, */
|
||||
|
||||
/* fs/timerfd.c */
|
||||
#define __NR_timerfd_create 85
|
||||
__SYSCALL(__NR_timerfd_create, sys_timerfd_create)
|
||||
#define __NR_timerfd_settime 86
|
||||
__SYSCALL(__NR_timerfd_settime, sys_timerfd_settime)
|
||||
#define __NR_timerfd_gettime 87
|
||||
__SYSCALL(__NR_timerfd_gettime, sys_timerfd_gettime)
|
||||
|
||||
/* fs/utimes.c */
|
||||
#define __NR_utimensat 88
|
||||
__SYSCALL(__NR_utimensat, sys_utimensat)
|
||||
|
||||
/* kernel/acct.c */
|
||||
#define __NR_acct 89
|
||||
__SYSCALL(__NR_acct, sys_acct)
|
||||
|
||||
/* kernel/capability.c */
|
||||
#define __NR_capget 90
|
||||
__SYSCALL(__NR_capget, sys_capget)
|
||||
#define __NR_capset 91
|
||||
__SYSCALL(__NR_capset, sys_capset)
|
||||
|
||||
/* kernel/exec_domain.c */
|
||||
#define __NR_personality 92
|
||||
__SYSCALL(__NR_personality, sys_personality)
|
||||
|
||||
/* kernel/exit.c */
|
||||
#define __NR_exit 93
|
||||
__SYSCALL(__NR_exit, sys_exit)
|
||||
#define __NR_exit_group 94
|
||||
__SYSCALL(__NR_exit_group, sys_exit_group)
|
||||
#define __NR_waitid 95
|
||||
__SYSCALL(__NR_waitid, sys_waitid)
|
||||
|
||||
/* kernel/fork.c */
|
||||
#define __NR_set_tid_address 96
|
||||
__SYSCALL(__NR_set_tid_address, sys_set_tid_address)
|
||||
#define __NR_unshare 97
|
||||
__SYSCALL(__NR_unshare, sys_unshare)
|
||||
|
||||
/* kernel/futex.c */
|
||||
#define __NR_futex 98
|
||||
__SYSCALL(__NR_futex, sys_futex)
|
||||
#define __NR_set_robust_list 99
|
||||
__SYSCALL(__NR_set_robust_list, sys_set_robust_list)
|
||||
#define __NR_get_robust_list 100
|
||||
__SYSCALL(__NR_get_robust_list, sys_get_robust_list)
|
||||
|
||||
/* kernel/hrtimer.c */
|
||||
#define __NR_nanosleep 101
|
||||
__SYSCALL(__NR_nanosleep, sys_nanosleep)
|
||||
|
||||
/* kernel/itimer.c */
|
||||
#define __NR_getitimer 102
|
||||
__SYSCALL(__NR_getitimer, sys_getitimer)
|
||||
#define __NR_setitimer 103
|
||||
__SYSCALL(__NR_setitimer, sys_setitimer)
|
||||
|
||||
/* kernel/kexec.c */
|
||||
#define __NR_kexec_load 104
|
||||
__SYSCALL(__NR_kexec_load, sys_kexec_load)
|
||||
|
||||
/* kernel/module.c */
|
||||
#define __NR_init_module 105
|
||||
__SYSCALL(__NR_init_module, sys_init_module)
|
||||
#define __NR_delete_module 106
|
||||
__SYSCALL(__NR_delete_module, sys_delete_module)
|
||||
|
||||
/* kernel/posix-timers.c */
|
||||
#define __NR_timer_create 107
|
||||
__SYSCALL(__NR_timer_create, sys_timer_create)
|
||||
#define __NR_timer_gettime 108
|
||||
__SYSCALL(__NR_timer_gettime, sys_timer_gettime)
|
||||
#define __NR_timer_getoverrun 109
|
||||
__SYSCALL(__NR_timer_getoverrun, sys_timer_getoverrun)
|
||||
#define __NR_timer_settime 110
|
||||
__SYSCALL(__NR_timer_settime, sys_timer_settime)
|
||||
#define __NR_timer_delete 111
|
||||
__SYSCALL(__NR_timer_delete, sys_timer_delete)
|
||||
#define __NR_clock_settime 112
|
||||
__SYSCALL(__NR_clock_settime, sys_clock_settime)
|
||||
#define __NR_clock_gettime 113
|
||||
__SYSCALL(__NR_clock_gettime, sys_clock_gettime)
|
||||
#define __NR_clock_getres 114
|
||||
__SYSCALL(__NR_clock_getres, sys_clock_getres)
|
||||
#define __NR_clock_nanosleep 115
|
||||
__SYSCALL(__NR_clock_nanosleep, sys_clock_nanosleep)
|
||||
|
||||
/* kernel/printk.c */
|
||||
#define __NR_syslog 116
|
||||
__SYSCALL(__NR_syslog, sys_syslog)
|
||||
|
||||
/* kernel/ptrace.c */
|
||||
#define __NR_ptrace 117
|
||||
__SYSCALL(__NR_ptrace, sys_ptrace)
|
||||
|
||||
/* kernel/sched.c */
|
||||
#define __NR_sched_setparam 118
|
||||
__SYSCALL(__NR_sched_setparam, sys_sched_setparam)
|
||||
#define __NR_sched_setscheduler 119
|
||||
__SYSCALL(__NR_sched_setscheduler, sys_sched_setscheduler)
|
||||
#define __NR_sched_getscheduler 120
|
||||
__SYSCALL(__NR_sched_getscheduler, sys_sched_getscheduler)
|
||||
#define __NR_sched_getparam 121
|
||||
__SYSCALL(__NR_sched_getparam, sys_sched_getparam)
|
||||
#define __NR_sched_setaffinity 122
|
||||
__SYSCALL(__NR_sched_setaffinity, sys_sched_setaffinity)
|
||||
#define __NR_sched_getaffinity 123
|
||||
__SYSCALL(__NR_sched_getaffinity, sys_sched_getaffinity)
|
||||
#define __NR_sched_yield 124
|
||||
__SYSCALL(__NR_sched_yield, sys_sched_yield)
|
||||
#define __NR_sched_get_priority_max 125
|
||||
__SYSCALL(__NR_sched_get_priority_max, sys_sched_get_priority_max)
|
||||
#define __NR_sched_get_priority_min 126
|
||||
__SYSCALL(__NR_sched_get_priority_min, sys_sched_get_priority_min)
|
||||
#define __NR_sched_rr_get_interval 127
|
||||
__SYSCALL(__NR_sched_rr_get_interval, sys_sched_rr_get_interval)
|
||||
|
||||
/* kernel/signal.c */
|
||||
#define __NR_restart_syscall 128
|
||||
__SYSCALL(__NR_restart_syscall, sys_restart_syscall)
|
||||
#define __NR_kill 129
|
||||
__SYSCALL(__NR_kill, sys_kill)
|
||||
#define __NR_tkill 130
|
||||
__SYSCALL(__NR_tkill, sys_tkill)
|
||||
#define __NR_tgkill 131
|
||||
__SYSCALL(__NR_tgkill, sys_tgkill)
|
||||
#define __NR_sigaltstack 132
|
||||
__SYSCALL(__NR_sigaltstack, sys_sigaltstack)
|
||||
#define __NR_rt_sigsuspend 133
|
||||
__SYSCALL(__NR_rt_sigsuspend, sys_rt_sigsuspend) /* __ARCH_WANT_SYS_RT_SIGSUSPEND */
|
||||
#define __NR_rt_sigaction 134
|
||||
__SYSCALL(__NR_rt_sigaction, sys_rt_sigaction) /* __ARCH_WANT_SYS_RT_SIGACTION */
|
||||
#define __NR_rt_sigprocmask 135
|
||||
__SYSCALL(__NR_rt_sigprocmask, sys_rt_sigprocmask)
|
||||
#define __NR_rt_sigpending 136
|
||||
__SYSCALL(__NR_rt_sigpending, sys_rt_sigpending)
|
||||
#define __NR_rt_sigtimedwait 137
|
||||
__SYSCALL(__NR_rt_sigtimedwait, sys_rt_sigtimedwait)
|
||||
#define __NR_rt_sigqueueinfo 138
|
||||
__SYSCALL(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo)
|
||||
#define __NR_rt_sigreturn 139
|
||||
__SYSCALL(__NR_rt_sigreturn, sys_rt_sigreturn) /* sys_rt_sigreturn_wrapper, */
|
||||
|
||||
/* kernel/sys.c */
|
||||
#define __NR_setpriority 140
|
||||
__SYSCALL(__NR_setpriority, sys_setpriority)
|
||||
#define __NR_getpriority 141
|
||||
__SYSCALL(__NR_getpriority, sys_getpriority)
|
||||
#define __NR_reboot 142
|
||||
__SYSCALL(__NR_reboot, sys_reboot)
|
||||
#define __NR_setregid 143
|
||||
__SYSCALL(__NR_setregid, sys_setregid)
|
||||
#define __NR_setgid 144
|
||||
__SYSCALL(__NR_setgid, sys_setgid)
|
||||
#define __NR_setreuid 145
|
||||
__SYSCALL(__NR_setreuid, sys_setreuid)
|
||||
#define __NR_setuid 146
|
||||
__SYSCALL(__NR_setuid, sys_setuid)
|
||||
#define __NR_setresuid 147
|
||||
__SYSCALL(__NR_setresuid, sys_setresuid)
|
||||
#define __NR_getresuid 148
|
||||
__SYSCALL(__NR_getresuid, sys_getresuid)
|
||||
#define __NR_setresgid 149
|
||||
__SYSCALL(__NR_setresgid, sys_setresgid)
|
||||
#define __NR_getresgid 150
|
||||
__SYSCALL(__NR_getresgid, sys_getresgid)
|
||||
#define __NR_setfsuid 151
|
||||
__SYSCALL(__NR_setfsuid, sys_setfsuid)
|
||||
#define __NR_setfsgid 152
|
||||
__SYSCALL(__NR_setfsgid, sys_setfsgid)
|
||||
#define __NR_times 153
|
||||
__SYSCALL(__NR_times, sys_times)
|
||||
#define __NR_setpgid 154
|
||||
__SYSCALL(__NR_setpgid, sys_setpgid)
|
||||
#define __NR_getpgid 155
|
||||
__SYSCALL(__NR_getpgid, sys_getpgid)
|
||||
#define __NR_getsid 156
|
||||
__SYSCALL(__NR_getsid, sys_getsid)
|
||||
#define __NR_setsid 157
|
||||
__SYSCALL(__NR_setsid, sys_setsid)
|
||||
#define __NR_getgroups 158
|
||||
__SYSCALL(__NR_getgroups, sys_getgroups)
|
||||
#define __NR_setgroups 159
|
||||
__SYSCALL(__NR_setgroups, sys_setgroups)
|
||||
#define __NR_uname 160
|
||||
__SYSCALL(__NR_uname, sys_newuname)
|
||||
#define __NR_sethostname 161
|
||||
__SYSCALL(__NR_sethostname, sys_sethostname)
|
||||
#define __NR_setdomainname 162
|
||||
__SYSCALL(__NR_setdomainname, sys_setdomainname)
|
||||
#define __NR_getrlimit 163
|
||||
__SYSCALL(__NR_getrlimit, sys_getrlimit)
|
||||
#define __NR_setrlimit 164
|
||||
__SYSCALL(__NR_setrlimit, sys_setrlimit)
|
||||
#define __NR_getrusage 165
|
||||
__SYSCALL(__NR_getrusage, sys_getrusage)
|
||||
#define __NR_umask 166
|
||||
__SYSCALL(__NR_umask, sys_umask)
|
||||
#define __NR_prctl 167
|
||||
__SYSCALL(__NR_prctl, sys_prctl)
|
||||
#define __NR_getcpu 168
|
||||
__SYSCALL(__NR_getcpu, sys_getcpu)
|
||||
|
||||
/* kernel/time.c */
|
||||
#define __NR_gettimeofday 169
|
||||
__SYSCALL(__NR_gettimeofday, sys_gettimeofday)
|
||||
#define __NR_settimeofday 170
|
||||
__SYSCALL(__NR_settimeofday, sys_settimeofday)
|
||||
#define __NR_adjtimex 171
|
||||
__SYSCALL(__NR_adjtimex, sys_adjtimex)
|
||||
|
||||
/* kernel/timer.c */
|
||||
#define __NR_getpid 172
|
||||
__SYSCALL(__NR_getpid, sys_getpid)
|
||||
#define __NR_getppid 173
|
||||
__SYSCALL(__NR_getppid, sys_getppid)
|
||||
#define __NR_getuid 174
|
||||
__SYSCALL(__NR_getuid, sys_getuid)
|
||||
#define __NR_geteuid 175
|
||||
__SYSCALL(__NR_geteuid, sys_geteuid)
|
||||
#define __NR_getgid 176
|
||||
__SYSCALL(__NR_getgid, sys_getgid)
|
||||
#define __NR_getegid 177
|
||||
__SYSCALL(__NR_getegid, sys_getegid)
|
||||
#define __NR_gettid 178
|
||||
__SYSCALL(__NR_gettid, sys_gettid)
|
||||
#define __NR_sysinfo 179
|
||||
__SYSCALL(__NR_sysinfo, sys_sysinfo)
|
||||
|
||||
/* ipc/mqueue.c */
|
||||
#define __NR_mq_open 180
|
||||
__SYSCALL(__NR_mq_open, sys_mq_open)
|
||||
#define __NR_mq_unlink 181
|
||||
__SYSCALL(__NR_mq_unlink, sys_mq_unlink)
|
||||
#define __NR_mq_timedsend 182
|
||||
__SYSCALL(__NR_mq_timedsend, sys_mq_timedsend)
|
||||
#define __NR_mq_timedreceive 183
|
||||
__SYSCALL(__NR_mq_timedreceive, sys_mq_timedreceive)
|
||||
#define __NR_mq_notify 184
|
||||
__SYSCALL(__NR_mq_notify, sys_mq_notify)
|
||||
#define __NR_mq_getsetattr 185
|
||||
__SYSCALL(__NR_mq_getsetattr, sys_mq_getsetattr)
|
||||
|
||||
/* ipc/msg.c */
|
||||
#define __NR_msgget 186
|
||||
__SYSCALL(__NR_msgget, sys_msgget)
|
||||
#define __NR_msgctl 187
|
||||
__SYSCALL(__NR_msgctl, sys_msgctl)
|
||||
#define __NR_msgrcv 188
|
||||
__SYSCALL(__NR_msgrcv, sys_msgrcv)
|
||||
#define __NR_msgsnd 189
|
||||
__SYSCALL(__NR_msgsnd, sys_msgsnd)
|
||||
|
||||
/* ipc/sem.c */
|
||||
#define __NR_semget 190
|
||||
__SYSCALL(__NR_semget, sys_semget)
|
||||
#define __NR_semctl 191
|
||||
__SYSCALL(__NR_semctl, sys_semctl)
|
||||
#define __NR_semtimedop 192
|
||||
__SYSCALL(__NR_semtimedop, sys_semtimedop)
|
||||
#define __NR_semop 193
|
||||
__SYSCALL(__NR_semop, sys_semop)
|
||||
|
||||
/* ipc/shm.c */
|
||||
#define __NR_shmget 194
|
||||
__SYSCALL(__NR_shmget, sys_shmget)
|
||||
#define __NR_shmctl 195
|
||||
__SYSCALL(__NR_shmctl, sys_shmctl)
|
||||
#define __NR_shmat 196
|
||||
__SYSCALL(__NR_shmat, sys_shmat)
|
||||
#define __NR_shmdt 197
|
||||
__SYSCALL(__NR_shmdt, sys_shmdt)
|
||||
|
||||
/* net/socket.c */
|
||||
#define __NR_socket 198
|
||||
__SYSCALL(__NR_socket, sys_socket)
|
||||
#define __NR_socketpair 199
|
||||
__SYSCALL(__NR_socketpair, sys_socketpair)
|
||||
#define __NR_bind 200
|
||||
__SYSCALL(__NR_bind, sys_bind)
|
||||
#define __NR_listen 201
|
||||
__SYSCALL(__NR_listen, sys_listen)
|
||||
#define __NR_accept 202
|
||||
__SYSCALL(__NR_accept, sys_accept)
|
||||
#define __NR_connect 203
|
||||
__SYSCALL(__NR_connect, sys_connect)
|
||||
#define __NR_getsockname 204
|
||||
__SYSCALL(__NR_getsockname, sys_getsockname)
|
||||
#define __NR_getpeername 205
|
||||
__SYSCALL(__NR_getpeername, sys_getpeername)
|
||||
#define __NR_sendto 206
|
||||
__SYSCALL(__NR_sendto, sys_sendto)
|
||||
#define __NR_recvfrom 207
|
||||
__SYSCALL(__NR_recvfrom, sys_recvfrom)
|
||||
#define __NR_setsockopt 208
|
||||
__SYSCALL(__NR_setsockopt, sys_setsockopt)
|
||||
#define __NR_getsockopt 209
|
||||
__SYSCALL(__NR_getsockopt, sys_getsockopt)
|
||||
#define __NR_shutdown 210
|
||||
__SYSCALL(__NR_shutdown, sys_shutdown)
|
||||
#define __NR_sendmsg 211
|
||||
__SYSCALL(__NR_sendmsg, sys_sendmsg)
|
||||
#define __NR_recvmsg 212
|
||||
__SYSCALL(__NR_recvmsg, sys_recvmsg)
|
||||
|
||||
/* mm/filemap.c */
|
||||
#define __NR_readahead 213
|
||||
__SYSCALL(__NR_readahead, sys_readahead)
|
||||
|
||||
/* mm/nommu.c, also with MMU */
|
||||
#define __NR_brk 214
|
||||
__SYSCALL(__NR_brk, sys_brk)
|
||||
#define __NR_munmap 215
|
||||
__SYSCALL(__NR_munmap, sys_munmap)
|
||||
#define __NR_mremap 216
|
||||
__SYSCALL(__NR_mremap, sys_mremap)
|
||||
|
||||
/* security/keys/keyctl.c */
|
||||
#define __NR_add_key 217
|
||||
__SYSCALL(__NR_add_key, sys_add_key)
|
||||
#define __NR_request_key 218
|
||||
__SYSCALL(__NR_request_key, sys_request_key)
|
||||
#define __NR_keyctl 219
|
||||
__SYSCALL(__NR_keyctl, sys_keyctl)
|
||||
|
||||
/* arch/example/kernel/sys_example.c */
|
||||
#define __NR_clone 220
|
||||
__SYSCALL(__NR_clone, sys_clone) /* .long sys_clone_wrapper */
|
||||
#define __NR_execve 221
|
||||
__SYSCALL(__NR_execve, sys_execve) /* .long sys_execve_wrapper */
|
||||
|
||||
#define __NR3264_mmap 222
|
||||
__SC_3264(__NR3264_mmap, sys_mmap2, sys_mmap)
|
||||
/* mm/fadvise.c */
|
||||
#define __NR3264_fadvise64 223
|
||||
__SC_3264(__NR3264_fadvise64, sys_fadvise64_64, sys_fadvise64)
|
||||
|
||||
/* mm/, CONFIG_MMU only */
|
||||
#ifndef __ARCH_NOMMU
|
||||
#define __NR_swapon 224
|
||||
__SYSCALL(__NR_swapon, sys_swapon)
|
||||
#define __NR_swapoff 225
|
||||
__SYSCALL(__NR_swapoff, sys_swapoff)
|
||||
#define __NR_mprotect 226
|
||||
__SYSCALL(__NR_mprotect, sys_mprotect)
|
||||
#define __NR_msync 227
|
||||
__SYSCALL(__NR_msync, sys_msync)
|
||||
#define __NR_mlock 228
|
||||
__SYSCALL(__NR_mlock, sys_mlock)
|
||||
#define __NR_munlock 229
|
||||
__SYSCALL(__NR_munlock, sys_munlock)
|
||||
#define __NR_mlockall 230
|
||||
__SYSCALL(__NR_mlockall, sys_mlockall)
|
||||
#define __NR_munlockall 231
|
||||
__SYSCALL(__NR_munlockall, sys_munlockall)
|
||||
#define __NR_mincore 232
|
||||
__SYSCALL(__NR_mincore, sys_mincore)
|
||||
#define __NR_madvise 233
|
||||
__SYSCALL(__NR_madvise, sys_madvise)
|
||||
#define __NR_remap_file_pages 234
|
||||
__SYSCALL(__NR_remap_file_pages, sys_remap_file_pages)
|
||||
#define __NR_mbind 235
|
||||
__SYSCALL(__NR_mbind, sys_mbind)
|
||||
#define __NR_get_mempolicy 236
|
||||
__SYSCALL(__NR_get_mempolicy, sys_get_mempolicy)
|
||||
#define __NR_set_mempolicy 237
|
||||
__SYSCALL(__NR_set_mempolicy, sys_set_mempolicy)
|
||||
#define __NR_migrate_pages 238
|
||||
__SYSCALL(__NR_migrate_pages, sys_migrate_pages)
|
||||
#define __NR_move_pages 239
|
||||
__SYSCALL(__NR_move_pages, sys_move_pages)
|
||||
#endif
|
||||
|
||||
#undef __NR_syscalls
|
||||
#define __NR_syscalls 240
|
||||
|
||||
/*
|
||||
* All syscalls below here should go away really,
|
||||
* these are provided for both review and as a porting
|
||||
* help for the C library version.
|
||||
*
|
||||
* Last chance: are any of these important enought to
|
||||
* enable by default?
|
||||
*/
|
||||
#ifdef __ARCH_WANT_SYSCALL_NO_AT
|
||||
#define __NR_open 1024
|
||||
__SYSCALL(__NR_open, sys_open)
|
||||
#define __NR_link 1025
|
||||
__SYSCALL(__NR_link, sys_link)
|
||||
#define __NR_unlink 1026
|
||||
__SYSCALL(__NR_unlink, sys_unlink)
|
||||
#define __NR_mknod 1027
|
||||
__SYSCALL(__NR_mknod, sys_mknod)
|
||||
#define __NR_chmod 1028
|
||||
__SYSCALL(__NR_chmod, sys_chmod)
|
||||
#define __NR_chown 1029
|
||||
__SYSCALL(__NR_chown, sys_chown)
|
||||
#define __NR_mkdir 1030
|
||||
__SYSCALL(__NR_mkdir, sys_mkdir)
|
||||
#define __NR_rmdir 1031
|
||||
__SYSCALL(__NR_rmdir, sys_rmdir)
|
||||
#define __NR_lchown 1032
|
||||
__SYSCALL(__NR_lchown, sys_lchown)
|
||||
#define __NR_access 1033
|
||||
__SYSCALL(__NR_access, sys_access)
|
||||
#define __NR_rename 1034
|
||||
__SYSCALL(__NR_rename, sys_rename)
|
||||
#define __NR_readlink 1035
|
||||
__SYSCALL(__NR_readlink, sys_readlink)
|
||||
#define __NR_symlink 1036
|
||||
__SYSCALL(__NR_symlink, sys_symlink)
|
||||
#define __NR_utimes 1037
|
||||
__SYSCALL(__NR_utimes, sys_utimes)
|
||||
#define __NR3264_stat 1038
|
||||
__SC_3264(__NR3264_stat, sys_stat64, sys_newstat)
|
||||
#define __NR3264_lstat 1039
|
||||
__SC_3264(__NR3264_lstat, sys_lstat64, sys_newlstat)
|
||||
|
||||
#undef __NR_syscalls
|
||||
#define __NR_syscalls (__NR3264_lstat+1)
|
||||
#endif /* __ARCH_WANT_SYSCALL_NO_AT */
|
||||
|
||||
#ifdef __ARCH_WANT_SYSCALL_NO_FLAGS
|
||||
#define __NR_pipe 1040
|
||||
__SYSCALL(__NR_pipe, sys_pipe)
|
||||
#define __NR_dup2 1041
|
||||
__SYSCALL(__NR_dup2, sys_dup2)
|
||||
#define __NR_epoll_create 1042
|
||||
__SYSCALL(__NR_epoll_create, sys_epoll_create)
|
||||
#define __NR_inotify_init 1043
|
||||
__SYSCALL(__NR_inotify_init, sys_inotify_init)
|
||||
#define __NR_eventfd 1044
|
||||
__SYSCALL(__NR_eventfd, sys_eventfd)
|
||||
#define __NR_signalfd 1045
|
||||
__SYSCALL(__NR_signalfd, sys_signalfd)
|
||||
|
||||
#undef __NR_syscalls
|
||||
#define __NR_syscalls (__NR_signalfd+1)
|
||||
#endif /* __ARCH_WANT_SYSCALL_NO_FLAGS */
|
||||
|
||||
#if __BITS_PER_LONG == 32 && defined(__ARCH_WANT_SYSCALL_OFF_T)
|
||||
#define __NR_sendfile 1046
|
||||
__SYSCALL(__NR_sendfile, sys_sendfile)
|
||||
#define __NR_ftruncate 1047
|
||||
__SYSCALL(__NR_ftruncate, sys_ftruncate)
|
||||
#define __NR_truncate 1048
|
||||
__SYSCALL(__NR_truncate, sys_truncate)
|
||||
#define __NR_stat 1049
|
||||
__SYSCALL(__NR_stat, sys_newstat)
|
||||
#define __NR_lstat 1050
|
||||
__SYSCALL(__NR_lstat, sys_newlstat)
|
||||
#define __NR_fstat 1051
|
||||
__SYSCALL(__NR_fstat, sys_newfstat)
|
||||
#define __NR_fcntl 1052
|
||||
__SYSCALL(__NR_fcntl, sys_fcntl)
|
||||
#define __NR_fadvise64 1053
|
||||
#define __ARCH_WANT_SYS_FADVISE64
|
||||
__SYSCALL(__NR_fadvise64, sys_fadvise64)
|
||||
#define __NR_newfstatat 1054
|
||||
#define __ARCH_WANT_SYS_NEWFSTATAT
|
||||
__SYSCALL(__NR_newfstatat, sys_newfstatat)
|
||||
#define __NR_fstatfs 1055
|
||||
__SYSCALL(__NR_fstatfs, sys_fstatfs)
|
||||
#define __NR_statfs 1056
|
||||
__SYSCALL(__NR_statfs, sys_statfs)
|
||||
#define __NR_lseek 1057
|
||||
__SYSCALL(__NR_lseek, sys_lseek)
|
||||
#define __NR_mmap 1058
|
||||
__SYSCALL(__NR_mmap, sys_mmap)
|
||||
|
||||
#undef __NR_syscalls
|
||||
#define __NR_syscalls (__NR_mmap+1)
|
||||
#endif /* 32 bit off_t syscalls */
|
||||
|
||||
#ifdef __ARCH_WANT_SYSCALL_DEPRECATED
|
||||
#define __NR_alarm 1059
|
||||
#define __ARCH_WANT_SYS_ALARM
|
||||
__SYSCALL(__NR_alarm, sys_alarm)
|
||||
#define __NR_getpgrp 1060
|
||||
#define __ARCH_WANT_SYS_GETPGRP
|
||||
__SYSCALL(__NR_getpgrp, sys_getpgrp)
|
||||
#define __NR_pause 1061
|
||||
#define __ARCH_WANT_SYS_PAUSE
|
||||
__SYSCALL(__NR_pause, sys_pause)
|
||||
#define __NR_time 1062
|
||||
#define __ARCH_WANT_SYS_TIME
|
||||
__SYSCALL(__NR_time, sys_time)
|
||||
#define __NR_utime 1063
|
||||
#define __ARCH_WANT_SYS_UTIME
|
||||
__SYSCALL(__NR_utime, sys_utime)
|
||||
|
||||
#define __NR_creat 1064
|
||||
__SYSCALL(__NR_creat, sys_creat)
|
||||
#define __NR_getdents 1065
|
||||
#define __ARCH_WANT_SYS_GETDENTS
|
||||
__SYSCALL(__NR_getdents, sys_getdents)
|
||||
#define __NR_futimesat 1066
|
||||
__SYSCALL(__NR_futimesat, sys_futimesat)
|
||||
#define __NR_select 1067
|
||||
#define __ARCH_WANT_SYS_SELECT
|
||||
__SYSCALL(__NR_select, sys_select)
|
||||
#define __NR_poll 1068
|
||||
__SYSCALL(__NR_poll, sys_poll)
|
||||
#define __NR_epoll_wait 1069
|
||||
__SYSCALL(__NR_epoll_wait, sys_epoll_wait)
|
||||
#define __NR_ustat 1070
|
||||
__SYSCALL(__NR_ustat, sys_ustat)
|
||||
#define __NR_vfork 1071
|
||||
__SYSCALL(__NR_vfork, sys_vfork)
|
||||
#define __NR_wait4 1072
|
||||
__SYSCALL(__NR_wait4, sys_wait4)
|
||||
#define __NR_recv 1073
|
||||
__SYSCALL(__NR_recv, sys_recv)
|
||||
#define __NR_send 1074
|
||||
__SYSCALL(__NR_send, sys_send)
|
||||
#define __NR_bdflush 1075
|
||||
__SYSCALL(__NR_bdflush, sys_bdflush)
|
||||
#define __NR_umount 1076
|
||||
__SYSCALL(__NR_umount, sys_oldumount)
|
||||
#define __ARCH_WANT_SYS_OLDUMOUNT
|
||||
#define __NR_uselib 1077
|
||||
__SYSCALL(__NR_uselib, sys_uselib)
|
||||
#define __NR__sysctl 1078
|
||||
__SYSCALL(__NR__sysctl, sys_sysctl)
|
||||
|
||||
#define __NR_fork 1079
|
||||
#ifdef CONFIG_MMU
|
||||
__SYSCALL(__NR_fork, sys_fork)
|
||||
#else
|
||||
__SYSCALL(__NR_fork, sys_ni_syscall)
|
||||
#endif /* CONFIG_MMU */
|
||||
|
||||
#undef __NR_syscalls
|
||||
#define __NR_syscalls (__NR_fork+1)
|
||||
|
||||
#endif /* __ARCH_WANT_SYSCALL_DEPRECATED */
|
||||
|
||||
/*
|
||||
* 32 bit systems traditionally used different
|
||||
* syscalls for off_t and loff_t arguments, while
|
||||
* 64 bit systems only need the off_t version.
|
||||
* For new 32 bit platforms, there is no need to
|
||||
* implement the old 32 bit off_t syscalls, so
|
||||
* they take different names.
|
||||
* Here we map the numbers so that both versions
|
||||
* use the same syscall table layout.
|
||||
*/
|
||||
#if __BITS_PER_LONG == 64
|
||||
#define __NR_fcntl __NR3264_fcntl
|
||||
#define __NR_statfs __NR3264_statfs
|
||||
#define __NR_fstatfs __NR3264_fstatfs
|
||||
#define __NR_truncate __NR3264_truncate
|
||||
#define __NR_ftruncate __NR3264_truncate
|
||||
#define __NR_lseek __NR3264_lseek
|
||||
#define __NR_sendfile __NR3264_sendfile
|
||||
#define __NR_newfstatat __NR3264_fstatat
|
||||
#define __NR_fstat __NR3264_fstat
|
||||
#define __NR_mmap __NR3264_mmap
|
||||
#define __NR_fadvise64 __NR3264_fadvise64
|
||||
#ifdef __NR3264_stat
|
||||
#define __NR_stat __NR3264_stat
|
||||
#define __NR_lstat __NR3264_lstat
|
||||
#endif
|
||||
#else
|
||||
#define __NR_fcntl64 __NR3264_fcntl
|
||||
#define __NR_statfs64 __NR3264_statfs
|
||||
#define __NR_fstatfs64 __NR3264_fstatfs
|
||||
#define __NR_truncate64 __NR3264_truncate
|
||||
#define __NR_ftruncate64 __NR3264_truncate
|
||||
#define __NR_llseek __NR3264_lseek
|
||||
#define __NR_sendfile64 __NR3264_sendfile
|
||||
#define __NR_fstatat64 __NR3264_fstatat
|
||||
#define __NR_fstat64 __NR3264_fstat
|
||||
#define __NR_mmap2 __NR3264_mmap
|
||||
#define __NR_fadvise64_64 __NR3264_fadvise64
|
||||
#ifdef __NR3264_stat
|
||||
#define __NR_stat64 __NR3264_stat
|
||||
#define __NR_lstat64 __NR3264_lstat
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/*
|
||||
* These are required system calls, we should
|
||||
* invert the logic eventually and let them
|
||||
* be selected by default.
|
||||
*/
|
||||
#if __BITS_PER_LONG == 32
|
||||
#define __ARCH_WANT_STAT64
|
||||
#define __ARCH_WANT_SYS_LLSEEK
|
||||
#endif
|
||||
#define __ARCH_WANT_SYS_RT_SIGACTION
|
||||
#define __ARCH_WANT_SYS_RT_SIGSUSPEND
|
||||
|
||||
/*
|
||||
* "Conditional" syscalls
|
||||
*
|
||||
* What we want is __attribute__((weak,alias("sys_ni_syscall"))),
|
||||
* but it doesn't work on all toolchains, so we just do it by hand
|
||||
*/
|
||||
#ifndef cond_syscall
|
||||
#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
|
||||
#endif
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _ASM_GENERIC_UNISTD_H */
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef __ASM_GENERIC_USER_H
|
||||
#define __ASM_GENERIC_USER_H
|
||||
/*
|
||||
* This file may define a 'struct user' structure. However, it it only
|
||||
* used for a.out file, which are not supported on new architectures.
|
||||
*/
|
||||
|
||||
#endif /* __ASM_GENERIC_USER_H */
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Access to VGA videoram
|
||||
*
|
||||
* (c) 1998 Martin Mares <mj@ucw.cz>
|
||||
*/
|
||||
#ifndef __ASM_GENERIC_VGA_H
|
||||
#define __ASM_GENERIC_VGA_H
|
||||
|
||||
/*
|
||||
* On most architectures that support VGA, we can just
|
||||
* recalculate addresses and then access the videoram
|
||||
* directly without any black magic.
|
||||
*
|
||||
* Everyone else needs to ioremap the address and use
|
||||
* proper I/O accesses.
|
||||
*/
|
||||
#ifndef VGA_MAP_MEM
|
||||
#define VGA_MAP_MEM(x, s) (unsigned long)phys_to_virt(x)
|
||||
#endif
|
||||
|
||||
#define vga_readb(x) (*(x))
|
||||
#define vga_writeb(x, y) (*(y) = (x))
|
||||
|
||||
#endif /* _ASM_GENERIC_VGA_H */
|
||||
@@ -1,4 +1,57 @@
|
||||
#include <linux/section-names.h>
|
||||
/*
|
||||
* Helper macros to support writing architecture specific
|
||||
* linker scripts.
|
||||
*
|
||||
* A minimal linker scripts has following content:
|
||||
* [This is a sample, architectures may have special requiriements]
|
||||
*
|
||||
* OUTPUT_FORMAT(...)
|
||||
* OUTPUT_ARCH(...)
|
||||
* ENTRY(...)
|
||||
* SECTIONS
|
||||
* {
|
||||
* . = START;
|
||||
* __init_begin = .;
|
||||
* HEAD_TEXT_SECTION
|
||||
* INIT_TEXT_SECTION(PAGE_SIZE)
|
||||
* INIT_DATA_SECTION(...)
|
||||
* PERCPU(PAGE_SIZE)
|
||||
* __init_end = .;
|
||||
*
|
||||
* _stext = .;
|
||||
* TEXT_SECTION = 0
|
||||
* _etext = .;
|
||||
*
|
||||
* _sdata = .;
|
||||
* RO_DATA_SECTION(PAGE_SIZE)
|
||||
* RW_DATA_SECTION(...)
|
||||
* _edata = .;
|
||||
*
|
||||
* EXCEPTION_TABLE(...)
|
||||
* NOTES
|
||||
*
|
||||
* __bss_start = .;
|
||||
* BSS_SECTION(0, 0)
|
||||
* __bss_stop = .;
|
||||
* _end = .;
|
||||
*
|
||||
* /DISCARD/ : {
|
||||
* EXIT_TEXT
|
||||
* EXIT_DATA
|
||||
* EXIT_CALL
|
||||
* }
|
||||
* STABS_DEBUG
|
||||
* DWARF_DEBUG
|
||||
* }
|
||||
*
|
||||
* [__init_begin, __init_end] is the init section that may be freed after init
|
||||
* [_stext, _etext] is the text section
|
||||
* [_sdata, _edata] is the data section
|
||||
*
|
||||
* Some of the included output section have their own set of constants.
|
||||
* Examples are: [__initramfs_start, __initramfs_end] for initramfs and
|
||||
* [__nosave_begin, __nosave_end] for the nosave data
|
||||
*/
|
||||
|
||||
#ifndef LOAD_OFFSET
|
||||
#define LOAD_OFFSET 0
|
||||
@@ -63,7 +116,7 @@
|
||||
#define BRANCH_PROFILE()
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_EVENT_TRACER
|
||||
#ifdef CONFIG_EVENT_TRACING
|
||||
#define FTRACE_EVENTS() VMLINUX_SYMBOL(__start_ftrace_events) = .; \
|
||||
*(_ftrace_events) \
|
||||
VMLINUX_SYMBOL(__stop_ftrace_events) = .;
|
||||
@@ -116,7 +169,36 @@
|
||||
FTRACE_EVENTS() \
|
||||
TRACE_SYSCALLS()
|
||||
|
||||
#define RO_DATA(align) \
|
||||
/*
|
||||
* Data section helpers
|
||||
*/
|
||||
#define NOSAVE_DATA \
|
||||
. = ALIGN(PAGE_SIZE); \
|
||||
VMLINUX_SYMBOL(__nosave_begin) = .; \
|
||||
*(.data.nosave) \
|
||||
. = ALIGN(PAGE_SIZE); \
|
||||
VMLINUX_SYMBOL(__nosave_end) = .;
|
||||
|
||||
#define PAGE_ALIGNED_DATA(page_align) \
|
||||
. = ALIGN(page_align); \
|
||||
*(.data.page_aligned)
|
||||
|
||||
#define READ_MOSTLY_DATA(align) \
|
||||
. = ALIGN(align); \
|
||||
*(.data.read_mostly)
|
||||
|
||||
#define CACHELINE_ALIGNED_DATA(align) \
|
||||
. = ALIGN(align); \
|
||||
*(.data.cacheline_aligned)
|
||||
|
||||
#define INIT_TASK(align) \
|
||||
. = ALIGN(align); \
|
||||
*(.data.init_task)
|
||||
|
||||
/*
|
||||
* Read only Data
|
||||
*/
|
||||
#define RO_DATA_SECTION(align) \
|
||||
. = ALIGN((align)); \
|
||||
.rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
|
||||
VMLINUX_SYMBOL(__start_rodata) = .; \
|
||||
@@ -270,9 +352,10 @@
|
||||
} \
|
||||
. = ALIGN((align));
|
||||
|
||||
/* RODATA provided for backward compatibility.
|
||||
/* RODATA & RO_DATA provided for backward compatibility.
|
||||
* All archs are supposed to use RO_DATA() */
|
||||
#define RODATA RO_DATA(4096)
|
||||
#define RODATA RO_DATA_SECTION(4096)
|
||||
#define RO_DATA(align) RO_DATA_SECTION(align)
|
||||
|
||||
#define SECURITY_INIT \
|
||||
.security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \
|
||||
@@ -330,16 +413,42 @@
|
||||
#endif
|
||||
|
||||
/* Section used for early init (in .S files) */
|
||||
#define HEAD_TEXT *(HEAD_TEXT_SECTION)
|
||||
#define HEAD_TEXT *(.head.text)
|
||||
|
||||
#define HEAD_TEXT_SECTION \
|
||||
.head.text : AT(ADDR(.head.text) - LOAD_OFFSET) { \
|
||||
HEAD_TEXT \
|
||||
}
|
||||
|
||||
/*
|
||||
* Exception table
|
||||
*/
|
||||
#define EXCEPTION_TABLE(align) \
|
||||
. = ALIGN(align); \
|
||||
__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { \
|
||||
VMLINUX_SYMBOL(__start___ex_table) = .; \
|
||||
*(__ex_table) \
|
||||
VMLINUX_SYMBOL(__stop___ex_table) = .; \
|
||||
}
|
||||
|
||||
/*
|
||||
* Init task
|
||||
*/
|
||||
#define INIT_TASK_DATA(align) \
|
||||
. = ALIGN(align); \
|
||||
.data.init_task : { \
|
||||
INIT_TASK \
|
||||
}
|
||||
|
||||
/* init and exit section handling */
|
||||
#define INIT_DATA \
|
||||
*(.init.data) \
|
||||
DEV_DISCARD(init.data) \
|
||||
DEV_DISCARD(init.rodata) \
|
||||
CPU_DISCARD(init.data) \
|
||||
CPU_DISCARD(init.rodata) \
|
||||
MEM_DISCARD(init.data) \
|
||||
*(.init.rodata) \
|
||||
DEV_DISCARD(init.rodata) \
|
||||
CPU_DISCARD(init.rodata) \
|
||||
MEM_DISCARD(init.rodata)
|
||||
|
||||
#define INIT_TEXT \
|
||||
@@ -363,9 +472,35 @@
|
||||
CPU_DISCARD(exit.text) \
|
||||
MEM_DISCARD(exit.text)
|
||||
|
||||
/* DWARF debug sections.
|
||||
Symbols in the DWARF debugging sections are relative to
|
||||
the beginning of the section so we begin them at 0. */
|
||||
#define EXIT_CALL \
|
||||
*(.exitcall.exit)
|
||||
|
||||
/*
|
||||
* bss (Block Started by Symbol) - uninitialized data
|
||||
* zeroed during startup
|
||||
*/
|
||||
#define SBSS \
|
||||
.sbss : AT(ADDR(.sbss) - LOAD_OFFSET) { \
|
||||
*(.sbss) \
|
||||
*(.scommon) \
|
||||
}
|
||||
|
||||
#define BSS(bss_align) \
|
||||
. = ALIGN(bss_align); \
|
||||
.bss : AT(ADDR(.bss) - LOAD_OFFSET) { \
|
||||
VMLINUX_SYMBOL(__bss_start) = .; \
|
||||
*(.bss.page_aligned) \
|
||||
*(.dynbss) \
|
||||
*(.bss) \
|
||||
*(COMMON) \
|
||||
VMLINUX_SYMBOL(__bss_stop) = .; \
|
||||
}
|
||||
|
||||
/*
|
||||
* DWARF debug sections.
|
||||
* Symbols in the DWARF debugging sections are relative to
|
||||
* the beginning of the section so we begin them at 0.
|
||||
*/
|
||||
#define DWARF_DEBUG \
|
||||
/* DWARF 1 */ \
|
||||
.debug 0 : { *(.debug) } \
|
||||
@@ -432,6 +567,12 @@
|
||||
VMLINUX_SYMBOL(__stop_notes) = .; \
|
||||
}
|
||||
|
||||
#define INIT_SETUP(initsetup_align) \
|
||||
. = ALIGN(initsetup_align); \
|
||||
VMLINUX_SYMBOL(__setup_start) = .; \
|
||||
*(.init.setup) \
|
||||
VMLINUX_SYMBOL(__setup_end) = .;
|
||||
|
||||
#define INITCALLS \
|
||||
*(.initcallearly.init) \
|
||||
VMLINUX_SYMBOL(__early_initcall_end) = .; \
|
||||
@@ -453,6 +594,31 @@
|
||||
*(.initcall7.init) \
|
||||
*(.initcall7s.init)
|
||||
|
||||
#define INIT_CALLS \
|
||||
VMLINUX_SYMBOL(__initcall_start) = .; \
|
||||
INITCALLS \
|
||||
VMLINUX_SYMBOL(__initcall_end) = .;
|
||||
|
||||
#define CON_INITCALL \
|
||||
VMLINUX_SYMBOL(__con_initcall_start) = .; \
|
||||
*(.con_initcall.init) \
|
||||
VMLINUX_SYMBOL(__con_initcall_end) = .;
|
||||
|
||||
#define SECURITY_INITCALL \
|
||||
VMLINUX_SYMBOL(__security_initcall_start) = .; \
|
||||
*(.security_initcall.init) \
|
||||
VMLINUX_SYMBOL(__security_initcall_end) = .;
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_INITRD
|
||||
#define INIT_RAM_FS \
|
||||
. = ALIGN(PAGE_SIZE); \
|
||||
VMLINUX_SYMBOL(__initramfs_start) = .; \
|
||||
*(.init.ramfs) \
|
||||
VMLINUX_SYMBOL(__initramfs_end) = .;
|
||||
#else
|
||||
#define INITRAMFS
|
||||
#endif
|
||||
|
||||
/**
|
||||
* PERCPU_VADDR - define output section for percpu area
|
||||
* @vaddr: explicit base address (optional)
|
||||
@@ -509,3 +675,58 @@
|
||||
*(.data.percpu.shared_aligned) \
|
||||
VMLINUX_SYMBOL(__per_cpu_end) = .; \
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Definition of the high level *_SECTION macros
|
||||
* They will fit only a subset of the architectures
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Writeable data.
|
||||
* All sections are combined in a single .data section.
|
||||
* The sections following CONSTRUCTORS are arranged so their
|
||||
* typical alignment matches.
|
||||
* A cacheline is typical/always less than a PAGE_SIZE so
|
||||
* the sections that has this restriction (or similar)
|
||||
* is located before the ones requiring PAGE_SIZE alignment.
|
||||
* NOSAVE_DATA starts and ends with a PAGE_SIZE alignment which
|
||||
* matches the requirment of PAGE_ALIGNED_DATA.
|
||||
*
|
||||
* use 0 as page_align if page_aligned data is not used */
|
||||
#define RW_DATA_SECTION(cacheline, nosave, pagealigned, inittask) \
|
||||
. = ALIGN(PAGE_SIZE); \
|
||||
.data : AT(ADDR(.data) - LOAD_OFFSET) { \
|
||||
INIT_TASK(inittask) \
|
||||
CACHELINE_ALIGNED_DATA(cacheline) \
|
||||
READ_MOSTLY_DATA(cacheline) \
|
||||
DATA_DATA \
|
||||
CONSTRUCTORS \
|
||||
NOSAVE_DATA(nosave) \
|
||||
PAGE_ALIGNED_DATA(pagealigned) \
|
||||
}
|
||||
|
||||
#define INIT_TEXT_SECTION(inittext_align) \
|
||||
. = ALIGN(inittext_align); \
|
||||
.init.text : AT(ADDR(.init.text) - LOAD_OFFSET) { \
|
||||
VMLINUX_SYMBOL(_sinittext) = .; \
|
||||
INIT_TEXT \
|
||||
VMLINUX_SYMBOL(_einittext) = .; \
|
||||
}
|
||||
|
||||
#define INIT_DATA_SECTION(initsetup_align) \
|
||||
.init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { \
|
||||
INIT_DATA \
|
||||
INIT_SETUP(initsetup_align) \
|
||||
INIT_CALLS \
|
||||
CON_INITCALL \
|
||||
SECURITY_INITCALL \
|
||||
INIT_RAM_FS \
|
||||
}
|
||||
|
||||
#define BSS_SECTION(sbss_align, bss_align) \
|
||||
SBSS \
|
||||
BSS(bss_align) \
|
||||
. = ALIGN(4);
|
||||
|
||||
|
||||
+85
-49
@@ -86,7 +86,17 @@ struct drm_device;
|
||||
|
||||
#include "drm_os_linux.h"
|
||||
#include "drm_hashtab.h"
|
||||
#include "drm_mm.h"
|
||||
|
||||
#define DRM_UT_CORE 0x01
|
||||
#define DRM_UT_DRIVER 0x02
|
||||
#define DRM_UT_KMS 0x04
|
||||
#define DRM_UT_MODE 0x08
|
||||
|
||||
extern void drm_ut_debug_printk(unsigned int request_level,
|
||||
const char *prefix,
|
||||
const char *function_name,
|
||||
const char *format, ...);
|
||||
/***********************************************************************/
|
||||
/** \name DRM template customization defaults */
|
||||
/*@{*/
|
||||
@@ -186,15 +196,57 @@ struct drm_device;
|
||||
* \param arg arguments
|
||||
*/
|
||||
#if DRM_DEBUG_CODE
|
||||
#define DRM_DEBUG(fmt, arg...) \
|
||||
#define DRM_DEBUG(fmt, args...) \
|
||||
do { \
|
||||
if ( drm_debug ) \
|
||||
printk(KERN_DEBUG \
|
||||
"[" DRM_NAME ":%s] " fmt , \
|
||||
__func__ , ##arg); \
|
||||
drm_ut_debug_printk(DRM_UT_CORE, DRM_NAME, \
|
||||
__func__, fmt, ##args); \
|
||||
} while (0)
|
||||
|
||||
#define DRM_DEBUG_DRIVER(prefix, fmt, args...) \
|
||||
do { \
|
||||
drm_ut_debug_printk(DRM_UT_DRIVER, prefix, \
|
||||
__func__, fmt, ##args); \
|
||||
} while (0)
|
||||
#define DRM_DEBUG_KMS(prefix, fmt, args...) \
|
||||
do { \
|
||||
drm_ut_debug_printk(DRM_UT_KMS, prefix, \
|
||||
__func__, fmt, ##args); \
|
||||
} while (0)
|
||||
#define DRM_DEBUG_MODE(prefix, fmt, args...) \
|
||||
do { \
|
||||
drm_ut_debug_printk(DRM_UT_MODE, prefix, \
|
||||
__func__, fmt, ##args); \
|
||||
} while (0)
|
||||
#define DRM_LOG(fmt, args...) \
|
||||
do { \
|
||||
drm_ut_debug_printk(DRM_UT_CORE, NULL, \
|
||||
NULL, fmt, ##args); \
|
||||
} while (0)
|
||||
#define DRM_LOG_KMS(fmt, args...) \
|
||||
do { \
|
||||
drm_ut_debug_printk(DRM_UT_KMS, NULL, \
|
||||
NULL, fmt, ##args); \
|
||||
} while (0)
|
||||
#define DRM_LOG_MODE(fmt, args...) \
|
||||
do { \
|
||||
drm_ut_debug_printk(DRM_UT_MODE, NULL, \
|
||||
NULL, fmt, ##args); \
|
||||
} while (0)
|
||||
#define DRM_LOG_DRIVER(fmt, args...) \
|
||||
do { \
|
||||
drm_ut_debug_printk(DRM_UT_DRIVER, NULL, \
|
||||
NULL, fmt, ##args); \
|
||||
} while (0)
|
||||
#else
|
||||
#define DRM_DEBUG_DRIVER(prefix, fmt, args...) do { } while (0)
|
||||
#define DRM_DEBUG_KMS(prefix, fmt, args...) do { } while (0)
|
||||
#define DRM_DEBUG_MODE(prefix, fmt, args...) do { } while (0)
|
||||
#define DRM_DEBUG(fmt, arg...) do { } while (0)
|
||||
#define DRM_LOG(fmt, arg...) do { } while (0)
|
||||
#define DRM_LOG_KMS(fmt, args...) do { } while (0)
|
||||
#define DRM_LOG_MODE(fmt, arg...) do { } while (0)
|
||||
#define DRM_LOG_DRIVER(fmt, arg...) do { } while (0)
|
||||
|
||||
#endif
|
||||
|
||||
#define DRM_PROC_LIMIT (PAGE_SIZE-80)
|
||||
@@ -237,15 +289,15 @@ struct drm_device;
|
||||
* \param dev DRM device.
|
||||
* \param filp file pointer of the caller.
|
||||
*/
|
||||
#define LOCK_TEST_WITH_RETURN( dev, file_priv ) \
|
||||
do { \
|
||||
if (!_DRM_LOCK_IS_HELD(file_priv->master->lock.hw_lock->lock) || \
|
||||
file_priv->master->lock.file_priv != file_priv) { \
|
||||
#define LOCK_TEST_WITH_RETURN( dev, _file_priv ) \
|
||||
do { \
|
||||
if (!_DRM_LOCK_IS_HELD(_file_priv->master->lock.hw_lock->lock) || \
|
||||
_file_priv->master->lock.file_priv != _file_priv) { \
|
||||
DRM_ERROR( "%s called without lock held, held %d owner %p %p\n",\
|
||||
__func__, _DRM_LOCK_IS_HELD(file_priv->master->lock.hw_lock->lock),\
|
||||
file_priv->master->lock.file_priv, file_priv); \
|
||||
return -EINVAL; \
|
||||
} \
|
||||
__func__, _DRM_LOCK_IS_HELD(_file_priv->master->lock.hw_lock->lock),\
|
||||
_file_priv->master->lock.file_priv, _file_priv); \
|
||||
return -EINVAL; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
@@ -502,26 +554,6 @@ struct drm_sigdata {
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Generic memory manager structs
|
||||
*/
|
||||
|
||||
struct drm_mm_node {
|
||||
struct list_head fl_entry;
|
||||
struct list_head ml_entry;
|
||||
int free;
|
||||
unsigned long start;
|
||||
unsigned long size;
|
||||
struct drm_mm *mm;
|
||||
void *private;
|
||||
};
|
||||
|
||||
struct drm_mm {
|
||||
struct list_head fl_entry;
|
||||
struct list_head ml_entry;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Kernel side of a mapping
|
||||
*/
|
||||
@@ -1385,22 +1417,6 @@ extern char *drm_get_connector_status_name(enum drm_connector_status status);
|
||||
extern int drm_sysfs_connector_add(struct drm_connector *connector);
|
||||
extern void drm_sysfs_connector_remove(struct drm_connector *connector);
|
||||
|
||||
/*
|
||||
* Basic memory manager support (drm_mm.c)
|
||||
*/
|
||||
extern struct drm_mm_node *drm_mm_get_block(struct drm_mm_node * parent,
|
||||
unsigned long size,
|
||||
unsigned alignment);
|
||||
extern void drm_mm_put_block(struct drm_mm_node * cur);
|
||||
extern struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm, unsigned long size,
|
||||
unsigned alignment, int best_match);
|
||||
extern int drm_mm_init(struct drm_mm *mm, unsigned long start, unsigned long size);
|
||||
extern void drm_mm_takedown(struct drm_mm *mm);
|
||||
extern int drm_mm_clean(struct drm_mm *mm);
|
||||
extern unsigned long drm_mm_tail_space(struct drm_mm *mm);
|
||||
extern int drm_mm_remove_space_from_tail(struct drm_mm *mm, unsigned long size);
|
||||
extern int drm_mm_add_space_to_tail(struct drm_mm *mm, unsigned long size);
|
||||
|
||||
/* Graphics Execution Manager library functions (drm_gem.c) */
|
||||
int drm_gem_init(struct drm_device *dev);
|
||||
void drm_gem_destroy(struct drm_device *dev);
|
||||
@@ -1519,6 +1535,26 @@ static __inline__ void *drm_calloc(size_t nmemb, size_t size, int area)
|
||||
{
|
||||
return kcalloc(nmemb, size, GFP_KERNEL);
|
||||
}
|
||||
|
||||
static __inline__ void *drm_calloc_large(size_t nmemb, size_t size)
|
||||
{
|
||||
if (size * nmemb <= PAGE_SIZE)
|
||||
return kcalloc(nmemb, size, GFP_KERNEL);
|
||||
|
||||
if (size != 0 && nmemb > ULONG_MAX / size)
|
||||
return NULL;
|
||||
|
||||
return __vmalloc(size * nmemb,
|
||||
GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL);
|
||||
}
|
||||
|
||||
static __inline void drm_free_large(void *ptr)
|
||||
{
|
||||
if (!is_vmalloc_addr(ptr))
|
||||
return kfree(ptr);
|
||||
|
||||
vfree(ptr);
|
||||
}
|
||||
#else
|
||||
extern void *drm_alloc(size_t size, int area);
|
||||
extern void drm_free(void *pt, size_t size, int area);
|
||||
|
||||
@@ -471,6 +471,9 @@ struct drm_connector {
|
||||
u32 property_ids[DRM_CONNECTOR_MAX_PROPERTY];
|
||||
uint64_t property_values[DRM_CONNECTOR_MAX_PROPERTY];
|
||||
|
||||
/* requested DPMS state */
|
||||
int dpms;
|
||||
|
||||
void *helper_private;
|
||||
|
||||
uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER];
|
||||
|
||||
@@ -99,6 +99,8 @@ extern bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
|
||||
struct drm_framebuffer *old_fb);
|
||||
extern bool drm_helper_crtc_in_use(struct drm_crtc *crtc);
|
||||
|
||||
extern void drm_helper_connector_dpms(struct drm_connector *connector, int mode);
|
||||
|
||||
extern int drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb,
|
||||
struct drm_mode_fb_cmd *mode_cmd);
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
#ifndef DRM_HASHTAB_H
|
||||
#define DRM_HASHTAB_H
|
||||
|
||||
#include <linux/list.h>
|
||||
|
||||
#define drm_hash_entry(_ptr, _type, _member) container_of(_ptr, _type, _member)
|
||||
|
||||
struct drm_hash_item {
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2006-2008 Tungsten Graphics, Inc., Cedar Park, TX. USA.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*
|
||||
**************************************************************************/
|
||||
/*
|
||||
* Authors:
|
||||
* Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
|
||||
*/
|
||||
|
||||
#ifndef _DRM_MM_H_
|
||||
#define _DRM_MM_H_
|
||||
|
||||
/*
|
||||
* Generic range manager structs
|
||||
*/
|
||||
#include <linux/list.h>
|
||||
|
||||
struct drm_mm_node {
|
||||
struct list_head fl_entry;
|
||||
struct list_head ml_entry;
|
||||
int free;
|
||||
unsigned long start;
|
||||
unsigned long size;
|
||||
struct drm_mm *mm;
|
||||
void *private;
|
||||
};
|
||||
|
||||
struct drm_mm {
|
||||
struct list_head fl_entry;
|
||||
struct list_head ml_entry;
|
||||
struct list_head unused_nodes;
|
||||
int num_unused;
|
||||
spinlock_t unused_lock;
|
||||
};
|
||||
|
||||
/*
|
||||
* Basic range manager support (drm_mm.c)
|
||||
*/
|
||||
|
||||
extern struct drm_mm_node *drm_mm_get_block(struct drm_mm_node *parent,
|
||||
unsigned long size,
|
||||
unsigned alignment);
|
||||
extern struct drm_mm_node *drm_mm_get_block_atomic(struct drm_mm_node *parent,
|
||||
unsigned long size,
|
||||
unsigned alignment);
|
||||
extern void drm_mm_put_block(struct drm_mm_node *cur);
|
||||
extern struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm,
|
||||
unsigned long size,
|
||||
unsigned alignment,
|
||||
int best_match);
|
||||
extern int drm_mm_init(struct drm_mm *mm, unsigned long start,
|
||||
unsigned long size);
|
||||
extern void drm_mm_takedown(struct drm_mm *mm);
|
||||
extern int drm_mm_clean(struct drm_mm *mm);
|
||||
extern unsigned long drm_mm_tail_space(struct drm_mm *mm);
|
||||
extern int drm_mm_remove_space_from_tail(struct drm_mm *mm,
|
||||
unsigned long size);
|
||||
extern int drm_mm_add_space_to_tail(struct drm_mm *mm,
|
||||
unsigned long size, int atomic);
|
||||
extern int drm_mm_pre_get(struct drm_mm *mm);
|
||||
|
||||
static inline struct drm_mm *drm_get_mm(struct drm_mm_node *block)
|
||||
{
|
||||
return block->mm;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -254,6 +254,11 @@
|
||||
{0x1002, 0x940A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R600|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x940B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R600|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x940F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R600|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x94A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x94A1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x94B1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x94B3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x94B5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x9440, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x9441, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x9442, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
|
||||
@@ -268,6 +273,8 @@
|
||||
{0x1002, 0x9456, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x945A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x945B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x9460, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x9462, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x946A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x946B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x947A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
|
||||
@@ -536,4 +543,6 @@
|
||||
{0x8086, 0xa001, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
|
||||
{0x8086, 0xa011, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
|
||||
{0x8086, 0x35e8, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
|
||||
{0x8086, 0x0042, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
|
||||
{0x8086, 0x0046, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
|
||||
{0, 0, 0}
|
||||
|
||||
@@ -135,6 +135,7 @@ header-y += posix_types.h
|
||||
header-y += ppdev.h
|
||||
header-y += prctl.h
|
||||
header-y += qnxtypes.h
|
||||
header-y += qnx4_fs.h
|
||||
header-y += radeonfb.h
|
||||
header-y += raw.h
|
||||
header-y += resource.h
|
||||
@@ -308,7 +309,6 @@ unifdef-y += poll.h
|
||||
unifdef-y += ppp_defs.h
|
||||
unifdef-y += ppp-comp.h
|
||||
unifdef-y += ptrace.h
|
||||
unifdef-y += qnx4_fs.h
|
||||
unifdef-y += quota.h
|
||||
unifdef-y += random.h
|
||||
unifdef-y += rfkill.h
|
||||
|
||||
@@ -119,7 +119,7 @@ extern int pci_mmcfg_config_num;
|
||||
extern int sbf_port;
|
||||
extern unsigned long acpi_realmode_flags;
|
||||
|
||||
int acpi_register_gsi (u32 gsi, int triggering, int polarity);
|
||||
int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity);
|
||||
int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
|
||||
|
||||
#ifdef CONFIG_X86_IO_APIC
|
||||
|
||||
@@ -28,7 +28,7 @@ struct amba_id {
|
||||
|
||||
struct amba_driver {
|
||||
struct device_driver drv;
|
||||
int (*probe)(struct amba_device *, void *);
|
||||
int (*probe)(struct amba_device *, struct amba_id *);
|
||||
int (*remove)(struct amba_device *);
|
||||
void (*shutdown)(struct amba_device *);
|
||||
int (*suspend)(struct amba_device *, pm_message_t);
|
||||
|
||||
@@ -0,0 +1,264 @@
|
||||
/*
|
||||
* include/linux/amba/pl022.h
|
||||
*
|
||||
* Copyright (C) 2008-2009 ST-Ericsson AB
|
||||
* Copyright (C) 2006 STMicroelectronics Pvt. Ltd.
|
||||
*
|
||||
* Author: Linus Walleij <linus.walleij@stericsson.com>
|
||||
*
|
||||
* Initial version inspired by:
|
||||
* linux-2.6.17-rc3-mm1/drivers/spi/pxa2xx_spi.c
|
||||
* Initial adoption to PL022 by:
|
||||
* Sachin Verma <sachin.verma@st.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef _SSP_PL022_H
|
||||
#define _SSP_PL022_H
|
||||
|
||||
#include <linux/device.h>
|
||||
|
||||
/**
|
||||
* whether SSP is in loopback mode or not
|
||||
*/
|
||||
enum ssp_loopback {
|
||||
LOOPBACK_DISABLED,
|
||||
LOOPBACK_ENABLED
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ssp_interface - interfaces allowed for this SSP Controller
|
||||
* @SSP_INTERFACE_MOTOROLA_SPI: Motorola Interface
|
||||
* @SSP_INTERFACE_TI_SYNC_SERIAL: Texas Instrument Synchronous Serial
|
||||
* interface
|
||||
* @SSP_INTERFACE_NATIONAL_MICROWIRE: National Semiconductor Microwire
|
||||
* interface
|
||||
* @SSP_INTERFACE_UNIDIRECTIONAL: Unidirectional interface (STn8810
|
||||
* &STn8815 only)
|
||||
*/
|
||||
enum ssp_interface {
|
||||
SSP_INTERFACE_MOTOROLA_SPI,
|
||||
SSP_INTERFACE_TI_SYNC_SERIAL,
|
||||
SSP_INTERFACE_NATIONAL_MICROWIRE,
|
||||
SSP_INTERFACE_UNIDIRECTIONAL
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ssp_hierarchy - whether SSP is configured as Master or Slave
|
||||
*/
|
||||
enum ssp_hierarchy {
|
||||
SSP_MASTER,
|
||||
SSP_SLAVE
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ssp_clock_params - clock parameters, to set SSP clock at a
|
||||
* desired freq
|
||||
*/
|
||||
struct ssp_clock_params {
|
||||
u8 cpsdvsr; /* value from 2 to 254 (even only!) */
|
||||
u8 scr; /* value from 0 to 255 */
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ssp_rx_endian - endianess of Rx FIFO Data
|
||||
*/
|
||||
enum ssp_rx_endian {
|
||||
SSP_RX_MSB,
|
||||
SSP_RX_LSB
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ssp_tx_endian - endianess of Tx FIFO Data
|
||||
*/
|
||||
enum ssp_tx_endian {
|
||||
SSP_TX_MSB,
|
||||
SSP_TX_LSB
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ssp_data_size - number of bits in one data element
|
||||
*/
|
||||
enum ssp_data_size {
|
||||
SSP_DATA_BITS_4 = 0x03, SSP_DATA_BITS_5, SSP_DATA_BITS_6,
|
||||
SSP_DATA_BITS_7, SSP_DATA_BITS_8, SSP_DATA_BITS_9,
|
||||
SSP_DATA_BITS_10, SSP_DATA_BITS_11, SSP_DATA_BITS_12,
|
||||
SSP_DATA_BITS_13, SSP_DATA_BITS_14, SSP_DATA_BITS_15,
|
||||
SSP_DATA_BITS_16, SSP_DATA_BITS_17, SSP_DATA_BITS_18,
|
||||
SSP_DATA_BITS_19, SSP_DATA_BITS_20, SSP_DATA_BITS_21,
|
||||
SSP_DATA_BITS_22, SSP_DATA_BITS_23, SSP_DATA_BITS_24,
|
||||
SSP_DATA_BITS_25, SSP_DATA_BITS_26, SSP_DATA_BITS_27,
|
||||
SSP_DATA_BITS_28, SSP_DATA_BITS_29, SSP_DATA_BITS_30,
|
||||
SSP_DATA_BITS_31, SSP_DATA_BITS_32
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ssp_mode - SSP mode of operation (Communication modes)
|
||||
*/
|
||||
enum ssp_mode {
|
||||
INTERRUPT_TRANSFER,
|
||||
POLLING_TRANSFER,
|
||||
DMA_TRANSFER
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ssp_rx_level_trig - receive FIFO watermark level which triggers
|
||||
* IT: Interrupt fires when _N_ or more elements in RX FIFO.
|
||||
*/
|
||||
enum ssp_rx_level_trig {
|
||||
SSP_RX_1_OR_MORE_ELEM,
|
||||
SSP_RX_4_OR_MORE_ELEM,
|
||||
SSP_RX_8_OR_MORE_ELEM,
|
||||
SSP_RX_16_OR_MORE_ELEM,
|
||||
SSP_RX_32_OR_MORE_ELEM
|
||||
};
|
||||
|
||||
/**
|
||||
* Transmit FIFO watermark level which triggers (IT Interrupt fires
|
||||
* when _N_ or more empty locations in TX FIFO)
|
||||
*/
|
||||
enum ssp_tx_level_trig {
|
||||
SSP_TX_1_OR_MORE_EMPTY_LOC,
|
||||
SSP_TX_4_OR_MORE_EMPTY_LOC,
|
||||
SSP_TX_8_OR_MORE_EMPTY_LOC,
|
||||
SSP_TX_16_OR_MORE_EMPTY_LOC,
|
||||
SSP_TX_32_OR_MORE_EMPTY_LOC
|
||||
};
|
||||
|
||||
/**
|
||||
* enum SPI Clock Phase - clock phase (Motorola SPI interface only)
|
||||
* @SSP_CLK_RISING_EDGE: Receive data on rising edge
|
||||
* @SSP_CLK_FALLING_EDGE: Receive data on falling edge
|
||||
*/
|
||||
enum ssp_spi_clk_phase {
|
||||
SSP_CLK_RISING_EDGE,
|
||||
SSP_CLK_FALLING_EDGE
|
||||
};
|
||||
|
||||
/**
|
||||
* enum SPI Clock Polarity - clock polarity (Motorola SPI interface only)
|
||||
* @SSP_CLK_POL_IDLE_LOW: Low inactive level
|
||||
* @SSP_CLK_POL_IDLE_HIGH: High inactive level
|
||||
*/
|
||||
enum ssp_spi_clk_pol {
|
||||
SSP_CLK_POL_IDLE_LOW,
|
||||
SSP_CLK_POL_IDLE_HIGH
|
||||
};
|
||||
|
||||
/**
|
||||
* Microwire Conrol Lengths Command size in microwire format
|
||||
*/
|
||||
enum ssp_microwire_ctrl_len {
|
||||
SSP_BITS_4 = 0x03, SSP_BITS_5, SSP_BITS_6,
|
||||
SSP_BITS_7, SSP_BITS_8, SSP_BITS_9,
|
||||
SSP_BITS_10, SSP_BITS_11, SSP_BITS_12,
|
||||
SSP_BITS_13, SSP_BITS_14, SSP_BITS_15,
|
||||
SSP_BITS_16, SSP_BITS_17, SSP_BITS_18,
|
||||
SSP_BITS_19, SSP_BITS_20, SSP_BITS_21,
|
||||
SSP_BITS_22, SSP_BITS_23, SSP_BITS_24,
|
||||
SSP_BITS_25, SSP_BITS_26, SSP_BITS_27,
|
||||
SSP_BITS_28, SSP_BITS_29, SSP_BITS_30,
|
||||
SSP_BITS_31, SSP_BITS_32
|
||||
};
|
||||
|
||||
/**
|
||||
* enum Microwire Wait State
|
||||
* @SSP_MWIRE_WAIT_ZERO: No wait state inserted after last command bit
|
||||
* @SSP_MWIRE_WAIT_ONE: One wait state inserted after last command bit
|
||||
*/
|
||||
enum ssp_microwire_wait_state {
|
||||
SSP_MWIRE_WAIT_ZERO,
|
||||
SSP_MWIRE_WAIT_ONE
|
||||
};
|
||||
|
||||
/**
|
||||
* enum Microwire - whether Full/Half Duplex
|
||||
* @SSP_MICROWIRE_CHANNEL_FULL_DUPLEX: SSPTXD becomes bi-directional,
|
||||
* SSPRXD not used
|
||||
* @SSP_MICROWIRE_CHANNEL_HALF_DUPLEX: SSPTXD is an output, SSPRXD is
|
||||
* an input.
|
||||
*/
|
||||
enum ssp_duplex {
|
||||
SSP_MICROWIRE_CHANNEL_FULL_DUPLEX,
|
||||
SSP_MICROWIRE_CHANNEL_HALF_DUPLEX
|
||||
};
|
||||
|
||||
/**
|
||||
* CHIP select/deselect commands
|
||||
*/
|
||||
enum ssp_chip_select {
|
||||
SSP_CHIP_SELECT,
|
||||
SSP_CHIP_DESELECT
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* struct pl022_ssp_master - device.platform_data for SPI controller devices.
|
||||
* @num_chipselect: chipselects are used to distinguish individual
|
||||
* SPI slaves, and are numbered from zero to num_chipselects - 1.
|
||||
* each slave has a chipselect signal, but it's common that not
|
||||
* every chipselect is connected to a slave.
|
||||
* @enable_dma: if true enables DMA driven transfers.
|
||||
*/
|
||||
struct pl022_ssp_controller {
|
||||
u16 bus_id;
|
||||
u8 num_chipselect;
|
||||
u8 enable_dma:1;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ssp_config_chip - spi_board_info.controller_data for SPI
|
||||
* slave devices, copied to spi_device.controller_data.
|
||||
*
|
||||
* @lbm: used for test purpose to internally connect RX and TX
|
||||
* @iface: Interface type(Motorola, TI, Microwire, Universal)
|
||||
* @hierarchy: sets whether interface is master or slave
|
||||
* @slave_tx_disable: SSPTXD is disconnected (in slave mode only)
|
||||
* @clk_freq: Tune freq parameters of SSP(when in master mode)
|
||||
* @endian_rx: Endianess of Data in Rx FIFO
|
||||
* @endian_tx: Endianess of Data in Tx FIFO
|
||||
* @data_size: Width of data element(4 to 32 bits)
|
||||
* @com_mode: communication mode: polling, Interrupt or DMA
|
||||
* @rx_lev_trig: Rx FIFO watermark level (for IT & DMA mode)
|
||||
* @tx_lev_trig: Tx FIFO watermark level (for IT & DMA mode)
|
||||
* @clk_phase: Motorola SPI interface Clock phase
|
||||
* @clk_pol: Motorola SPI interface Clock polarity
|
||||
* @ctrl_len: Microwire interface: Control length
|
||||
* @wait_state: Microwire interface: Wait state
|
||||
* @duplex: Microwire interface: Full/Half duplex
|
||||
* @cs_control: function pointer to board-specific function to
|
||||
* assert/deassert I/O port to control HW generation of devices chip-select.
|
||||
* @dma_xfer_type: Type of DMA xfer (Mem-to-periph or Periph-to-Periph)
|
||||
* @dma_config: DMA configuration for SSP controller and peripheral
|
||||
*/
|
||||
struct pl022_config_chip {
|
||||
struct device *dev;
|
||||
enum ssp_loopback lbm;
|
||||
enum ssp_interface iface;
|
||||
enum ssp_hierarchy hierarchy;
|
||||
bool slave_tx_disable;
|
||||
struct ssp_clock_params clk_freq;
|
||||
enum ssp_rx_endian endian_rx;
|
||||
enum ssp_tx_endian endian_tx;
|
||||
enum ssp_data_size data_size;
|
||||
enum ssp_mode com_mode;
|
||||
enum ssp_rx_level_trig rx_lev_trig;
|
||||
enum ssp_tx_level_trig tx_lev_trig;
|
||||
enum ssp_spi_clk_phase clk_phase;
|
||||
enum ssp_spi_clk_pol clk_pol;
|
||||
enum ssp_microwire_ctrl_len ctrl_len;
|
||||
enum ssp_microwire_wait_state wait_state;
|
||||
enum ssp_duplex duplex;
|
||||
void (*cs_control) (u32 control);
|
||||
};
|
||||
|
||||
#endif /* _SSP_PL022_H */
|
||||
@@ -114,6 +114,9 @@
|
||||
#define UART011_IFLS_TX4_8 (2 << 0)
|
||||
#define UART011_IFLS_TX6_8 (3 << 0)
|
||||
#define UART011_IFLS_TX7_8 (4 << 0)
|
||||
/* special values for ST vendor with deeper fifo */
|
||||
#define UART011_IFLS_RX_HALF (5 << 3)
|
||||
#define UART011_IFLS_TX_HALF (5 << 0)
|
||||
|
||||
#define UART011_OEIM (1 << 10) /* overrun error interrupt mask */
|
||||
#define UART011_BEIM (1 << 9) /* break error interrupt mask */
|
||||
@@ -159,6 +162,7 @@
|
||||
#define UART01x_FR_MODEM_ANY (UART01x_FR_DCD|UART01x_FR_DSR|UART01x_FR_CTS)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
struct amba_device; /* in uncompress this is included but amba/bus.h is not */
|
||||
struct amba_pl010_data {
|
||||
void (*set_mctrl)(struct amba_device *dev, void __iomem *base, unsigned int mctrl);
|
||||
};
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
* @bus_width: Number of data lines wired up the slot
|
||||
* @detect_pin: GPIO pin wired to the card detect switch
|
||||
* @wp_pin: GPIO pin wired to the write protect sensor
|
||||
* @detect_is_active_high: The state of the detect pin when it is active
|
||||
*
|
||||
* If a given slot is not present on the board, @bus_width should be
|
||||
* set to 0. The other fields are ignored in this case.
|
||||
@@ -24,6 +25,7 @@ struct mci_slot_pdata {
|
||||
unsigned int bus_width;
|
||||
int detect_pin;
|
||||
int wp_pin;
|
||||
bool detect_is_active_high;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,13 +14,12 @@
|
||||
#ifndef _LINUX_AUTO_FS_H
|
||||
#define _LINUX_AUTO_FS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/fs.h>
|
||||
#include <linux/limits.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/ioctl.h>
|
||||
#else
|
||||
#include <asm/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
|
||||
+5
-5
@@ -218,12 +218,12 @@ struct bio {
|
||||
#define bio_sectors(bio) ((bio)->bi_size >> 9)
|
||||
#define bio_empty_barrier(bio) (bio_barrier(bio) && !bio_has_data(bio) && !bio_discard(bio))
|
||||
|
||||
static inline unsigned int bio_cur_sectors(struct bio *bio)
|
||||
static inline unsigned int bio_cur_bytes(struct bio *bio)
|
||||
{
|
||||
if (bio->bi_vcnt)
|
||||
return bio_iovec(bio)->bv_len >> 9;
|
||||
return bio_iovec(bio)->bv_len;
|
||||
else /* dataless requests such as discard */
|
||||
return bio->bi_size >> 9;
|
||||
return bio->bi_size;
|
||||
}
|
||||
|
||||
static inline void *bio_data(struct bio *bio)
|
||||
@@ -279,7 +279,7 @@ static inline int bio_has_allocated_vec(struct bio *bio)
|
||||
#define __BIO_SEG_BOUNDARY(addr1, addr2, mask) \
|
||||
(((addr1) | (mask)) == (((addr2) - 1) | (mask)))
|
||||
#define BIOVEC_SEG_BOUNDARY(q, b1, b2) \
|
||||
__BIO_SEG_BOUNDARY(bvec_to_phys((b1)), bvec_to_phys((b2)) + (b2)->bv_len, (q)->seg_boundary_mask)
|
||||
__BIO_SEG_BOUNDARY(bvec_to_phys((b1)), bvec_to_phys((b2)) + (b2)->bv_len, queue_segment_boundary((q)))
|
||||
#define BIO_SEG_BOUNDARY(q, b1, b2) \
|
||||
BIOVEC_SEG_BOUNDARY((q), __BVEC_END((b1)), __BVEC_START((b2)))
|
||||
|
||||
@@ -506,7 +506,7 @@ static inline int bio_has_data(struct bio *bio)
|
||||
}
|
||||
|
||||
/*
|
||||
* BIO list managment for use by remapping drivers (e.g. DM or MD).
|
||||
* BIO list management for use by remapping drivers (e.g. DM or MD) and loop.
|
||||
*
|
||||
* A bio_list anchors a singly-linked list of bios chained through the bi_next
|
||||
* member of the bio. The bio_list also caches the last list member to allow
|
||||
|
||||
+183
-64
@@ -166,19 +166,9 @@ struct request {
|
||||
enum rq_cmd_type_bits cmd_type;
|
||||
unsigned long atomic_flags;
|
||||
|
||||
/* Maintain bio traversal state for part by part I/O submission.
|
||||
* hard_* are block layer internals, no driver should touch them!
|
||||
*/
|
||||
|
||||
sector_t sector; /* next sector to submit */
|
||||
sector_t hard_sector; /* next sector to complete */
|
||||
unsigned long nr_sectors; /* no. of sectors left to submit */
|
||||
unsigned long hard_nr_sectors; /* no. of sectors left to complete */
|
||||
/* no. of sectors left to submit in the current segment */
|
||||
unsigned int current_nr_sectors;
|
||||
|
||||
/* no. of sectors left to complete in the current segment */
|
||||
unsigned int hard_cur_sectors;
|
||||
/* the following two fields are internal, NEVER access directly */
|
||||
sector_t __sector; /* sector cursor */
|
||||
unsigned int __data_len; /* total data len */
|
||||
|
||||
struct bio *bio;
|
||||
struct bio *biotail;
|
||||
@@ -211,8 +201,8 @@ struct request {
|
||||
|
||||
unsigned short ioprio;
|
||||
|
||||
void *special;
|
||||
char *buffer;
|
||||
void *special; /* opaque pointer available for LLD use */
|
||||
char *buffer; /* kaddr of the current segment if available */
|
||||
|
||||
int tag;
|
||||
int errors;
|
||||
@@ -226,10 +216,9 @@ struct request {
|
||||
unsigned char __cmd[BLK_MAX_CDB];
|
||||
unsigned char *cmd;
|
||||
|
||||
unsigned int data_len;
|
||||
unsigned int extra_len; /* length of alignment and padding */
|
||||
unsigned int sense_len;
|
||||
void *data;
|
||||
unsigned int resid_len; /* residual count */
|
||||
void *sense;
|
||||
|
||||
unsigned long deadline;
|
||||
@@ -318,6 +307,26 @@ struct blk_cmd_filter {
|
||||
struct kobject kobj;
|
||||
};
|
||||
|
||||
struct queue_limits {
|
||||
unsigned long bounce_pfn;
|
||||
unsigned long seg_boundary_mask;
|
||||
|
||||
unsigned int max_hw_sectors;
|
||||
unsigned int max_sectors;
|
||||
unsigned int max_segment_size;
|
||||
unsigned int physical_block_size;
|
||||
unsigned int alignment_offset;
|
||||
unsigned int io_min;
|
||||
unsigned int io_opt;
|
||||
|
||||
unsigned short logical_block_size;
|
||||
unsigned short max_hw_segments;
|
||||
unsigned short max_phys_segments;
|
||||
|
||||
unsigned char misaligned;
|
||||
unsigned char no_cluster;
|
||||
};
|
||||
|
||||
struct request_queue
|
||||
{
|
||||
/*
|
||||
@@ -369,7 +378,6 @@ struct request_queue
|
||||
/*
|
||||
* queue needs bounce pages for pages above this limit
|
||||
*/
|
||||
unsigned long bounce_pfn;
|
||||
gfp_t bounce_gfp;
|
||||
|
||||
/*
|
||||
@@ -398,14 +406,6 @@ struct request_queue
|
||||
unsigned int nr_congestion_off;
|
||||
unsigned int nr_batching;
|
||||
|
||||
unsigned int max_sectors;
|
||||
unsigned int max_hw_sectors;
|
||||
unsigned short max_phys_segments;
|
||||
unsigned short max_hw_segments;
|
||||
unsigned short hardsect_size;
|
||||
unsigned int max_segment_size;
|
||||
|
||||
unsigned long seg_boundary_mask;
|
||||
void *dma_drain_buffer;
|
||||
unsigned int dma_drain_size;
|
||||
unsigned int dma_pad_mask;
|
||||
@@ -415,12 +415,14 @@ struct request_queue
|
||||
struct list_head tag_busy_list;
|
||||
|
||||
unsigned int nr_sorted;
|
||||
unsigned int in_flight;
|
||||
unsigned int in_flight[2];
|
||||
|
||||
unsigned int rq_timeout;
|
||||
struct timer_list timeout;
|
||||
struct list_head timeout_list;
|
||||
|
||||
struct queue_limits limits;
|
||||
|
||||
/*
|
||||
* sg stuff
|
||||
*/
|
||||
@@ -522,6 +524,11 @@ static inline void queue_flag_clear_unlocked(unsigned int flag,
|
||||
__clear_bit(flag, &q->queue_flags);
|
||||
}
|
||||
|
||||
static inline int queue_in_flight(struct request_queue *q)
|
||||
{
|
||||
return q->in_flight[0] + q->in_flight[1];
|
||||
}
|
||||
|
||||
static inline void queue_flag_clear(unsigned int flag, struct request_queue *q)
|
||||
{
|
||||
WARN_ON_ONCE(!queue_is_locked(q));
|
||||
@@ -752,10 +759,17 @@ extern void blk_rq_init(struct request_queue *q, struct request *rq);
|
||||
extern void blk_put_request(struct request *);
|
||||
extern void __blk_put_request(struct request_queue *, struct request *);
|
||||
extern struct request *blk_get_request(struct request_queue *, int, gfp_t);
|
||||
extern struct request *blk_make_request(struct request_queue *, struct bio *,
|
||||
gfp_t);
|
||||
extern void blk_insert_request(struct request_queue *, struct request *, int, void *);
|
||||
extern void blk_requeue_request(struct request_queue *, struct request *);
|
||||
extern int blk_rq_check_limits(struct request_queue *q, struct request *rq);
|
||||
extern int blk_lld_busy(struct request_queue *q);
|
||||
extern int blk_rq_prep_clone(struct request *rq, struct request *rq_src,
|
||||
struct bio_set *bs, gfp_t gfp_mask,
|
||||
int (*bio_ctr)(struct bio *, struct bio *, void *),
|
||||
void *data);
|
||||
extern void blk_rq_unprep_clone(struct request *rq);
|
||||
extern int blk_insert_cloned_request(struct request_queue *q,
|
||||
struct request *rq);
|
||||
extern void blk_plug_device(struct request_queue *);
|
||||
@@ -767,12 +781,6 @@ extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t,
|
||||
extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,
|
||||
struct scsi_ioctl_command __user *);
|
||||
|
||||
/*
|
||||
* Temporary export, until SCSI gets fixed up.
|
||||
*/
|
||||
extern int blk_rq_append_bio(struct request_queue *q, struct request *rq,
|
||||
struct bio *bio);
|
||||
|
||||
/*
|
||||
* A queue has just exitted congestion. Note this in the global counter of
|
||||
* congested queues, and wake up anyone who was waiting for requests to be
|
||||
@@ -798,7 +806,6 @@ extern void blk_sync_queue(struct request_queue *q);
|
||||
extern void __blk_stop_queue(struct request_queue *q);
|
||||
extern void __blk_run_queue(struct request_queue *);
|
||||
extern void blk_run_queue(struct request_queue *);
|
||||
extern void blk_start_queueing(struct request_queue *);
|
||||
extern int blk_rq_map_user(struct request_queue *, struct request *,
|
||||
struct rq_map_data *, void __user *, unsigned long,
|
||||
gfp_t);
|
||||
@@ -831,41 +838,73 @@ static inline void blk_run_address_space(struct address_space *mapping)
|
||||
blk_run_backing_dev(mapping->backing_dev_info, NULL);
|
||||
}
|
||||
|
||||
extern void blkdev_dequeue_request(struct request *req);
|
||||
/*
|
||||
* blk_rq_pos() : the current sector
|
||||
* blk_rq_bytes() : bytes left in the entire request
|
||||
* blk_rq_cur_bytes() : bytes left in the current segment
|
||||
* blk_rq_sectors() : sectors left in the entire request
|
||||
* blk_rq_cur_sectors() : sectors left in the current segment
|
||||
*/
|
||||
static inline sector_t blk_rq_pos(const struct request *rq)
|
||||
{
|
||||
return rq->__sector;
|
||||
}
|
||||
|
||||
static inline unsigned int blk_rq_bytes(const struct request *rq)
|
||||
{
|
||||
return rq->__data_len;
|
||||
}
|
||||
|
||||
static inline int blk_rq_cur_bytes(const struct request *rq)
|
||||
{
|
||||
return rq->bio ? bio_cur_bytes(rq->bio) : 0;
|
||||
}
|
||||
|
||||
static inline unsigned int blk_rq_sectors(const struct request *rq)
|
||||
{
|
||||
return blk_rq_bytes(rq) >> 9;
|
||||
}
|
||||
|
||||
static inline unsigned int blk_rq_cur_sectors(const struct request *rq)
|
||||
{
|
||||
return blk_rq_cur_bytes(rq) >> 9;
|
||||
}
|
||||
|
||||
/*
|
||||
* blk_end_request() and friends.
|
||||
* __blk_end_request() and end_request() must be called with
|
||||
* the request queue spinlock acquired.
|
||||
* Request issue related functions.
|
||||
*/
|
||||
extern struct request *blk_peek_request(struct request_queue *q);
|
||||
extern void blk_start_request(struct request *rq);
|
||||
extern struct request *blk_fetch_request(struct request_queue *q);
|
||||
|
||||
/*
|
||||
* Request completion related functions.
|
||||
*
|
||||
* blk_update_request() completes given number of bytes and updates
|
||||
* the request without completing it.
|
||||
*
|
||||
* blk_end_request() and friends. __blk_end_request() must be called
|
||||
* with the request queue spinlock acquired.
|
||||
*
|
||||
* Several drivers define their own end_request and call
|
||||
* blk_end_request() for parts of the original function.
|
||||
* This prevents code duplication in drivers.
|
||||
*/
|
||||
extern int blk_end_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes);
|
||||
extern int __blk_end_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes);
|
||||
extern int blk_end_bidi_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes, unsigned int bidi_bytes);
|
||||
extern void end_request(struct request *, int);
|
||||
extern int blk_end_request_callback(struct request *rq, int error,
|
||||
unsigned int nr_bytes,
|
||||
int (drv_callback)(struct request *));
|
||||
extern bool blk_update_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes);
|
||||
extern bool blk_end_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes);
|
||||
extern void blk_end_request_all(struct request *rq, int error);
|
||||
extern bool blk_end_request_cur(struct request *rq, int error);
|
||||
extern bool __blk_end_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes);
|
||||
extern void __blk_end_request_all(struct request *rq, int error);
|
||||
extern bool __blk_end_request_cur(struct request *rq, int error);
|
||||
|
||||
extern void blk_complete_request(struct request *);
|
||||
extern void __blk_complete_request(struct request *);
|
||||
extern void blk_abort_request(struct request *);
|
||||
extern void blk_abort_queue(struct request_queue *);
|
||||
extern void blk_update_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes);
|
||||
|
||||
/*
|
||||
* blk_end_request() takes bytes instead of sectors as a complete size.
|
||||
* blk_rq_bytes() returns bytes left to complete in the entire request.
|
||||
* blk_rq_cur_bytes() returns bytes left to complete in the current segment.
|
||||
*/
|
||||
extern unsigned int blk_rq_bytes(struct request *rq);
|
||||
extern unsigned int blk_rq_cur_bytes(struct request *rq);
|
||||
|
||||
/*
|
||||
* Access functions for manipulating queue properties
|
||||
@@ -877,10 +916,20 @@ extern void blk_cleanup_queue(struct request_queue *);
|
||||
extern void blk_queue_make_request(struct request_queue *, make_request_fn *);
|
||||
extern void blk_queue_bounce_limit(struct request_queue *, u64);
|
||||
extern void blk_queue_max_sectors(struct request_queue *, unsigned int);
|
||||
extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int);
|
||||
extern void blk_queue_max_phys_segments(struct request_queue *, unsigned short);
|
||||
extern void blk_queue_max_hw_segments(struct request_queue *, unsigned short);
|
||||
extern void blk_queue_max_segment_size(struct request_queue *, unsigned int);
|
||||
extern void blk_queue_hardsect_size(struct request_queue *, unsigned short);
|
||||
extern void blk_queue_logical_block_size(struct request_queue *, unsigned short);
|
||||
extern void blk_queue_physical_block_size(struct request_queue *, unsigned short);
|
||||
extern void blk_queue_alignment_offset(struct request_queue *q,
|
||||
unsigned int alignment);
|
||||
extern void blk_queue_io_min(struct request_queue *q, unsigned int min);
|
||||
extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt);
|
||||
extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
|
||||
sector_t offset);
|
||||
extern void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,
|
||||
sector_t offset);
|
||||
extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b);
|
||||
extern void blk_queue_dma_pad(struct request_queue *, unsigned int);
|
||||
extern void blk_queue_update_dma_pad(struct request_queue *, unsigned int);
|
||||
@@ -967,19 +1016,87 @@ extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter);
|
||||
|
||||
#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist)
|
||||
|
||||
static inline int queue_hardsect_size(struct request_queue *q)
|
||||
static inline unsigned long queue_bounce_pfn(struct request_queue *q)
|
||||
{
|
||||
return q->limits.bounce_pfn;
|
||||
}
|
||||
|
||||
static inline unsigned long queue_segment_boundary(struct request_queue *q)
|
||||
{
|
||||
return q->limits.seg_boundary_mask;
|
||||
}
|
||||
|
||||
static inline unsigned int queue_max_sectors(struct request_queue *q)
|
||||
{
|
||||
return q->limits.max_sectors;
|
||||
}
|
||||
|
||||
static inline unsigned int queue_max_hw_sectors(struct request_queue *q)
|
||||
{
|
||||
return q->limits.max_hw_sectors;
|
||||
}
|
||||
|
||||
static inline unsigned short queue_max_hw_segments(struct request_queue *q)
|
||||
{
|
||||
return q->limits.max_hw_segments;
|
||||
}
|
||||
|
||||
static inline unsigned short queue_max_phys_segments(struct request_queue *q)
|
||||
{
|
||||
return q->limits.max_phys_segments;
|
||||
}
|
||||
|
||||
static inline unsigned int queue_max_segment_size(struct request_queue *q)
|
||||
{
|
||||
return q->limits.max_segment_size;
|
||||
}
|
||||
|
||||
static inline unsigned short queue_logical_block_size(struct request_queue *q)
|
||||
{
|
||||
int retval = 512;
|
||||
|
||||
if (q && q->hardsect_size)
|
||||
retval = q->hardsect_size;
|
||||
if (q && q->limits.logical_block_size)
|
||||
retval = q->limits.logical_block_size;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static inline int bdev_hardsect_size(struct block_device *bdev)
|
||||
static inline unsigned short bdev_logical_block_size(struct block_device *bdev)
|
||||
{
|
||||
return queue_hardsect_size(bdev_get_queue(bdev));
|
||||
return queue_logical_block_size(bdev_get_queue(bdev));
|
||||
}
|
||||
|
||||
static inline unsigned int queue_physical_block_size(struct request_queue *q)
|
||||
{
|
||||
return q->limits.physical_block_size;
|
||||
}
|
||||
|
||||
static inline unsigned int queue_io_min(struct request_queue *q)
|
||||
{
|
||||
return q->limits.io_min;
|
||||
}
|
||||
|
||||
static inline unsigned int queue_io_opt(struct request_queue *q)
|
||||
{
|
||||
return q->limits.io_opt;
|
||||
}
|
||||
|
||||
static inline int queue_alignment_offset(struct request_queue *q)
|
||||
{
|
||||
if (q && q->limits.misaligned)
|
||||
return -1;
|
||||
|
||||
if (q && q->limits.alignment_offset)
|
||||
return q->limits.alignment_offset;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int queue_sector_alignment_offset(struct request_queue *q,
|
||||
sector_t sector)
|
||||
{
|
||||
return ((sector << 9) - q->limits.alignment_offset)
|
||||
& (q->limits.io_min - 1);
|
||||
}
|
||||
|
||||
static inline int queue_dma_alignment(struct request_queue *q)
|
||||
@@ -1109,6 +1226,8 @@ struct block_device_operations {
|
||||
int (*direct_access) (struct block_device *, sector_t,
|
||||
void **, unsigned long *);
|
||||
int (*media_changed) (struct gendisk *);
|
||||
unsigned long long (*set_capacity) (struct gendisk *,
|
||||
unsigned long long);
|
||||
int (*revalidate_disk) (struct gendisk *);
|
||||
int (*getgeo)(struct block_device *, struct hd_geometry *);
|
||||
struct module *owner;
|
||||
|
||||
@@ -116,9 +116,9 @@ struct blk_io_trace {
|
||||
* The remap event
|
||||
*/
|
||||
struct blk_io_trace_remap {
|
||||
__be32 device;
|
||||
__be32 device_from;
|
||||
__be64 sector;
|
||||
__be32 device_to;
|
||||
__be64 sector_from;
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -165,8 +165,9 @@ struct blk_trace {
|
||||
|
||||
extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *);
|
||||
extern void blk_trace_shutdown(struct request_queue *);
|
||||
extern int do_blk_trace_setup(struct request_queue *q,
|
||||
char *name, dev_t dev, struct blk_user_trace_setup *buts);
|
||||
extern int do_blk_trace_setup(struct request_queue *q, char *name,
|
||||
dev_t dev, struct block_device *bdev,
|
||||
struct blk_user_trace_setup *buts);
|
||||
extern void __trace_note_message(struct blk_trace *, const char *fmt, ...);
|
||||
|
||||
/**
|
||||
@@ -193,22 +194,42 @@ extern void __trace_note_message(struct blk_trace *, const char *fmt, ...);
|
||||
extern void blk_add_driver_data(struct request_queue *q, struct request *rq,
|
||||
void *data, size_t len);
|
||||
extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
|
||||
struct block_device *bdev,
|
||||
char __user *arg);
|
||||
extern int blk_trace_startstop(struct request_queue *q, int start);
|
||||
extern int blk_trace_remove(struct request_queue *q);
|
||||
extern int blk_trace_init_sysfs(struct device *dev);
|
||||
|
||||
extern struct attribute_group blk_trace_attr_group;
|
||||
|
||||
#else /* !CONFIG_BLK_DEV_IO_TRACE */
|
||||
#define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY)
|
||||
#define blk_trace_shutdown(q) do { } while (0)
|
||||
#define do_blk_trace_setup(q, name, dev, buts) (-ENOTTY)
|
||||
#define blk_add_driver_data(q, rq, data, len) do {} while (0)
|
||||
#define blk_trace_setup(q, name, dev, arg) (-ENOTTY)
|
||||
#define blk_trace_startstop(q, start) (-ENOTTY)
|
||||
#define blk_trace_remove(q) (-ENOTTY)
|
||||
#define blk_add_trace_msg(q, fmt, ...) do { } while (0)
|
||||
# define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY)
|
||||
# define blk_trace_shutdown(q) do { } while (0)
|
||||
# define do_blk_trace_setup(q, name, dev, bdev, buts) (-ENOTTY)
|
||||
# define blk_add_driver_data(q, rq, data, len) do {} while (0)
|
||||
# define blk_trace_setup(q, name, dev, bdev, arg) (-ENOTTY)
|
||||
# define blk_trace_startstop(q, start) (-ENOTTY)
|
||||
# define blk_trace_remove(q) (-ENOTTY)
|
||||
# define blk_add_trace_msg(q, fmt, ...) do { } while (0)
|
||||
static inline int blk_trace_init_sysfs(struct device *dev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BLK_DEV_IO_TRACE */
|
||||
|
||||
#if defined(CONFIG_EVENT_TRACING) && defined(CONFIG_BLOCK)
|
||||
|
||||
static inline int blk_cmd_buf_len(struct request *rq)
|
||||
{
|
||||
return blk_pc_request(rq) ? rq->cmd_len * 3 : 1;
|
||||
}
|
||||
|
||||
extern void blk_dump_cmd(char *buf, struct request *rq);
|
||||
extern void blk_fill_rwbs(char *rwbs, u32 rw, int bytes);
|
||||
extern void blk_fill_rwbs_rq(char *rwbs, struct request *rq);
|
||||
|
||||
#endif /* CONFIG_EVENT_TRACING && CONFIG_BLOCK */
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
/*
|
||||
* cb710/cb710.h
|
||||
*
|
||||
* Copyright by Michał Mirosław, 2008-2009
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef LINUX_CB710_DRIVER_H
|
||||
#define LINUX_CB710_DRIVER_H
|
||||
|
||||
#include <linux/io.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mmc/host.h>
|
||||
|
||||
struct cb710_slot;
|
||||
|
||||
typedef int (*cb710_irq_handler_t)(struct cb710_slot *);
|
||||
|
||||
/* per-virtual-slot structure */
|
||||
struct cb710_slot {
|
||||
struct platform_device pdev;
|
||||
void __iomem *iobase;
|
||||
cb710_irq_handler_t irq_handler;
|
||||
};
|
||||
|
||||
/* per-device structure */
|
||||
struct cb710_chip {
|
||||
struct pci_dev *pdev;
|
||||
void __iomem *iobase;
|
||||
unsigned platform_id;
|
||||
#ifdef CONFIG_CB710_DEBUG_ASSUMPTIONS
|
||||
atomic_t slot_refs_count;
|
||||
#endif
|
||||
unsigned slot_mask;
|
||||
unsigned slots;
|
||||
spinlock_t irq_lock;
|
||||
struct cb710_slot slot[0];
|
||||
};
|
||||
|
||||
/* NOTE: cb710_chip.slots is modified only during device init/exit and
|
||||
* they are all serialized wrt themselves */
|
||||
|
||||
/* cb710_chip.slot_mask values */
|
||||
#define CB710_SLOT_MMC 1
|
||||
#define CB710_SLOT_MS 2
|
||||
#define CB710_SLOT_SM 4
|
||||
|
||||
/* slot port accessors - so the logic is more clear in the code */
|
||||
#define CB710_PORT_ACCESSORS(t) \
|
||||
static inline void cb710_write_port_##t(struct cb710_slot *slot, \
|
||||
unsigned port, u##t value) \
|
||||
{ \
|
||||
iowrite##t(value, slot->iobase + port); \
|
||||
} \
|
||||
\
|
||||
static inline u##t cb710_read_port_##t(struct cb710_slot *slot, \
|
||||
unsigned port) \
|
||||
{ \
|
||||
return ioread##t(slot->iobase + port); \
|
||||
} \
|
||||
\
|
||||
static inline void cb710_modify_port_##t(struct cb710_slot *slot, \
|
||||
unsigned port, u##t set, u##t clear) \
|
||||
{ \
|
||||
iowrite##t( \
|
||||
(ioread##t(slot->iobase + port) & ~clear)|set, \
|
||||
slot->iobase + port); \
|
||||
}
|
||||
|
||||
CB710_PORT_ACCESSORS(8)
|
||||
CB710_PORT_ACCESSORS(16)
|
||||
CB710_PORT_ACCESSORS(32)
|
||||
|
||||
void cb710_pci_update_config_reg(struct pci_dev *pdev,
|
||||
int reg, uint32_t and, uint32_t xor);
|
||||
void cb710_set_irq_handler(struct cb710_slot *slot,
|
||||
cb710_irq_handler_t handler);
|
||||
|
||||
/* some device struct walking */
|
||||
|
||||
static inline struct cb710_slot *cb710_pdev_to_slot(
|
||||
struct platform_device *pdev)
|
||||
{
|
||||
return container_of(pdev, struct cb710_slot, pdev);
|
||||
}
|
||||
|
||||
static inline struct cb710_chip *cb710_slot_to_chip(struct cb710_slot *slot)
|
||||
{
|
||||
return dev_get_drvdata(slot->pdev.dev.parent);
|
||||
}
|
||||
|
||||
static inline struct device *cb710_slot_dev(struct cb710_slot *slot)
|
||||
{
|
||||
return &slot->pdev.dev;
|
||||
}
|
||||
|
||||
static inline struct device *cb710_chip_dev(struct cb710_chip *chip)
|
||||
{
|
||||
return &chip->pdev->dev;
|
||||
}
|
||||
|
||||
/* debugging aids */
|
||||
|
||||
#ifdef CONFIG_CB710_DEBUG
|
||||
void cb710_dump_regs(struct cb710_chip *chip, unsigned dump);
|
||||
#else
|
||||
#define cb710_dump_regs(c, d) do {} while (0)
|
||||
#endif
|
||||
|
||||
#define CB710_DUMP_REGS_MMC 0x0F
|
||||
#define CB710_DUMP_REGS_MS 0x30
|
||||
#define CB710_DUMP_REGS_SM 0xC0
|
||||
#define CB710_DUMP_REGS_ALL 0xFF
|
||||
#define CB710_DUMP_REGS_MASK 0xFF
|
||||
|
||||
#define CB710_DUMP_ACCESS_8 0x100
|
||||
#define CB710_DUMP_ACCESS_16 0x200
|
||||
#define CB710_DUMP_ACCESS_32 0x400
|
||||
#define CB710_DUMP_ACCESS_ALL 0x700
|
||||
#define CB710_DUMP_ACCESS_MASK 0x700
|
||||
|
||||
#endif /* LINUX_CB710_DRIVER_H */
|
||||
/*
|
||||
* cb710/sgbuf2.h
|
||||
*
|
||||
* Copyright by Michał Mirosław, 2008-2009
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef LINUX_CB710_SG_H
|
||||
#define LINUX_CB710_SG_H
|
||||
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/scatterlist.h>
|
||||
|
||||
/**
|
||||
* cb710_sg_miter_stop_writing - stop mapping iteration after writing
|
||||
* @miter: sg mapping iter to be stopped
|
||||
*
|
||||
* Description:
|
||||
* Stops mapping iterator @miter. @miter should have been started
|
||||
* started using sg_miter_start(). A stopped iteration can be
|
||||
* resumed by calling sg_miter_next() on it. This is useful when
|
||||
* resources (kmap) need to be released during iteration.
|
||||
*
|
||||
* This is a convenience wrapper that will be optimized out for arches
|
||||
* that don't need flush_kernel_dcache_page().
|
||||
*
|
||||
* Context:
|
||||
* IRQ disabled if the SG_MITER_ATOMIC is set. Don't care otherwise.
|
||||
*/
|
||||
static inline void cb710_sg_miter_stop_writing(struct sg_mapping_iter *miter)
|
||||
{
|
||||
if (miter->page)
|
||||
flush_kernel_dcache_page(miter->page);
|
||||
sg_miter_stop(miter);
|
||||
}
|
||||
|
||||
/*
|
||||
* 32-bit PIO mapping sg iterator
|
||||
*
|
||||
* Hides scatterlist access issues - fragment boundaries, alignment, page
|
||||
* mapping - for drivers using 32-bit-word-at-a-time-PIO (ie. PCI devices
|
||||
* without DMA support).
|
||||
*
|
||||
* Best-case reading (transfer from device):
|
||||
* sg_miter_start();
|
||||
* cb710_sg_dwiter_write_from_io();
|
||||
* cb710_sg_miter_stop_writing();
|
||||
*
|
||||
* Best-case writing (transfer to device):
|
||||
* sg_miter_start();
|
||||
* cb710_sg_dwiter_read_to_io();
|
||||
* sg_miter_stop();
|
||||
*/
|
||||
|
||||
uint32_t cb710_sg_dwiter_read_next_block(struct sg_mapping_iter *miter);
|
||||
void cb710_sg_dwiter_write_next_block(struct sg_mapping_iter *miter, uint32_t data);
|
||||
|
||||
/**
|
||||
* cb710_sg_dwiter_write_from_io - transfer data to mapped buffer from 32-bit IO port
|
||||
* @miter: sg mapping iter
|
||||
* @port: PIO port - IO or MMIO address
|
||||
* @count: number of 32-bit words to transfer
|
||||
*
|
||||
* Description:
|
||||
* Reads @count 32-bit words from register @port and stores it in
|
||||
* buffer iterated by @miter. Data that would overflow the buffer
|
||||
* is silently ignored. Iterator is advanced by 4*@count bytes
|
||||
* or to the buffer's end whichever is closer.
|
||||
*
|
||||
* Context:
|
||||
* IRQ disabled if the SG_MITER_ATOMIC is set. Don't care otherwise.
|
||||
*/
|
||||
static inline void cb710_sg_dwiter_write_from_io(struct sg_mapping_iter *miter,
|
||||
void __iomem *port, size_t count)
|
||||
{
|
||||
while (count-- > 0)
|
||||
cb710_sg_dwiter_write_next_block(miter, ioread32(port));
|
||||
}
|
||||
|
||||
/**
|
||||
* cb710_sg_dwiter_read_to_io - transfer data to 32-bit IO port from mapped buffer
|
||||
* @miter: sg mapping iter
|
||||
* @port: PIO port - IO or MMIO address
|
||||
* @count: number of 32-bit words to transfer
|
||||
*
|
||||
* Description:
|
||||
* Writes @count 32-bit words to register @port from buffer iterated
|
||||
* through @miter. If buffer ends before @count words are written
|
||||
* missing data is replaced by zeroes. @miter is advanced by 4*@count
|
||||
* bytes or to the buffer's end whichever is closer.
|
||||
*
|
||||
* Context:
|
||||
* IRQ disabled if the SG_MITER_ATOMIC is set. Don't care otherwise.
|
||||
*/
|
||||
static inline void cb710_sg_dwiter_read_to_io(struct sg_mapping_iter *miter,
|
||||
void __iomem *port, size_t count)
|
||||
{
|
||||
while (count-- > 0)
|
||||
iowrite32(cb710_sg_dwiter_read_next_block(miter), port);
|
||||
}
|
||||
|
||||
#endif /* LINUX_CB710_SG_H */
|
||||
@@ -28,6 +28,8 @@ int cdev_add(struct cdev *, dev_t, unsigned);
|
||||
|
||||
void cdev_del(struct cdev *);
|
||||
|
||||
int cdev_index(struct inode *inode);
|
||||
|
||||
void cd_forget(struct inode *);
|
||||
|
||||
extern struct backing_dev_info directly_mappable_cdev_bdi;
|
||||
|
||||
@@ -142,4 +142,17 @@ struct clk *clk_get_parent(struct clk *clk);
|
||||
*/
|
||||
struct clk *clk_get_sys(const char *dev_id, const char *con_id);
|
||||
|
||||
/**
|
||||
* clk_add_alias - add a new clock alias
|
||||
* @alias: name for clock alias
|
||||
* @alias_dev_name: device name
|
||||
* @id: platform specific clock name
|
||||
* @dev: device
|
||||
*
|
||||
* Allows using generic clock names for drivers by adding a new alias.
|
||||
* Assumes clkdev, see clkdev.h for more info.
|
||||
*/
|
||||
int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
|
||||
struct device *dev);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -288,7 +288,15 @@ static inline cycle_t clocksource_read(struct clocksource *cs)
|
||||
*/
|
||||
static inline int clocksource_enable(struct clocksource *cs)
|
||||
{
|
||||
return cs->enable ? cs->enable(cs) : 0;
|
||||
int ret = 0;
|
||||
|
||||
if (cs->enable)
|
||||
ret = cs->enable(cs);
|
||||
|
||||
/* save mult_orig on enable */
|
||||
cs->mult_orig = cs->mult;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -222,6 +222,8 @@ int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from);
|
||||
int copy_siginfo_to_user32(struct compat_siginfo __user *to, siginfo_t *from);
|
||||
int get_compat_sigevent(struct sigevent *event,
|
||||
const struct compat_sigevent __user *u_event);
|
||||
long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, compat_pid_t pid, int sig,
|
||||
struct compat_siginfo __user *uinfo);
|
||||
|
||||
static inline int compat_timeval_compare(struct compat_timeval *lhs,
|
||||
struct compat_timeval *rhs)
|
||||
|
||||
@@ -261,6 +261,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
|
||||
# define __section(S) __attribute__ ((__section__(#S)))
|
||||
#endif
|
||||
|
||||
/* Are two types/vars the same type (ignoring qualifiers)? */
|
||||
#ifndef __same_type
|
||||
# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Prevent the compiler from merging or refetching accesses. The compiler
|
||||
* is also forbidden from reordering successive instances of ACCESS_ONCE(),
|
||||
|
||||
@@ -1022,6 +1022,8 @@ typedef struct cpumask *cpumask_var_t;
|
||||
|
||||
bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node);
|
||||
bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags);
|
||||
bool zalloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node);
|
||||
bool zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags);
|
||||
void alloc_bootmem_cpumask_var(cpumask_var_t *mask);
|
||||
void free_cpumask_var(cpumask_var_t mask);
|
||||
void free_bootmem_cpumask_var(cpumask_var_t mask);
|
||||
@@ -1040,6 +1042,19 @@ static inline bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags,
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
|
||||
{
|
||||
cpumask_clear(*mask);
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool zalloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags,
|
||||
int node)
|
||||
{
|
||||
cpumask_clear(*mask);
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline void alloc_bootmem_cpumask_var(cpumask_var_t *mask)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
#define __CRAMFS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/magic.h>
|
||||
|
||||
#define CRAMFS_MAGIC 0x28cd3d45 /* some random number */
|
||||
#define CRAMFS_MAGIC_WEND 0x453dcd28 /* magic number with the wrong endianess */
|
||||
#define CRAMFS_SIGNATURE "Compressed ROMFS"
|
||||
|
||||
/*
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user