summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.transmeta.com>2002-08-12 19:34:28 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-08-12 19:34:28 -0700
commit35d9ed07aed020b5ae2e818bee7afafa15ce4b9c (patch)
tree2e4395cba6b3932440c5b8263c34ffd8bc0c7f25 /include/linux
parentf35e4d7dc26680529b6542140ef007d4a3a3fe97 (diff)
parent322bdbf706ac632cc1eb48cd247e752281a0cd99 (diff)
Merge http://fbdev.bkbits.net/fbdev-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/apm_bios.h3
-rw-r--r--include/linux/fs.h1
-rw-r--r--include/linux/init_task.h120
-rw-r--r--include/linux/rtc.h26
-rw-r--r--include/linux/sunrpc/svcsock.h1
-rw-r--r--include/linux/usb.h53
-rw-r--r--include/linux/vmalloc.h57
-rw-r--r--include/linux/wait.h10
8 files changed, 170 insertions, 101 deletions
diff --git a/include/linux/apm_bios.h b/include/linux/apm_bios.h
index 732fbff874cc..ceffd587b7a8 100644
--- a/include/linux/apm_bios.h
+++ b/include/linux/apm_bios.h
@@ -21,8 +21,7 @@ typedef unsigned short apm_eventinfo_t;
#ifdef __KERNEL__
-#define APM_40 (GDT_ENTRY_APMBIOS_BASE * 8)
-#define APM_CS (APM_BASE + 8)
+#define APM_CS (GDT_ENTRY_APMBIOS_BASE * 8)
#define APM_CS_16 (APM_CS + 8)
#define APM_DS (APM_CS_16 + 8)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 192107379fd9..ec0f6edac31b 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1241,6 +1241,7 @@ extern int generic_file_mmap(struct file *, struct vm_area_struct *);
extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *);
extern ssize_t generic_file_write(struct file *, const char *, size_t, loff_t *);
+extern ssize_t generic_file_write_nolock(struct file *, const char *, size_t, loff_t *);
extern ssize_t generic_file_sendfile(struct file *, struct file *, loff_t *, size_t);
extern void do_generic_file_read(struct file *, loff_t *, read_descriptor_t *, read_actor_t);
ssize_t generic_file_direct_IO(int rw, struct inode *inode, char *buf,
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 56c6b7181796..d023d2360a71 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -5,34 +5,34 @@
#define INIT_FILES \
{ \
- count: ATOMIC_INIT(1), \
- file_lock: RW_LOCK_UNLOCKED, \
- max_fds: NR_OPEN_DEFAULT, \
- max_fdset: __FD_SETSIZE, \
- next_fd: 0, \
- fd: &init_files.fd_array[0], \
- close_on_exec: &init_files.close_on_exec_init, \
- open_fds: &init_files.open_fds_init, \
- close_on_exec_init: { { 0, } }, \
- open_fds_init: { { 0, } }, \
- fd_array: { NULL, } \
+ .count = ATOMIC_INIT(1), \
+ .file_lock = RW_LOCK_UNLOCKED, \
+ .max_fds = NR_OPEN_DEFAULT, \
+ .max_fdset = __FD_SETSIZE, \
+ .next_fd = 0, \
+ .fd = &init_files.fd_array[0], \
+ .close_on_exec = &init_files.close_on_exec_init, \
+ .open_fds = &init_files.open_fds_init, \
+ .close_on_exec_init = { { 0, } }, \
+ .open_fds_init = { { 0, } }, \
+ .fd_array = { NULL, } \
}
#define INIT_MM(name) \
{ \
- mm_rb: RB_ROOT, \
- pgd: swapper_pg_dir, \
- mm_users: ATOMIC_INIT(2), \
- mm_count: ATOMIC_INIT(1), \
- mmap_sem: __RWSEM_INITIALIZER(name.mmap_sem), \
- page_table_lock: SPIN_LOCK_UNLOCKED, \
- mmlist: LIST_HEAD_INIT(name.mmlist), \
+ .mm_rb = RB_ROOT, \
+ .pgd = swapper_pg_dir, \
+ .mm_users = ATOMIC_INIT(2), \
+ .mm_count = ATOMIC_INIT(1), \
+ .mmap_sem = __RWSEM_INITIALIZER(name.mmap_sem), \
+ .page_table_lock = SPIN_LOCK_UNLOCKED, \
+ .mmlist = LIST_HEAD_INIT(name.mmlist), \
}
#define INIT_SIGNALS { \
- count: ATOMIC_INIT(1), \
- action: { {{0,}}, }, \
- siglock: SPIN_LOCK_UNLOCKED \
+ .count = ATOMIC_INIT(1), \
+ .action = { {{0,}}, }, \
+ .siglock = SPIN_LOCK_UNLOCKED \
}
/*
@@ -41,45 +41,45 @@
*/
#define INIT_TASK(tsk) \
{ \
- state: 0, \
- thread_info: &init_thread_info, \
- flags: 0, \
- lock_depth: -1, \
- prio: MAX_PRIO-20, \
- static_prio: MAX_PRIO-20, \
- policy: SCHED_NORMAL, \
- cpus_allowed: -1, \
- mm: NULL, \
- active_mm: &init_mm, \
- run_list: LIST_HEAD_INIT(tsk.run_list), \
- time_slice: HZ, \
- tasks: LIST_HEAD_INIT(tsk.tasks), \
- real_parent: &tsk, \
- parent: &tsk, \
- children: LIST_HEAD_INIT(tsk.children), \
- sibling: LIST_HEAD_INIT(tsk.sibling), \
- thread_group: LIST_HEAD_INIT(tsk.thread_group), \
- wait_chldexit: __WAIT_QUEUE_HEAD_INITIALIZER(tsk.wait_chldexit),\
- real_timer: { \
- function: it_real_fn \
- }, \
- cap_effective: CAP_INIT_EFF_SET, \
- cap_inheritable: CAP_INIT_INH_SET, \
- cap_permitted: CAP_FULL_SET, \
- keep_capabilities: 0, \
- rlim: INIT_RLIMITS, \
- user: INIT_USER, \
- comm: "swapper", \
- thread: INIT_THREAD, \
- fs: &init_fs, \
- files: &init_files, \
- sigmask_lock: SPIN_LOCK_UNLOCKED, \
- sig: &init_signals, \
- pending: { NULL, &tsk.pending.head, {{0}}}, \
- blocked: {{0}}, \
- alloc_lock: SPIN_LOCK_UNLOCKED, \
- switch_lock: SPIN_LOCK_UNLOCKED, \
- journal_info: NULL, \
+ .state = 0, \
+ .thread_info = &init_thread_info, \
+ .flags = 0, \
+ .lock_depth = -1, \
+ .prio = MAX_PRIO-20, \
+ .static_prio = MAX_PRIO-20, \
+ .policy = SCHED_NORMAL, \
+ .cpus_allowed = -1, \
+ .mm = NULL, \
+ .active_mm = &init_mm, \
+ .run_list = LIST_HEAD_INIT(tsk.run_list), \
+ .time_slice = HZ, \
+ .tasks = LIST_HEAD_INIT(tsk.tasks), \
+ .real_parent = &tsk, \
+ .parent = &tsk, \
+ .children = LIST_HEAD_INIT(tsk.children), \
+ .sibling = LIST_HEAD_INIT(tsk.sibling), \
+ .thread_group = LIST_HEAD_INIT(tsk.thread_group), \
+ .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(tsk.wait_chldexit),\
+ .real_timer = { \
+ .function = it_real_fn \
+ }, \
+ .cap_effective = CAP_INIT_EFF_SET, \
+ .cap_inheritable = CAP_INIT_INH_SET, \
+ .cap_permitted = CAP_FULL_SET, \
+ .keep_capabilities = 0, \
+ .rlim = INIT_RLIMITS, \
+ .user = INIT_USER, \
+ .comm = "swapper", \
+ .thread = INIT_THREAD, \
+ .fs = &init_fs, \
+ .files = &init_files, \
+ .sigmask_lock = SPIN_LOCK_UNLOCKED, \
+ .sig = &init_signals, \
+ .pending = { NULL, &tsk.pending.head, {{0}}}, \
+ .blocked = {{0}}, \
+ .alloc_lock = SPIN_LOCK_UNLOCKED, \
+ .switch_lock = SPIN_LOCK_UNLOCKED, \
+ .journal_info = NULL, \
}
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index e99a2357ab28..33edafbe6000 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -39,10 +39,32 @@ struct rtc_wkalrm {
struct rtc_time time; /* time the alarm is set to */
};
+/*
+ * Data structure to control PLL correction some better RTC feature
+ * pll_value is used to get or set current value of correction,
+ * the rest of the struct is used to query HW capabilities.
+ * This is modeled after the RTC used in Q40/Q60 computers but
+ * should be sufficiently flexible for other devices
+ *
+ * +ve pll_value means clock will run faster by
+ * pll_value*pll_posmult/pll_clock
+ * -ve pll_value means clock will run slower by
+ * pll_value*pll_negmult/pll_clock
+ */
+
+struct rtc_pll_info {
+ int pll_ctrl; /* placeholder for fancier control */
+ int pll_value; /* get/set correction value */
+ int pll_max; /* max +ve (faster) adjustment value */
+ int pll_min; /* max -ve (slower) adjustment value */
+ int pll_posmult; /* factor for +ve corection */
+ int pll_negmult; /* factor for -ve corection */
+ long pll_clock; /* base PLL frequency */
+};
/*
* ioctl calls that are permitted to the /dev/rtc interface, if
- * CONFIG_RTC/CONFIG_EFI_RTC was enabled.
+ * any of the RTC drivers are enabled.
*/
#define RTC_AIE_ON _IO('p', 0x01) /* Alarm int. enable on */
@@ -65,6 +87,8 @@ struct rtc_wkalrm {
#define RTC_WKALM_SET _IOW('p', 0x0f, struct rtc_wkalrm)/* Set wakeup alarm*/
#define RTC_WKALM_RD _IOR('p', 0x10, struct rtc_wkalrm)/* Get wakeup alarm*/
+#define RTC_PLL_GET _IOR('p', 0x11, struct rtc_pll_info) /* Get PLL correction */
+#define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info) /* Set PLL correction */
#ifdef __KERNEL__
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index eb118134b0c0..34cbc22c0732 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -30,6 +30,7 @@ struct svc_sock {
#define SK_TEMP 4 /* temp (TCP) socket */
#define SK_QUED 5 /* on serv->sk_sockets */
#define SK_DEAD 6 /* socket closed */
+#define SK_CHNGBUF 7 /* need to change snd/rcv buffer sizes */
int sk_reserved; /* space on outq that is reserved */
diff --git a/include/linux/usb.h b/include/linux/usb.h
index d9907d770a30..7f44f0ff05ef 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -734,6 +734,7 @@ extern void usb_deregister_dev(int num_minors, int start_minor);
*/
#define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */
#define USB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame ignored */
+#define URB_NO_DMA_MAP 0x0004 /* urb->*_dma are valid on submit */
#define USB_ASYNC_UNLINK 0x0008 /* usb_unlink_urb() returns asap */
#define USB_NO_FSBR 0x0020 /* UHCI-specific */
#define USB_ZERO_PACKET 0x0040 /* Finish bulk OUTs with short packet */
@@ -771,11 +772,15 @@ typedef void (*usb_complete_t)(struct urb *);
* @transfer_flags: A variety of flags may be used to affect how URB
* submission, unlinking, or operation are handled. Different
* kinds of URB can use different flags.
- * @transfer_buffer: For non-iso transfers, this identifies the buffer
- * to (or from) which the I/O request will be performed. This
- * buffer must be suitable for DMA; allocate it with kmalloc()
+ * @transfer_buffer: This identifies the buffer to (or from) which
+ * the I/O request will be performed (unless URB_NO_DMA_MAP is set).
+ * This buffer must be suitable for DMA; allocate it with kmalloc()
* or equivalent. For transfers to "in" endpoints, contents of
- * this buffer will be modified.
+ * this buffer will be modified. This buffer is used for data
+ * phases of control transfers.
+ * @transfer_dma: When transfer_flags includes URB_NO_DMA_MAP, the device
+ * driver is saying that it provided this DMA address, which the host
+ * controller driver should use instead of the transfer_buffer.
* @transfer_buffer_length: How big is transfer_buffer. The transfer may
* be broken up into chunks according to the current maximum packet
* size for the endpoint, which is a function of the configuration
@@ -789,6 +794,11 @@ typedef void (*usb_complete_t)(struct urb *);
* @setup_packet: Only used for control transfers, this points to eight bytes
* of setup data. Control transfers always start by sending this data
* to the device. Then transfer_buffer is read or written, if needed.
+ * (Not used when URB_NO_DMA_MAP is set.)
+ * @setup_dma: For control transfers with URB_NO_DMA_MAP set, the device
+ * driver has provided this DMA address for the setup packet. The
+ * host controller driver should use instead of setup_buffer.
+ * If there is a data phase, its buffer is identified by transfer_dma.
* @start_frame: Returns the initial frame for interrupt or isochronous
* transfers.
* @number_of_packets: Lists the number of ISO transfer buffers.
@@ -811,6 +821,23 @@ typedef void (*usb_complete_t)(struct urb *);
* are submitted using usb_submit_urb(), and pending requests may be canceled
* using usb_unlink_urb().
*
+ * Data Transfer Buffers:
+ *
+ * Normally drivers provide I/O buffers allocated with kmalloc() or otherwise
+ * taken from the general page pool. That is provided by transfer_buffer
+ * (control requests also use setup_packet), and host controller drivers
+ * perform a dma mapping (and unmapping) for each buffer transferred. Those
+ * mapping operations can be expensive on some platforms (such using a dma
+ * bounce buffer), although they're cheap on commodity x86 and ppc hardware.
+ *
+ * Alternatively, drivers may pass the URB_NO_DMA_MAP transfer flag, which
+ * tells the host controller driver that no such mapping is needed since
+ * the device driver is DMA-aware. For example, they might allocate a DMA
+ * buffer with usb_buffer_alloc(), or call usb_buffer_map().
+ * When this transfer flag is provided, host controller drivers will use the
+ * dma addresses found in the transfer_dma and/or setup_dma fields rather than
+ * determing a dma address themselves.
+ *
* Initialization:
*
* All URBs submitted must initialize dev, pipe,
@@ -818,10 +845,10 @@ typedef void (*usb_complete_t)(struct urb *);
* The USB_ASYNC_UNLINK transfer flag affects later invocations of
* the usb_unlink_urb() routine.
*
- * All non-isochronous URBs must also initialize
+ * All URBs must also initialize
* transfer_buffer and transfer_buffer_length. They may provide the
* URB_SHORT_NOT_OK transfer flag, indicating that short reads are
- * to be treated as errors.
+ * to be treated as errors; that flag is invalid for write requests.
*
* Bulk URBs may
* use the USB_ZERO_PACKET transfer flag, indicating that bulk OUT transfers
@@ -896,10 +923,12 @@ struct urb
int status; /* (return) non-ISO status */
unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/
void *transfer_buffer; /* (in) associated data buffer */
+ dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */
int transfer_buffer_length; /* (in) data buffer length */
int actual_length; /* (return) actual transfer length */
int bandwidth; /* bandwidth for INT/ISO request */
unsigned char *setup_packet; /* (in) setup packet (control only) */
+ dma_addr_t setup_dma; /* (in) dma addr for setup_packet */
int start_frame; /* (modify) start frame (INT/ISO) */
int number_of_packets; /* (in) number of ISO packets */
int interval; /* (in) transfer interval (INT/ISO) */
@@ -910,6 +939,8 @@ struct urb
struct usb_iso_packet_descriptor iso_frame_desc[0]; /* (in) ISO ONLY */
};
+/* -------------------------------------------------------------------------- */
+
/**
* usb_fill_control_urb - initializes a control urb
* @urb: pointer to the urb to initialize.
@@ -1032,6 +1063,16 @@ extern struct urb *usb_get_urb(struct urb *urb);
extern int usb_submit_urb(struct urb *urb, int mem_flags);
extern int usb_unlink_urb(struct urb *urb);
+#define HAVE_USB_BUFFERS
+void *usb_buffer_alloc (struct usb_device *dev, size_t size,
+ int mem_flags, dma_addr_t *dma);
+void usb_buffer_free (struct usb_device *dev, size_t size,
+ void *addr, dma_addr_t dma);
+
+struct urb *usb_buffer_map (struct urb *urb);
+void usb_buffer_dmasync (struct urb *urb);
+void usb_buffer_unmap (struct urb *urb);
+
/*-------------------------------------------------------------------*
* SYNCHRONOUS CALL SUPPORT *
*-------------------------------------------------------------------*/
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 9cc67b500368..5da711fefc6f 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -1,44 +1,47 @@
-#ifndef __LINUX_VMALLOC_H
-#define __LINUX_VMALLOC_H
+#ifndef _LINUX_VMALLOC_H
+#define _LINUX_VMALLOC_H
#include <linux/spinlock.h>
-#include <asm/pgtable.h>
-
/* bits in vm_struct->flags */
#define VM_IOREMAP 0x00000001 /* ioremap() and friends */
#define VM_ALLOC 0x00000002 /* vmalloc() */
+#define VM_MAP 0x00000004 /* vmap()ed pages */
struct vm_struct {
- unsigned long flags;
- void * addr;
- unsigned long size;
- unsigned long phys_addr;
- struct vm_struct * next;
+ void *addr;
+ unsigned long size;
+ unsigned long flags;
+ struct page **pages;
+ unsigned int nr_pages;
+ unsigned long phys_addr;
+ struct vm_struct *next;
};
-extern struct vm_struct * get_vm_area (unsigned long size, unsigned long flags);
-extern void vfree(void * addr);
-extern void * __vmalloc (unsigned long size, int gfp_mask, pgprot_t prot);
-extern long vread(char *buf, char *addr, unsigned long count);
-extern void vmfree_area_pages(unsigned long address, unsigned long size);
-extern int vmalloc_area_pages(unsigned long address, unsigned long size,
- int gfp_mask, pgprot_t prot);
-extern struct vm_struct *remove_kernel_area(void *addr);
-
/*
- * Various ways to allocate pages.
+ * Highlevel APIs for driver use
*/
-
-extern void * vmalloc(unsigned long size);
-extern void * vmalloc_32(unsigned long size);
+extern void *vmalloc(unsigned long size);
+extern void *vmalloc_32(unsigned long size);
+extern void *__vmalloc(unsigned long size, int gfp_mask, pgprot_t prot);
+extern void vfree(void *addr);
+
+extern void *vmap(struct page **pages, unsigned int count);
+extern void vunmap(void *addr);
+
+/*
+ * Lowlevel-APIs (not for driver use!)
+ */
+extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags);
+extern struct vm_struct *remove_vm_area(void *addr);
+extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
+ struct page ***pages);
+extern void unmap_vm_area(struct vm_struct *area);
/*
- * vmlist_lock is a read-write spinlock that protects vmlist
- * Used in mm/vmalloc.c (get_vm_area() and vfree()) and fs/proc/kcore.c.
+ * Internals. Dont't use..
*/
extern rwlock_t vmlist_lock;
+extern struct vm_struct *vmlist;
-extern struct vm_struct * vmlist;
-#endif
-
+#endif /* _LINUX_VMALLOC_H */
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 4141ba6e6ed5..8664b02f230d 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -43,16 +43,16 @@ typedef struct __wait_queue_head wait_queue_head_t;
*/
#define __WAITQUEUE_INITIALIZER(name, tsk) { \
- task: tsk, \
- func: default_wake_function, \
- task_list: { NULL, NULL } }
+ .task = tsk, \
+ .func = default_wake_function, \
+ .task_list = { NULL, NULL } }
#define DECLARE_WAITQUEUE(name, tsk) \
wait_queue_t name = __WAITQUEUE_INITIALIZER(name, tsk)
#define __WAIT_QUEUE_HEAD_INITIALIZER(name) { \
- lock: SPIN_LOCK_UNLOCKED, \
- task_list: { &(name).task_list, &(name).task_list } }
+ .lock = SPIN_LOCK_UNLOCKED, \
+ .task_list = { &(name).task_list, &(name).task_list } }
#define DECLARE_WAIT_QUEUE_HEAD(name) \
wait_queue_head_t name = __WAIT_QUEUE_HEAD_INITIALIZER(name)