Auto-update from upstream
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include <acpi/acpi.h>
|
||||
#include <acpi/acpi_bus.h>
|
||||
#include <acpi/acpi_drivers.h>
|
||||
#include <acpi/acpi_numa.h>
|
||||
#include <asm/acpi.h>
|
||||
|
||||
|
||||
@@ -407,10 +408,18 @@ void acpi_table_print_madt_entry (acpi_table_entry_header *madt);
|
||||
void acpi_table_print_srat_entry (acpi_table_entry_header *srat);
|
||||
|
||||
/* the following four functions are architecture-dependent */
|
||||
#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT
|
||||
#define NR_NODE_MEMBLKS MAX_NUMNODES
|
||||
#define acpi_numa_slit_init(slit) do {} while (0)
|
||||
#define acpi_numa_processor_affinity_init(pa) do {} while (0)
|
||||
#define acpi_numa_memory_affinity_init(ma) do {} while (0)
|
||||
#define acpi_numa_arch_fixup() do {} while (0)
|
||||
#else
|
||||
void acpi_numa_slit_init (struct acpi_table_slit *slit);
|
||||
void acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa);
|
||||
void acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma);
|
||||
void acpi_numa_arch_fixup(void);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ACPI_HOTPLUG_CPU
|
||||
/* Arch dependent functions for cpu hotplug support */
|
||||
|
||||
+7
-11
@@ -151,11 +151,9 @@ struct request {
|
||||
void *elevator_private;
|
||||
void *completion_data;
|
||||
|
||||
unsigned short ioprio;
|
||||
|
||||
int rq_status; /* should split this into a few status bits */
|
||||
struct gendisk *rq_disk;
|
||||
int errors;
|
||||
struct gendisk *rq_disk;
|
||||
unsigned long start_time;
|
||||
|
||||
/* Number of scatter-gather DMA addr+len pairs after
|
||||
@@ -170,8 +168,9 @@ struct request {
|
||||
*/
|
||||
unsigned short nr_hw_segments;
|
||||
|
||||
unsigned short ioprio;
|
||||
|
||||
int tag;
|
||||
char *buffer;
|
||||
|
||||
int ref_count;
|
||||
request_queue_t *q;
|
||||
@@ -179,6 +178,7 @@ struct request {
|
||||
|
||||
struct completion *waiting;
|
||||
void *special;
|
||||
char *buffer;
|
||||
|
||||
/*
|
||||
* when request is used as a packet command carrier
|
||||
@@ -187,19 +187,13 @@ struct request {
|
||||
unsigned char cmd[BLK_MAX_CDB];
|
||||
|
||||
unsigned int data_len;
|
||||
void *data;
|
||||
|
||||
unsigned int sense_len;
|
||||
void *data;
|
||||
void *sense;
|
||||
|
||||
unsigned int timeout;
|
||||
int retries;
|
||||
|
||||
/*
|
||||
* For Power Management requests
|
||||
*/
|
||||
struct request_pm_state *pm;
|
||||
|
||||
/*
|
||||
* completion callback. end_io_data should be folded in with waiting
|
||||
*/
|
||||
@@ -241,6 +235,7 @@ enum rq_flag_bits {
|
||||
__REQ_PM_RESUME, /* resume request */
|
||||
__REQ_PM_SHUTDOWN, /* shutdown request */
|
||||
__REQ_ORDERED_COLOR, /* is before or after barrier */
|
||||
__REQ_RW_SYNC, /* request is sync (O_DIRECT) */
|
||||
__REQ_NR_BITS, /* stops here */
|
||||
};
|
||||
|
||||
@@ -270,6 +265,7 @@ enum rq_flag_bits {
|
||||
#define REQ_PM_RESUME (1 << __REQ_PM_RESUME)
|
||||
#define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN)
|
||||
#define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR)
|
||||
#define REQ_RW_SYNC (1 << __REQ_RW_SYNC)
|
||||
|
||||
/*
|
||||
* State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME
|
||||
|
||||
@@ -90,9 +90,9 @@ struct blk_io_trace {
|
||||
* The remap event
|
||||
*/
|
||||
struct blk_io_trace_remap {
|
||||
u32 device;
|
||||
__be32 device;
|
||||
u32 __pad;
|
||||
u64 sector;
|
||||
__be64 sector;
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -224,7 +224,7 @@ static inline void blk_add_trace_pdu_int(struct request_queue *q, u32 what,
|
||||
struct bio *bio, unsigned int pdu)
|
||||
{
|
||||
struct blk_trace *bt = q->blk_trace;
|
||||
u64 rpdu = cpu_to_be64(pdu);
|
||||
__be64 rpdu = cpu_to_be64(pdu);
|
||||
|
||||
if (likely(!bt))
|
||||
return;
|
||||
|
||||
@@ -91,8 +91,8 @@ static inline void *alloc_remap(int nid, unsigned long size)
|
||||
}
|
||||
#endif
|
||||
|
||||
extern unsigned long __initdata nr_kernel_pages;
|
||||
extern unsigned long __initdata nr_all_pages;
|
||||
extern unsigned long nr_kernel_pages;
|
||||
extern unsigned long nr_all_pages;
|
||||
|
||||
extern void *__init alloc_large_system_hash(const char *tablename,
|
||||
unsigned long bucketsize,
|
||||
|
||||
+6
-15
@@ -3,31 +3,22 @@
|
||||
*
|
||||
* Copyright (C) Matt Helsley, IBM Corp. 2005
|
||||
* Based on cn_fork.h by Nguyen Anh Quynh and Guillaume Thouvenin
|
||||
* Original copyright notice follows:
|
||||
* Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com>
|
||||
* Copyright (C) 2005 Guillaume Thouvenin <guillaume.thouvenin@bull.net>
|
||||
*
|
||||
* 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 free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2.1 of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* This program is distributed in the hope that it would be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
#ifndef CN_PROC_H
|
||||
#define CN_PROC_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/time.h>
|
||||
#include <linux/connector.h>
|
||||
|
||||
/*
|
||||
* Userspace sends this enum to register with the kernel that it is listening
|
||||
|
||||
@@ -36,7 +36,7 @@ extern const struct file_operations coda_ioctl_operations;
|
||||
|
||||
/* operations shared over more than one file */
|
||||
int coda_open(struct inode *i, struct file *f);
|
||||
int coda_flush(struct file *f);
|
||||
int coda_flush(struct file *f, fl_owner_t id);
|
||||
int coda_release(struct inode *i, struct file *f);
|
||||
int coda_permission(struct inode *inode, int mask, struct nameidata *nd);
|
||||
int coda_revalidate_inode(struct dentry *);
|
||||
|
||||
@@ -70,7 +70,7 @@ int venus_pioctl(struct super_block *sb, struct CodaFid *fid,
|
||||
unsigned int cmd, struct PioctlData *data);
|
||||
int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb);
|
||||
int venus_fsync(struct super_block *sb, struct CodaFid *fid);
|
||||
int venus_statfs(struct super_block *sb, struct kstatfs *sfs);
|
||||
int venus_statfs(struct dentry *dentry, struct kstatfs *sfs);
|
||||
|
||||
|
||||
/* messages between coda filesystem in kernel and Venus */
|
||||
|
||||
@@ -34,8 +34,11 @@
|
||||
#define CN_VAL_PROC 0x1
|
||||
#define CN_IDX_CIFS 0x2
|
||||
#define CN_VAL_CIFS 0x1
|
||||
#define CN_W1_IDX 0x3 /* w1 communication */
|
||||
#define CN_W1_VAL 0x1
|
||||
|
||||
#define CN_NETLINK_USERS 1
|
||||
|
||||
#define CN_NETLINK_USERS 4
|
||||
|
||||
/*
|
||||
* Maximum connector's message size.
|
||||
|
||||
@@ -72,6 +72,8 @@ struct cpufreq_real_policy {
|
||||
|
||||
struct cpufreq_policy {
|
||||
cpumask_t cpus; /* affected CPUs */
|
||||
unsigned int shared_type; /* ANY or ALL affected CPUs
|
||||
should set cpufreq */
|
||||
unsigned int cpu; /* cpu nr of registered CPU */
|
||||
struct cpufreq_cpuinfo cpuinfo;/* see above */
|
||||
|
||||
@@ -98,6 +100,8 @@ struct cpufreq_policy {
|
||||
#define CPUFREQ_INCOMPATIBLE (1)
|
||||
#define CPUFREQ_NOTIFY (2)
|
||||
|
||||
#define CPUFREQ_SHARED_TYPE_ALL (0) /* All dependent CPUs should set freq */
|
||||
#define CPUFREQ_SHARED_TYPE_ANY (1) /* Freq can be set from any dependent CPU */
|
||||
|
||||
/******************** cpufreq transition notifiers *******************/
|
||||
|
||||
|
||||
@@ -217,7 +217,6 @@ extern struct dentry * d_alloc_anon(struct inode *);
|
||||
extern struct dentry * d_splice_alias(struct inode *, struct dentry *);
|
||||
extern void shrink_dcache_sb(struct super_block *);
|
||||
extern void shrink_dcache_parent(struct dentry *);
|
||||
extern void shrink_dcache_anon(struct hlist_head *);
|
||||
extern int d_invalidate(struct dentry *);
|
||||
|
||||
/* only used at mount-time */
|
||||
|
||||
@@ -25,10 +25,7 @@ extern unsigned long loops_per_jiffy;
|
||||
#define MAX_UDELAY_MS 5
|
||||
#endif
|
||||
|
||||
#ifdef notdef
|
||||
#define mdelay(n) (\
|
||||
{unsigned long __ms=(n); while (__ms--) udelay(1000);})
|
||||
#else
|
||||
#ifndef mdelay
|
||||
#define mdelay(n) (\
|
||||
(__builtin_constant_p(n) && (n)<=MAX_UDELAY_MS) ? udelay((n)*1000) : \
|
||||
({unsigned long __ms=(n); while (__ms--) udelay(1000);}))
|
||||
|
||||
+16
-9
@@ -60,11 +60,6 @@ extern void bus_unregister(struct bus_type * bus);
|
||||
|
||||
extern void bus_rescan_devices(struct bus_type * bus);
|
||||
|
||||
extern struct bus_type * get_bus(struct bus_type * bus);
|
||||
extern void put_bus(struct bus_type * bus);
|
||||
|
||||
extern struct bus_type * find_bus(char * name);
|
||||
|
||||
/* iterator helpers for buses */
|
||||
|
||||
int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data,
|
||||
@@ -147,6 +142,7 @@ struct class {
|
||||
|
||||
struct subsystem subsys;
|
||||
struct list_head children;
|
||||
struct list_head devices;
|
||||
struct list_head interfaces;
|
||||
struct semaphore sem; /* locks both the children and interfaces lists */
|
||||
|
||||
@@ -163,9 +159,6 @@ struct class {
|
||||
extern int class_register(struct class *);
|
||||
extern void class_unregister(struct class *);
|
||||
|
||||
extern struct class * class_get(struct class *);
|
||||
extern void class_put(struct class *);
|
||||
|
||||
|
||||
struct class_attribute {
|
||||
struct attribute attr;
|
||||
@@ -313,6 +306,7 @@ struct device {
|
||||
struct kobject kobj;
|
||||
char bus_id[BUS_ID_SIZE]; /* position on parent bus */
|
||||
struct device_attribute uevent_attr;
|
||||
struct device_attribute *devt_attr;
|
||||
|
||||
struct semaphore sem; /* semaphore to synchronize calls to
|
||||
* its driver.
|
||||
@@ -340,6 +334,11 @@ struct device {
|
||||
struct dma_coherent_mem *dma_mem; /* internal for coherent mem
|
||||
override */
|
||||
|
||||
/* class_device migration path */
|
||||
struct list_head node;
|
||||
struct class *class; /* optional*/
|
||||
dev_t devt; /* dev_t, creates the sysfs "dev" */
|
||||
|
||||
void (*release)(struct device * dev);
|
||||
};
|
||||
|
||||
@@ -381,6 +380,13 @@ extern int device_attach(struct device * dev);
|
||||
extern void driver_attach(struct device_driver * drv);
|
||||
extern void device_reprobe(struct device *dev);
|
||||
|
||||
/*
|
||||
* Easy functions for dynamically creating devices on the fly
|
||||
*/
|
||||
extern struct device *device_create(struct class *cls, struct device *parent,
|
||||
dev_t devt, char *fmt, ...)
|
||||
__attribute__((format(printf,4,5)));
|
||||
extern void device_destroy(struct class *cls, dev_t devt);
|
||||
|
||||
/*
|
||||
* Platform "fixup" functions - allow the platform to have their say
|
||||
@@ -410,8 +416,9 @@ extern int firmware_register(struct subsystem *);
|
||||
extern void firmware_unregister(struct subsystem *);
|
||||
|
||||
/* debugging and troubleshooting/diagnostic helpers. */
|
||||
extern const char *dev_driver_string(struct device *dev);
|
||||
#define dev_printk(level, dev, format, arg...) \
|
||||
printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : "" , (dev)->bus_id , ## arg)
|
||||
printk(level "%s %s: " format , dev_driver_string(dev) , (dev)->bus_id , ## arg)
|
||||
|
||||
#ifdef DEBUG
|
||||
#define dev_dbg(dev, format, arg...) \
|
||||
|
||||
@@ -411,6 +411,8 @@ struct ethtool_ops {
|
||||
#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */
|
||||
#define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */
|
||||
#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
|
||||
#define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (ethtool_value) */
|
||||
#define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */
|
||||
|
||||
/* compatibility with older code */
|
||||
#define SPARC_ETH_GSET ETHTOOL_GSET
|
||||
|
||||
+24
-18
@@ -376,7 +376,8 @@ struct address_space_operations {
|
||||
struct page* (*get_xip_page)(struct address_space *, sector_t,
|
||||
int);
|
||||
/* migrate the contents of a page to the specified target */
|
||||
int (*migratepage) (struct page *, struct page *);
|
||||
int (*migratepage) (struct address_space *,
|
||||
struct page *, struct page *);
|
||||
};
|
||||
|
||||
struct backing_dev_info;
|
||||
@@ -682,6 +683,7 @@ extern spinlock_t files_lock;
|
||||
#define FL_FLOCK 2
|
||||
#define FL_ACCESS 8 /* not trying to lock, just looking */
|
||||
#define FL_LEASE 32 /* lease held on this file */
|
||||
#define FL_CLOSE 64 /* unlock on close */
|
||||
#define FL_SLEEP 128 /* A blocking lock */
|
||||
|
||||
/*
|
||||
@@ -774,7 +776,6 @@ extern int posix_lock_file_conf(struct file *, struct file_lock *, struct file_l
|
||||
extern int posix_lock_file(struct file *, struct file_lock *);
|
||||
extern int posix_lock_file_wait(struct file *, struct file_lock *);
|
||||
extern int posix_unblock_lock(struct file *, struct file_lock *);
|
||||
extern int posix_locks_deadlock(struct file_lock *, struct file_lock *);
|
||||
extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl);
|
||||
extern int __break_lease(struct inode *inode, unsigned int flags);
|
||||
extern void lease_get_mtime(struct inode *, struct timespec *time);
|
||||
@@ -782,7 +783,6 @@ extern int setlease(struct file *, long, struct file_lock **);
|
||||
extern int lease_modify(struct file_lock **, int);
|
||||
extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
|
||||
extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
|
||||
extern void steal_locks(fl_owner_t from);
|
||||
|
||||
struct fasync_struct {
|
||||
int magic;
|
||||
@@ -1025,7 +1025,7 @@ struct file_operations {
|
||||
long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
|
||||
int (*mmap) (struct file *, struct vm_area_struct *);
|
||||
int (*open) (struct inode *, struct file *);
|
||||
int (*flush) (struct file *);
|
||||
int (*flush) (struct file *, fl_owner_t id);
|
||||
int (*release) (struct inode *, struct file *);
|
||||
int (*fsync) (struct file *, struct dentry *, int datasync);
|
||||
int (*aio_fsync) (struct kiocb *, int datasync);
|
||||
@@ -1097,7 +1097,7 @@ struct super_operations {
|
||||
int (*sync_fs)(struct super_block *sb, int wait);
|
||||
void (*write_super_lockfs) (struct super_block *);
|
||||
void (*unlockfs) (struct super_block *);
|
||||
int (*statfs) (struct super_block *, struct kstatfs *);
|
||||
int (*statfs) (struct dentry *, struct kstatfs *);
|
||||
int (*remount_fs) (struct super_block *, int *, char *);
|
||||
void (*clear_inode) (struct inode *);
|
||||
void (*umount_begin) (struct super_block *);
|
||||
@@ -1270,23 +1270,26 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent,
|
||||
struct file_system_type {
|
||||
const char *name;
|
||||
int fs_flags;
|
||||
struct super_block *(*get_sb) (struct file_system_type *, int,
|
||||
const char *, void *);
|
||||
int (*get_sb) (struct file_system_type *, int,
|
||||
const char *, void *, struct vfsmount *);
|
||||
void (*kill_sb) (struct super_block *);
|
||||
struct module *owner;
|
||||
struct file_system_type * next;
|
||||
struct list_head fs_supers;
|
||||
};
|
||||
|
||||
struct super_block *get_sb_bdev(struct file_system_type *fs_type,
|
||||
extern int get_sb_bdev(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data,
|
||||
int (*fill_super)(struct super_block *, void *, int));
|
||||
struct super_block *get_sb_single(struct file_system_type *fs_type,
|
||||
int (*fill_super)(struct super_block *, void *, int),
|
||||
struct vfsmount *mnt);
|
||||
extern int get_sb_single(struct file_system_type *fs_type,
|
||||
int flags, void *data,
|
||||
int (*fill_super)(struct super_block *, void *, int));
|
||||
struct super_block *get_sb_nodev(struct file_system_type *fs_type,
|
||||
int (*fill_super)(struct super_block *, void *, int),
|
||||
struct vfsmount *mnt);
|
||||
extern int get_sb_nodev(struct file_system_type *fs_type,
|
||||
int flags, void *data,
|
||||
int (*fill_super)(struct super_block *, void *, int));
|
||||
int (*fill_super)(struct super_block *, void *, int),
|
||||
struct vfsmount *mnt);
|
||||
void generic_shutdown_super(struct super_block *sb);
|
||||
void kill_block_super(struct super_block *sb);
|
||||
void kill_anon_super(struct super_block *sb);
|
||||
@@ -1297,8 +1300,10 @@ struct super_block *sget(struct file_system_type *type,
|
||||
int (*test)(struct super_block *,void *),
|
||||
int (*set)(struct super_block *,void *),
|
||||
void *data);
|
||||
struct super_block *get_sb_pseudo(struct file_system_type *, char *,
|
||||
struct super_operations *ops, unsigned long);
|
||||
extern int get_sb_pseudo(struct file_system_type *, char *,
|
||||
struct super_operations *ops, unsigned long,
|
||||
struct vfsmount *mnt);
|
||||
extern int simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
|
||||
int __put_super(struct super_block *sb);
|
||||
int __put_super_and_need_restart(struct super_block *sb);
|
||||
void unnamed_dev_init(void);
|
||||
@@ -1321,7 +1326,7 @@ extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int);
|
||||
extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *,
|
||||
struct vfsmount *);
|
||||
|
||||
extern int vfs_statfs(struct super_block *, struct kstatfs *);
|
||||
extern int vfs_statfs(struct dentry *, struct kstatfs *);
|
||||
|
||||
/* /sys/fs */
|
||||
extern struct subsystem fs_subsys;
|
||||
@@ -1742,7 +1747,7 @@ extern int dcache_dir_close(struct inode *, struct file *);
|
||||
extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
|
||||
extern int dcache_readdir(struct file *, void *, filldir_t);
|
||||
extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *);
|
||||
extern int simple_statfs(struct super_block *, struct kstatfs *);
|
||||
extern int simple_statfs(struct dentry *, struct kstatfs *);
|
||||
extern int simple_link(struct dentry *, struct inode *, struct dentry *);
|
||||
extern int simple_unlink(struct inode *, struct dentry *);
|
||||
extern int simple_rmdir(struct inode *, struct dentry *);
|
||||
@@ -1768,7 +1773,8 @@ extern void simple_release_fs(struct vfsmount **mount, int *count);
|
||||
extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t);
|
||||
|
||||
#ifdef CONFIG_MIGRATION
|
||||
extern int buffer_migrate_page(struct page *, struct page *);
|
||||
extern int buffer_migrate_page(struct address_space *,
|
||||
struct page *, struct page *);
|
||||
#else
|
||||
#define buffer_migrate_page NULL
|
||||
#endif
|
||||
|
||||
+19
-24
@@ -4,37 +4,32 @@
|
||||
* Uses for this includes on-device special memory, uncached memory
|
||||
* etc.
|
||||
*
|
||||
* This code is based on the buddy allocator found in the sym53c8xx_2
|
||||
* driver, adapted for general purpose use.
|
||||
*
|
||||
* This source code is licensed under the GNU General Public License,
|
||||
* Version 2. See the file COPYING for more details.
|
||||
*/
|
||||
|
||||
#include <linux/spinlock.h>
|
||||
|
||||
#define ALLOC_MIN_SHIFT 5 /* 32 bytes minimum */
|
||||
/*
|
||||
* Link between free memory chunks of a given size.
|
||||
*/
|
||||
struct gen_pool_link {
|
||||
struct gen_pool_link *next;
|
||||
};
|
||||
|
||||
/*
|
||||
* Memory pool descriptor.
|
||||
* General purpose special memory pool descriptor.
|
||||
*/
|
||||
struct gen_pool {
|
||||
spinlock_t lock;
|
||||
unsigned long (*get_new_chunk)(struct gen_pool *);
|
||||
struct gen_pool *next;
|
||||
struct gen_pool_link *h;
|
||||
unsigned long private;
|
||||
int max_chunk_shift;
|
||||
rwlock_t lock;
|
||||
struct list_head chunks; /* list of chunks in this pool */
|
||||
int min_alloc_order; /* minimum allocation order */
|
||||
};
|
||||
|
||||
unsigned long gen_pool_alloc(struct gen_pool *poolp, int size);
|
||||
void gen_pool_free(struct gen_pool *mp, unsigned long ptr, int size);
|
||||
struct gen_pool *gen_pool_create(int nr_chunks, int max_chunk_shift,
|
||||
unsigned long (*fp)(struct gen_pool *),
|
||||
unsigned long data);
|
||||
/*
|
||||
* General purpose special memory pool chunk descriptor.
|
||||
*/
|
||||
struct gen_pool_chunk {
|
||||
spinlock_t lock;
|
||||
struct list_head next_chunk; /* next chunk in pool */
|
||||
unsigned long start_addr; /* starting address of memory chunk */
|
||||
unsigned long end_addr; /* ending address of memory chunk */
|
||||
unsigned long bits[0]; /* bitmap for allocating memory chunk */
|
||||
};
|
||||
|
||||
extern struct gen_pool *gen_pool_create(int, int);
|
||||
extern int gen_pool_add(struct gen_pool *, unsigned long, size_t, int);
|
||||
extern unsigned long gen_pool_alloc(struct gen_pool *, size_t);
|
||||
extern void gen_pool_free(struct gen_pool *, unsigned long, size_t);
|
||||
|
||||
@@ -188,7 +188,7 @@ int hdlc_x25_ioctl(struct net_device *dev, struct ifreq *ifr);
|
||||
int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
|
||||
|
||||
/* Must be used by hardware driver on module startup/exit */
|
||||
int register_hdlc_device(struct net_device *dev);
|
||||
#define register_hdlc_device(dev) register_netdev(dev)
|
||||
void unregister_hdlc_device(struct net_device *dev);
|
||||
|
||||
struct net_device *alloc_hdlcdev(void *priv);
|
||||
|
||||
@@ -23,6 +23,8 @@ int hugetlb_report_node_meminfo(int, char *);
|
||||
unsigned long hugetlb_total_pages(void);
|
||||
int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
|
||||
unsigned long address, int write_access);
|
||||
int hugetlb_reserve_pages(struct inode *inode, long from, long to);
|
||||
void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
|
||||
|
||||
extern unsigned long max_huge_pages;
|
||||
extern const unsigned long hugetlb_zero, hugetlb_infinity;
|
||||
@@ -139,8 +141,6 @@ struct hugetlbfs_sb_info {
|
||||
|
||||
struct hugetlbfs_inode_info {
|
||||
struct shared_policy policy;
|
||||
/* Protected by the (global) hugetlb_lock */
|
||||
unsigned long prereserved_hpages;
|
||||
struct inode vfs_inode;
|
||||
};
|
||||
|
||||
@@ -157,10 +157,6 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
|
||||
extern const struct file_operations hugetlbfs_file_operations;
|
||||
extern struct vm_operations_struct hugetlb_vm_ops;
|
||||
struct file *hugetlb_zero_setup(size_t);
|
||||
int hugetlb_extend_reservation(struct hugetlbfs_inode_info *info,
|
||||
unsigned long atleast_hpages);
|
||||
void hugetlb_truncate_reservation(struct hugetlbfs_inode_info *info,
|
||||
unsigned long atmost_hpages);
|
||||
int hugetlb_get_quota(struct address_space *mapping);
|
||||
void hugetlb_put_quota(struct address_space *mapping);
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* i2c-ocores.h - definitions for the i2c-ocores interface
|
||||
*
|
||||
* Peter Korsgaard <jacmet@sunsite.dk>
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public License
|
||||
* version 2. This program is licensed "as is" without any warranty of any
|
||||
* kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_I2C_OCORES_H
|
||||
#define _LINUX_I2C_OCORES_H
|
||||
|
||||
struct ocores_i2c_platform_data {
|
||||
u32 regstep; /* distance between registers */
|
||||
u32 clock_khz; /* input clock in kHz */
|
||||
};
|
||||
|
||||
#endif /* _LINUX_I2C_OCORES_H */
|
||||
+2
-2
@@ -97,13 +97,13 @@ extern s32 i2c_smbus_write_word_data(struct i2c_client * client,
|
||||
u8 command, u16 value);
|
||||
extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
|
||||
u8 command, u8 length,
|
||||
u8 *values);
|
||||
const u8 *values);
|
||||
/* Returns the number of read bytes */
|
||||
extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
|
||||
u8 command, u8 *values);
|
||||
extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
|
||||
u8 command, u8 length,
|
||||
u8 *values);
|
||||
const u8 *values);
|
||||
|
||||
/*
|
||||
* A driver is capable of handling one or more physical devices present on
|
||||
|
||||
@@ -7,32 +7,13 @@
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/preempt.h>
|
||||
#include <linux/cpumask.h>
|
||||
#include <linux/irqreturn.h>
|
||||
#include <linux/hardirq.h>
|
||||
#include <linux/sched.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/system.h>
|
||||
|
||||
/*
|
||||
* For 2.4.x compatibility, 2.4.x can use
|
||||
*
|
||||
* typedef void irqreturn_t;
|
||||
* #define IRQ_NONE
|
||||
* #define IRQ_HANDLED
|
||||
* #define IRQ_RETVAL(x)
|
||||
*
|
||||
* To mix old-style and new-style irq handler returns.
|
||||
*
|
||||
* IRQ_NONE means we didn't handle it.
|
||||
* IRQ_HANDLED means that we did have a valid interrupt and handled it.
|
||||
* IRQ_RETVAL(x) selects on the two depending on x being non-zero (for handled)
|
||||
*/
|
||||
typedef int irqreturn_t;
|
||||
|
||||
#define IRQ_NONE (0)
|
||||
#define IRQ_HANDLED (1)
|
||||
#define IRQ_RETVAL(x) ((x) != 0)
|
||||
|
||||
struct irqaction {
|
||||
irqreturn_t (*handler)(int, void *, struct pt_regs *);
|
||||
unsigned long flags;
|
||||
|
||||
@@ -147,6 +147,10 @@ struct ioc4_misc_regs {
|
||||
#define IOC4_GPCR_EDGE_6 0x40
|
||||
#define IOC4_GPCR_EDGE_7 0x80
|
||||
|
||||
#define IOC4_VARIANT_IO9 0x0900
|
||||
#define IOC4_VARIANT_PCI_RT 0x0901
|
||||
#define IOC4_VARIANT_IO10 0x1000
|
||||
|
||||
/* One of these per IOC4 */
|
||||
struct ioc4_driver_data {
|
||||
struct list_head idd_list;
|
||||
@@ -156,6 +160,7 @@ struct ioc4_driver_data {
|
||||
struct __iomem ioc4_misc_regs *idd_misc_regs;
|
||||
unsigned long count_period;
|
||||
void *idd_serial_data;
|
||||
unsigned int idd_variant;
|
||||
};
|
||||
|
||||
/* One per submodule */
|
||||
|
||||
+10
-1
@@ -17,6 +17,7 @@
|
||||
#include <linux/cache.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/cpumask.h>
|
||||
#include <linux/irqreturn.h>
|
||||
|
||||
#include <asm/irq.h>
|
||||
#include <asm/ptrace.h>
|
||||
@@ -164,10 +165,18 @@ static inline void set_irq_info(int irq, cpumask_t mask)
|
||||
|
||||
#endif // CONFIG_SMP
|
||||
|
||||
#ifdef CONFIG_IRQBALANCE
|
||||
extern void set_balance_irq_affinity(unsigned int irq, cpumask_t mask);
|
||||
#else
|
||||
static inline void set_balance_irq_affinity(unsigned int irq, cpumask_t mask)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
extern int no_irq_affinity;
|
||||
extern int noirqdebug_setup(char *str);
|
||||
|
||||
extern fastcall int handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
|
||||
extern fastcall irqreturn_t handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
|
||||
struct irqaction *action);
|
||||
extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs);
|
||||
extern void note_interrupt(unsigned int irq, irq_desc_t *desc,
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/* irqreturn.h */
|
||||
#ifndef _LINUX_IRQRETURN_H
|
||||
#define _LINUX_IRQRETURN_H
|
||||
|
||||
/*
|
||||
* For 2.4.x compatibility, 2.4.x can use
|
||||
*
|
||||
* typedef void irqreturn_t;
|
||||
* #define IRQ_NONE
|
||||
* #define IRQ_HANDLED
|
||||
* #define IRQ_RETVAL(x)
|
||||
*
|
||||
* To mix old-style and new-style irq handler returns.
|
||||
*
|
||||
* IRQ_NONE means we didn't handle it.
|
||||
* IRQ_HANDLED means that we did have a valid interrupt and handled it.
|
||||
* IRQ_RETVAL(x) selects on the two depending on x being non-zero (for handled)
|
||||
*/
|
||||
typedef int irqreturn_t;
|
||||
|
||||
#define IRQ_NONE (0)
|
||||
#define IRQ_HANDLED (1)
|
||||
#define IRQ_RETVAL(x) ((x) != 0)
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* ISA bus.
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_ISA_H
|
||||
#define __LINUX_ISA_H
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/kernel.h>
|
||||
|
||||
struct isa_driver {
|
||||
int (*match)(struct device *, unsigned int);
|
||||
int (*probe)(struct device *, unsigned int);
|
||||
int (*remove)(struct device *, unsigned int);
|
||||
void (*shutdown)(struct device *, unsigned int);
|
||||
int (*suspend)(struct device *, unsigned int, pm_message_t);
|
||||
int (*resume)(struct device *, unsigned int);
|
||||
|
||||
struct device_driver driver;
|
||||
struct device *devices;
|
||||
};
|
||||
|
||||
#define to_isa_driver(x) container_of((x), struct isa_driver, driver)
|
||||
|
||||
int isa_register_driver(struct isa_driver *, unsigned int);
|
||||
void isa_unregister_driver(struct isa_driver *);
|
||||
|
||||
#endif /* __LINUX_ISA_H */
|
||||
+7
-1
@@ -500,6 +500,12 @@ struct transaction_s
|
||||
*/
|
||||
struct journal_head *t_checkpoint_list;
|
||||
|
||||
/*
|
||||
* Doubly-linked circular list of all buffers submitted for IO while
|
||||
* checkpointing. [j_list_lock]
|
||||
*/
|
||||
struct journal_head *t_checkpoint_io_list;
|
||||
|
||||
/*
|
||||
* Doubly-linked circular list of temporary buffers currently undergoing
|
||||
* IO in the log [j_list_lock]
|
||||
@@ -849,7 +855,7 @@ extern void journal_commit_transaction(journal_t *);
|
||||
|
||||
/* Checkpoint list management */
|
||||
int __journal_clean_checkpoint_list(journal_t *journal);
|
||||
void __journal_remove_checkpoint(struct journal_head *);
|
||||
int __journal_remove_checkpoint(struct journal_head *);
|
||||
void __journal_insert_checkpoint(struct journal_head *, transaction_t *);
|
||||
|
||||
/* Buffer IO */
|
||||
|
||||
@@ -24,6 +24,9 @@ extern const char linux_banner[];
|
||||
#define LONG_MAX ((long)(~0UL>>1))
|
||||
#define LONG_MIN (-LONG_MAX - 1)
|
||||
#define ULONG_MAX (~0UL)
|
||||
#define LLONG_MAX ((long long)(~0ULL>>1))
|
||||
#define LLONG_MIN (-LLONG_MAX - 1)
|
||||
#define ULLONG_MAX (~0ULL)
|
||||
|
||||
#define STACK_MAGIC 0xdeadbeef
|
||||
|
||||
@@ -75,7 +78,7 @@ extern int cond_resched(void);
|
||||
# define might_sleep() do { might_resched(); } while (0)
|
||||
#endif
|
||||
|
||||
#define might_sleep_if(cond) do { if (unlikely(cond)) might_sleep(); } while (0)
|
||||
#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
|
||||
|
||||
#define abs(x) ({ \
|
||||
int __x = (x); \
|
||||
|
||||
@@ -106,6 +106,7 @@ extern struct page *kimage_alloc_control_pages(struct kimage *image,
|
||||
extern void crash_kexec(struct pt_regs *);
|
||||
int kexec_should_crash(struct task_struct *);
|
||||
extern struct kimage *kexec_image;
|
||||
extern struct kimage *kexec_crash_image;
|
||||
|
||||
#define KEXEC_ON_CRASH 0x00000001
|
||||
#define KEXEC_ARCH_MASK 0xffff0000
|
||||
|
||||
+18
-5
@@ -205,6 +205,11 @@ struct key_type {
|
||||
/* match a key against a description */
|
||||
int (*match)(const struct key *key, const void *desc);
|
||||
|
||||
/* clear some of the data from a key on revokation (optional)
|
||||
* - the key's semaphore will be write-locked by the caller
|
||||
*/
|
||||
void (*revoke)(struct key *key);
|
||||
|
||||
/* clear the data from a key (optional) */
|
||||
void (*destroy)(struct key *key);
|
||||
|
||||
@@ -241,8 +246,9 @@ extern void unregister_key_type(struct key_type *ktype);
|
||||
|
||||
extern struct key *key_alloc(struct key_type *type,
|
||||
const char *desc,
|
||||
uid_t uid, gid_t gid, key_perm_t perm,
|
||||
int not_in_quota);
|
||||
uid_t uid, gid_t gid,
|
||||
struct task_struct *ctx,
|
||||
key_perm_t perm, int not_in_quota);
|
||||
extern int key_payload_reserve(struct key *key, size_t datalen);
|
||||
extern int key_instantiate_and_link(struct key *key,
|
||||
const void *data,
|
||||
@@ -292,7 +298,9 @@ extern int key_unlink(struct key *keyring,
|
||||
struct key *key);
|
||||
|
||||
extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid,
|
||||
int not_in_quota, struct key *dest);
|
||||
struct task_struct *ctx,
|
||||
int not_in_quota,
|
||||
struct key *dest);
|
||||
|
||||
extern int keyring_clear(struct key *keyring);
|
||||
|
||||
@@ -313,7 +321,8 @@ extern void keyring_replace_payload(struct key *key, void *replacement);
|
||||
* the userspace interface
|
||||
*/
|
||||
extern struct key root_user_keyring, root_session_keyring;
|
||||
extern int alloc_uid_keyring(struct user_struct *user);
|
||||
extern int alloc_uid_keyring(struct user_struct *user,
|
||||
struct task_struct *ctx);
|
||||
extern void switch_uid_keyring(struct user_struct *new_user);
|
||||
extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk);
|
||||
extern int copy_thread_group_keys(struct task_struct *tsk);
|
||||
@@ -342,7 +351,7 @@ extern void key_init(void);
|
||||
#define make_key_ref(k) ({ NULL; })
|
||||
#define key_ref_to_ptr(k) ({ NULL; })
|
||||
#define is_key_possessed(k) 0
|
||||
#define alloc_uid_keyring(u) 0
|
||||
#define alloc_uid_keyring(u,c) 0
|
||||
#define switch_uid_keyring(u) do { } while(0)
|
||||
#define __install_session_keyring(t, k) ({ NULL; })
|
||||
#define copy_keys(f,t) 0
|
||||
@@ -355,6 +364,10 @@ extern void key_init(void);
|
||||
#define key_fsgid_changed(t) do { } while(0)
|
||||
#define key_init() do { } while(0)
|
||||
|
||||
/* Initial keyrings */
|
||||
extern struct key root_user_keyring;
|
||||
extern struct key root_session_keyring;
|
||||
|
||||
#endif /* CONFIG_KEYS */
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _LINUX_KEY_H */
|
||||
|
||||
@@ -190,6 +190,8 @@ struct subsystem _varname##_subsys = { \
|
||||
|
||||
/* The global /sys/kernel/ subsystem for people to chain off of */
|
||||
extern struct subsystem kernel_subsys;
|
||||
/* The global /sys/hypervisor/ subsystem */
|
||||
extern struct subsystem hypervisor_subsys;
|
||||
|
||||
/**
|
||||
* Helpers for setting the kset of registered objects.
|
||||
|
||||
@@ -197,12 +197,35 @@ static inline void list_del_rcu(struct list_head *entry)
|
||||
entry->prev = LIST_POISON2;
|
||||
}
|
||||
|
||||
/**
|
||||
* list_replace - replace old entry by new one
|
||||
* @old : the element to be replaced
|
||||
* @new : the new element to insert
|
||||
* Note: if 'old' was empty, it will be overwritten.
|
||||
*/
|
||||
static inline void list_replace(struct list_head *old,
|
||||
struct list_head *new)
|
||||
{
|
||||
new->next = old->next;
|
||||
new->next->prev = new;
|
||||
new->prev = old->prev;
|
||||
new->prev->next = new;
|
||||
}
|
||||
|
||||
static inline void list_replace_init(struct list_head *old,
|
||||
struct list_head *new)
|
||||
{
|
||||
list_replace(old, new);
|
||||
INIT_LIST_HEAD(old);
|
||||
}
|
||||
|
||||
/*
|
||||
* list_replace_rcu - replace old entry by new one
|
||||
* @old : the element to be replaced
|
||||
* @new : the new element to insert
|
||||
*
|
||||
* The old entry will be replaced with the new entry atomically.
|
||||
* Note: 'old' should not be empty.
|
||||
*/
|
||||
static inline void list_replace_rcu(struct list_head *old,
|
||||
struct list_head *new)
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Definitions for the ST M41T00 family of i2c rtc chips.
|
||||
*
|
||||
* Author: Mark A. Greer <mgreer@mvista.com>
|
||||
*
|
||||
* 2005, 2006 (c) MontaVista Software, Inc. This file is licensed under
|
||||
* the terms of the GNU General Public License version 2. This program
|
||||
* is licensed "as is" without any warranty of any kind, whether express
|
||||
* or implied.
|
||||
*/
|
||||
|
||||
#ifndef _M41T00_H
|
||||
#define _M41T00_H
|
||||
|
||||
#define M41T00_DRV_NAME "m41t00"
|
||||
#define M41T00_I2C_ADDR 0x68
|
||||
|
||||
#define M41T00_TYPE_M41T00 0
|
||||
#define M41T00_TYPE_M41T81 81
|
||||
#define M41T00_TYPE_M41T85 85
|
||||
|
||||
struct m41t00_platform_data {
|
||||
u8 type;
|
||||
u8 i2c_addr;
|
||||
u8 sqw_freq;
|
||||
};
|
||||
|
||||
/* SQW output disabled, this is default value by power on */
|
||||
#define M41T00_SQW_DISABLE (0)
|
||||
|
||||
#define M41T00_SQW_32KHZ (1<<4) /* 32.768 KHz */
|
||||
#define M41T00_SQW_8KHZ (2<<4) /* 8.192 KHz */
|
||||
#define M41T00_SQW_4KHZ (3<<4) /* 4.096 KHz */
|
||||
#define M41T00_SQW_2KHZ (4<<4) /* 2.048 KHz */
|
||||
#define M41T00_SQW_1KHZ (5<<4) /* 1.024 KHz */
|
||||
#define M41T00_SQW_512HZ (6<<4) /* 512 Hz */
|
||||
#define M41T00_SQW_256HZ (7<<4) /* 256 Hz */
|
||||
#define M41T00_SQW_128HZ (8<<4) /* 128 Hz */
|
||||
#define M41T00_SQW_64HZ (9<<4) /* 64 Hz */
|
||||
#define M41T00_SQW_32HZ (10<<4) /* 32 Hz */
|
||||
#define M41T00_SQW_16HZ (11<<4) /* 16 Hz */
|
||||
#define M41T00_SQW_8HZ (12<<4) /* 8 Hz */
|
||||
#define M41T00_SQW_4HZ (13<<4) /* 4 Hz */
|
||||
#define M41T00_SQW_2HZ (14<<4) /* 2 Hz */
|
||||
#define M41T00_SQW_1HZ (15<<4) /* 1 Hz */
|
||||
|
||||
extern ulong m41t00_get_rtc_time(void);
|
||||
extern int m41t00_set_rtc_time(ulong nowtime);
|
||||
|
||||
#endif /* _M41T00_H */
|
||||
+10
-10
@@ -3,17 +3,17 @@
|
||||
|
||||
#include <linux/mm.h>
|
||||
|
||||
typedef struct page *new_page_t(struct page *, unsigned long private, int **);
|
||||
|
||||
#ifdef CONFIG_MIGRATION
|
||||
extern int isolate_lru_page(struct page *p, struct list_head *pagelist);
|
||||
extern int putback_lru_pages(struct list_head *l);
|
||||
extern int migrate_page(struct page *, struct page *);
|
||||
extern void migrate_page_copy(struct page *, struct page *);
|
||||
extern int migrate_page_remove_references(struct page *, struct page *, int);
|
||||
extern int migrate_pages(struct list_head *l, struct list_head *t,
|
||||
struct list_head *moved, struct list_head *failed);
|
||||
extern int migrate_pages_to(struct list_head *pagelist,
|
||||
struct vm_area_struct *vma, int dest);
|
||||
extern int fail_migrate_page(struct page *, struct page *);
|
||||
extern int migrate_page(struct address_space *,
|
||||
struct page *, struct page *);
|
||||
extern int migrate_pages(struct list_head *l, new_page_t x, unsigned long);
|
||||
|
||||
extern int fail_migrate_page(struct address_space *,
|
||||
struct page *, struct page *);
|
||||
|
||||
extern int migrate_prep(void);
|
||||
|
||||
@@ -22,8 +22,8 @@ extern int migrate_prep(void);
|
||||
static inline int isolate_lru_page(struct page *p, struct list_head *list)
|
||||
{ return -ENOSYS; }
|
||||
static inline int putback_lru_pages(struct list_head *l) { return 0; }
|
||||
static inline int migrate_pages(struct list_head *l, struct list_head *t,
|
||||
struct list_head *moved, struct list_head *failed) { return -ENOSYS; }
|
||||
static inline int migrate_pages(struct list_head *l, new_page_t x,
|
||||
unsigned long private) { return -ENOSYS; }
|
||||
|
||||
static inline int migrate_pages_to(struct list_head *pagelist,
|
||||
struct vm_area_struct *vma, int dest) { return 0; }
|
||||
|
||||
+9
-2
@@ -199,6 +199,10 @@ struct vm_operations_struct {
|
||||
void (*close)(struct vm_area_struct * area);
|
||||
struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type);
|
||||
int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock);
|
||||
|
||||
/* notification that a previously read-only page is about to become
|
||||
* writable, if an error is returned it will cause a SIGBUS */
|
||||
int (*page_mkwrite)(struct vm_area_struct *vma, struct page *page);
|
||||
#ifdef CONFIG_NUMA
|
||||
int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new);
|
||||
struct mempolicy *(*get_policy)(struct vm_area_struct *vma,
|
||||
@@ -465,10 +469,13 @@ static inline unsigned long page_zonenum(struct page *page)
|
||||
struct zone;
|
||||
extern struct zone *zone_table[];
|
||||
|
||||
static inline int page_zone_id(struct page *page)
|
||||
{
|
||||
return (page->flags >> ZONETABLE_PGSHIFT) & ZONETABLE_MASK;
|
||||
}
|
||||
static inline struct zone *page_zone(struct page *page)
|
||||
{
|
||||
return zone_table[(page->flags >> ZONETABLE_PGSHIFT) &
|
||||
ZONETABLE_MASK];
|
||||
return zone_table[page_zone_id(page)];
|
||||
}
|
||||
|
||||
static inline unsigned long page_to_nid(struct page *page)
|
||||
|
||||
+10
-2
@@ -197,7 +197,7 @@ struct zone {
|
||||
|
||||
/*
|
||||
* wait_table -- the array holding the hash table
|
||||
* wait_table_size -- the size of the hash table array
|
||||
* wait_table_hash_nr_entries -- the size of the hash table array
|
||||
* wait_table_bits -- wait_table_size == (1 << wait_table_bits)
|
||||
*
|
||||
* The purpose of all these is to keep track of the people
|
||||
@@ -220,7 +220,7 @@ struct zone {
|
||||
* free_area_init_core() performs the initialization of them.
|
||||
*/
|
||||
wait_queue_head_t * wait_table;
|
||||
unsigned long wait_table_size;
|
||||
unsigned long wait_table_hash_nr_entries;
|
||||
unsigned long wait_table_bits;
|
||||
|
||||
/*
|
||||
@@ -333,6 +333,9 @@ void wakeup_kswapd(struct zone *zone, int order);
|
||||
int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
|
||||
int classzone_idx, int alloc_flags);
|
||||
|
||||
extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn,
|
||||
unsigned long size);
|
||||
|
||||
#ifdef CONFIG_HAVE_MEMORY_PRESENT
|
||||
void memory_present(int nid, unsigned long start, unsigned long end);
|
||||
#else
|
||||
@@ -506,6 +509,10 @@ struct mem_section {
|
||||
* pages. However, it is stored with some other magic.
|
||||
* (see sparse.c::sparse_init_one_section())
|
||||
*
|
||||
* Additionally during early boot we encode node id of
|
||||
* the location of the section here to guide allocation.
|
||||
* (see sparse.c::memory_present())
|
||||
*
|
||||
* Making it a UL at least makes someone do a cast
|
||||
* before using it wrong.
|
||||
*/
|
||||
@@ -545,6 +552,7 @@ extern int __section_nr(struct mem_section* ms);
|
||||
#define SECTION_HAS_MEM_MAP (1UL<<1)
|
||||
#define SECTION_MAP_LAST_BIT (1UL<<2)
|
||||
#define SECTION_MAP_MASK (~(SECTION_MAP_LAST_BIT-1))
|
||||
#define SECTION_NID_SHIFT 2
|
||||
|
||||
static inline struct page *__section_mem_map_addr(struct mem_section *section)
|
||||
{
|
||||
|
||||
@@ -105,6 +105,8 @@ extern struct module __this_module;
|
||||
* "GPL and additional rights" [GNU Public License v2 rights and more]
|
||||
* "Dual BSD/GPL" [GNU Public License v2
|
||||
* or BSD license choice]
|
||||
* "Dual MIT/GPL" [GNU Public License v2
|
||||
* or MIT license choice]
|
||||
* "Dual MPL/GPL" [GNU Public License v2
|
||||
* or Mozilla license choice]
|
||||
*
|
||||
|
||||
@@ -17,6 +17,11 @@
|
||||
#include <linux/spinlock.h>
|
||||
#include <asm/atomic.h>
|
||||
|
||||
struct super_block;
|
||||
struct vfsmount;
|
||||
struct dentry;
|
||||
struct namespace;
|
||||
|
||||
#define MNT_NOSUID 0x01
|
||||
#define MNT_NODEV 0x02
|
||||
#define MNT_NOEXEC 0x04
|
||||
|
||||
@@ -308,9 +308,13 @@ struct net_device
|
||||
#define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */
|
||||
#define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */
|
||||
#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */
|
||||
#define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */
|
||||
#define NETIF_F_GSO 2048 /* Enable software GSO. */
|
||||
#define NETIF_F_LLTX 4096 /* LockLess TX */
|
||||
#define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/
|
||||
|
||||
/* Segmentation offload features */
|
||||
#define NETIF_F_GSO_SHIFT 16
|
||||
#define NETIF_F_TSO (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT)
|
||||
#define NETIF_F_UFO (SKB_GSO_UDPV4 << NETIF_F_GSO_SHIFT)
|
||||
|
||||
#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
|
||||
#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
|
||||
@@ -402,6 +406,9 @@ struct net_device
|
||||
struct list_head qdisc_list;
|
||||
unsigned long tx_queue_len; /* Max frames per queue allowed */
|
||||
|
||||
/* Partially transmitted GSO packet. */
|
||||
struct sk_buff *gso_skb;
|
||||
|
||||
/* ingress path synchronizer */
|
||||
spinlock_t ingress_lock;
|
||||
struct Qdisc *qdisc_ingress;
|
||||
@@ -536,6 +543,7 @@ struct packet_type {
|
||||
struct net_device *,
|
||||
struct packet_type *,
|
||||
struct net_device *);
|
||||
struct sk_buff *(*gso_segment)(struct sk_buff *skb, int sg);
|
||||
void *af_packet_priv;
|
||||
struct list_head list;
|
||||
};
|
||||
@@ -686,7 +694,8 @@ extern int dev_change_name(struct net_device *, char *);
|
||||
extern int dev_set_mtu(struct net_device *, int);
|
||||
extern int dev_set_mac_address(struct net_device *,
|
||||
struct sockaddr *);
|
||||
extern void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev);
|
||||
extern int dev_hard_start_xmit(struct sk_buff *skb,
|
||||
struct net_device *dev);
|
||||
|
||||
extern void dev_init(void);
|
||||
|
||||
@@ -960,6 +969,7 @@ extern int netdev_max_backlog;
|
||||
extern int weight_p;
|
||||
extern int netdev_set_master(struct net_device *dev, struct net_device *master);
|
||||
extern int skb_checksum_help(struct sk_buff *skb, int inward);
|
||||
extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int sg);
|
||||
#ifdef CONFIG_BUG
|
||||
extern void netdev_rx_csum_fault(struct net_device *dev);
|
||||
#else
|
||||
@@ -979,6 +989,13 @@ extern void dev_seq_stop(struct seq_file *seq, void *v);
|
||||
|
||||
extern void linkwatch_run_queue(void);
|
||||
|
||||
static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
|
||||
{
|
||||
int feature = skb_shinfo(skb)->gso_type << NETIF_F_GSO_SHIFT;
|
||||
return skb_shinfo(skb)->gso_size &&
|
||||
(dev->features & feature) != feature;
|
||||
}
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _LINUX_DEV_H */
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <linux/types.h>
|
||||
|
||||
#define NETLINK_ROUTE 0 /* Routing/device hook */
|
||||
#define NETLINK_W1 1 /* 1-wire subsystem */
|
||||
#define NETLINK_UNUSED 1 /* Unused number */
|
||||
#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */
|
||||
#define NETLINK_FIREWALL 3 /* Firewalling hook */
|
||||
#define NETLINK_INET_DIAG 4 /* INET socket monitoring */
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/cache.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include <asm/pgtable.h>
|
||||
|
||||
/*
|
||||
@@ -88,7 +90,17 @@
|
||||
#define PG_nosave_free 18 /* Free, should not be written */
|
||||
#define PG_buddy 19 /* Page is free, on buddy lists */
|
||||
|
||||
#define PG_uncached 20 /* Page has been mapped as uncached */
|
||||
|
||||
#if (BITS_PER_LONG > 32)
|
||||
/*
|
||||
* 64-bit-only flags build down from bit 31
|
||||
*
|
||||
* 32 bit -------------------------------| FIELDS | FLAGS |
|
||||
* 64 bit | FIELDS | ?????? FLAGS |
|
||||
* 63 32 0
|
||||
*/
|
||||
#define PG_uncached 31 /* Page has been mapped as uncached */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Global page accounting. One instance per CPU. Only unsigned longs are
|
||||
|
||||
@@ -99,6 +99,13 @@ extern struct page * read_cache_page(struct address_space *mapping,
|
||||
extern int read_cache_pages(struct address_space *mapping,
|
||||
struct list_head *pages, filler_t *filler, void *data);
|
||||
|
||||
static inline struct page *read_mapping_page(struct address_space *mapping,
|
||||
unsigned long index, void *data)
|
||||
{
|
||||
filler_t *filler = (filler_t *)mapping->a_ops->readpage;
|
||||
return read_cache_page(mapping, index, filler, data);
|
||||
}
|
||||
|
||||
int add_to_page_cache(struct page *page, struct address_space *mapping,
|
||||
unsigned long index, gfp_t gfp_mask);
|
||||
int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
|
||||
|
||||
@@ -162,6 +162,9 @@ struct pci_dev {
|
||||
unsigned int is_busmaster:1; /* device is busmaster */
|
||||
unsigned int no_msi:1; /* device may not use msi */
|
||||
unsigned int block_ucfg_access:1; /* userspace config space access is blocked */
|
||||
unsigned int broken_parity_status:1; /* Device generates false positive parity */
|
||||
unsigned int msi_enabled:1;
|
||||
unsigned int msix_enabled:1;
|
||||
|
||||
u32 saved_config_space[16]; /* config space saved at suspend time */
|
||||
struct hlist_head saved_cap_space;
|
||||
@@ -496,6 +499,7 @@ int pci_set_dma_mask(struct pci_dev *dev, u64 mask);
|
||||
int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask);
|
||||
void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno);
|
||||
int pci_assign_resource(struct pci_dev *dev, int i);
|
||||
int pci_assign_resource_fixed(struct pci_dev *dev, int i);
|
||||
void pci_restore_bars(struct pci_dev *dev);
|
||||
|
||||
/* ROM control related routines */
|
||||
|
||||
@@ -352,8 +352,11 @@
|
||||
#define PCI_DEVICE_ID_ATI_RS480 0x5950
|
||||
/* ATI IXP Chipset */
|
||||
#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349
|
||||
#define PCI_DEVICE_ID_ATI_IXP200_SMBUS 0x4353
|
||||
#define PCI_DEVICE_ID_ATI_IXP300_SMBUS 0x4363
|
||||
#define PCI_DEVICE_ID_ATI_IXP300_IDE 0x4369
|
||||
#define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e
|
||||
#define PCI_DEVICE_ID_ATI_IXP400_SMBUS 0x4372
|
||||
#define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376
|
||||
#define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379
|
||||
#define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a
|
||||
@@ -848,7 +851,12 @@
|
||||
|
||||
|
||||
#define PCI_VENDOR_ID_QLOGIC 0x1077
|
||||
#define PCI_DEVICE_ID_QLOGIC_ISP10160 0x1016
|
||||
#define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020
|
||||
#define PCI_DEVICE_ID_QLOGIC_ISP1080 0x1080
|
||||
#define PCI_DEVICE_ID_QLOGIC_ISP12160 0x1216
|
||||
#define PCI_DEVICE_ID_QLOGIC_ISP1240 0x1240
|
||||
#define PCI_DEVICE_ID_QLOGIC_ISP1280 0x1280
|
||||
#define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100
|
||||
#define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200
|
||||
#define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300
|
||||
@@ -1018,6 +1026,7 @@
|
||||
#define PCI_DEVICE_ID_NVIDIA_NVENET_8 0x0056
|
||||
#define PCI_DEVICE_ID_NVIDIA_NVENET_9 0x0057
|
||||
#define PCI_DEVICE_ID_NVIDIA_CK804_AUDIO 0x0059
|
||||
#define PCI_DEVICE_ID_NVIDIA_CK804_PCIE 0x005d
|
||||
#define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064
|
||||
#define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE 0x0065
|
||||
#define PCI_DEVICE_ID_NVIDIA_NVENET_2 0x0066
|
||||
@@ -1127,9 +1136,11 @@
|
||||
#define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258
|
||||
#define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259
|
||||
#define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B
|
||||
#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SMBUS 0x0264
|
||||
#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265
|
||||
#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266
|
||||
#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267
|
||||
#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SMBUS 0x0368
|
||||
#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E
|
||||
#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x037E
|
||||
#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F
|
||||
@@ -1946,6 +1957,7 @@
|
||||
|
||||
#define PCI_VENDOR_ID_MELLANOX 0x15b3
|
||||
#define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44
|
||||
#define PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE 0x5a46
|
||||
#define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278
|
||||
#define PCI_DEVICE_ID_MELLANOX_ARBEL 0x6282
|
||||
#define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c
|
||||
@@ -1969,6 +1981,9 @@
|
||||
#define PCI_VENDOR_ID_NETCELL 0x169c
|
||||
#define PCI_DEVICE_ID_REVOLUTION 0x0044
|
||||
|
||||
#define PCI_VENDOR_ID_VITESSE 0x1725
|
||||
#define PCI_DEVICE_ID_VITESSE_VSC7174 0x7174
|
||||
|
||||
#define PCI_VENDOR_ID_LINKSYS 0x1737
|
||||
#define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064
|
||||
|
||||
@@ -2148,6 +2163,7 @@
|
||||
#define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815
|
||||
#define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e
|
||||
#define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850
|
||||
#define PCI_DEVICE_ID_INTEL_GD31244 0x3200
|
||||
#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340
|
||||
#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575
|
||||
#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577
|
||||
|
||||
@@ -197,6 +197,7 @@
|
||||
#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */
|
||||
#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */
|
||||
#define PCI_CAP_ID_HT_IRQCONF 0x08 /* HyperTransport IRQ Configuration */
|
||||
#define PCI_CAP_ID_VNDR 0x09 /* Vendor specific capability */
|
||||
#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */
|
||||
#define PCI_CAP_ID_EXP 0x10 /* PCI Express */
|
||||
#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */
|
||||
|
||||
@@ -10,13 +10,14 @@
|
||||
#include <linux/smp.h>
|
||||
#include <linux/threads.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
|
||||
struct percpu_counter {
|
||||
spinlock_t lock;
|
||||
long count;
|
||||
long *counters;
|
||||
s64 count;
|
||||
s32 *counters;
|
||||
};
|
||||
|
||||
#if NR_CPUS >= 16
|
||||
@@ -25,11 +26,11 @@ struct percpu_counter {
|
||||
#define FBC_BATCH (NR_CPUS*4)
|
||||
#endif
|
||||
|
||||
static inline void percpu_counter_init(struct percpu_counter *fbc)
|
||||
static inline void percpu_counter_init(struct percpu_counter *fbc, s64 amount)
|
||||
{
|
||||
spin_lock_init(&fbc->lock);
|
||||
fbc->count = 0;
|
||||
fbc->counters = alloc_percpu(long);
|
||||
fbc->count = amount;
|
||||
fbc->counters = alloc_percpu(s32);
|
||||
}
|
||||
|
||||
static inline void percpu_counter_destroy(struct percpu_counter *fbc)
|
||||
@@ -37,10 +38,10 @@ static inline void percpu_counter_destroy(struct percpu_counter *fbc)
|
||||
free_percpu(fbc->counters);
|
||||
}
|
||||
|
||||
void percpu_counter_mod(struct percpu_counter *fbc, long amount);
|
||||
long percpu_counter_sum(struct percpu_counter *fbc);
|
||||
void percpu_counter_mod(struct percpu_counter *fbc, s32 amount);
|
||||
s64 percpu_counter_sum(struct percpu_counter *fbc);
|
||||
|
||||
static inline long percpu_counter_read(struct percpu_counter *fbc)
|
||||
static inline s64 percpu_counter_read(struct percpu_counter *fbc)
|
||||
{
|
||||
return fbc->count;
|
||||
}
|
||||
@@ -48,13 +49,14 @@ static inline long percpu_counter_read(struct percpu_counter *fbc)
|
||||
/*
|
||||
* It is possible for the percpu_counter_read() to return a small negative
|
||||
* number for some counter which should never be negative.
|
||||
*
|
||||
*/
|
||||
static inline long percpu_counter_read_positive(struct percpu_counter *fbc)
|
||||
static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc)
|
||||
{
|
||||
long ret = fbc->count;
|
||||
s64 ret = fbc->count;
|
||||
|
||||
barrier(); /* Prevent reloads of fbc->count */
|
||||
if (ret > 0)
|
||||
if (ret >= 0)
|
||||
return ret;
|
||||
return 1;
|
||||
}
|
||||
@@ -62,12 +64,12 @@ static inline long percpu_counter_read_positive(struct percpu_counter *fbc)
|
||||
#else
|
||||
|
||||
struct percpu_counter {
|
||||
long count;
|
||||
s64 count;
|
||||
};
|
||||
|
||||
static inline void percpu_counter_init(struct percpu_counter *fbc)
|
||||
static inline void percpu_counter_init(struct percpu_counter *fbc, s64 amount)
|
||||
{
|
||||
fbc->count = 0;
|
||||
fbc->count = amount;
|
||||
}
|
||||
|
||||
static inline void percpu_counter_destroy(struct percpu_counter *fbc)
|
||||
@@ -75,24 +77,24 @@ static inline void percpu_counter_destroy(struct percpu_counter *fbc)
|
||||
}
|
||||
|
||||
static inline void
|
||||
percpu_counter_mod(struct percpu_counter *fbc, long amount)
|
||||
percpu_counter_mod(struct percpu_counter *fbc, s32 amount)
|
||||
{
|
||||
preempt_disable();
|
||||
fbc->count += amount;
|
||||
preempt_enable();
|
||||
}
|
||||
|
||||
static inline long percpu_counter_read(struct percpu_counter *fbc)
|
||||
static inline s64 percpu_counter_read(struct percpu_counter *fbc)
|
||||
{
|
||||
return fbc->count;
|
||||
}
|
||||
|
||||
static inline long percpu_counter_read_positive(struct percpu_counter *fbc)
|
||||
static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc)
|
||||
{
|
||||
return fbc->count;
|
||||
}
|
||||
|
||||
static inline long percpu_counter_sum(struct percpu_counter *fbc)
|
||||
static inline s64 percpu_counter_sum(struct percpu_counter *fbc)
|
||||
{
|
||||
return percpu_counter_read_positive(fbc);
|
||||
}
|
||||
|
||||
@@ -52,4 +52,11 @@
|
||||
#define PR_SET_NAME 15 /* Set process name */
|
||||
#define PR_GET_NAME 16 /* Get process name */
|
||||
|
||||
/* Get/set process endian */
|
||||
#define PR_GET_ENDIAN 19
|
||||
#define PR_SET_ENDIAN 20
|
||||
# define PR_ENDIAN_BIG 0
|
||||
# define PR_ENDIAN_LITTLE 1 /* True little endian mode */
|
||||
# define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */
|
||||
|
||||
#endif /* _LINUX_PRCTL_H */
|
||||
|
||||
@@ -51,6 +51,10 @@
|
||||
#ifdef __KERNEL__
|
||||
/*
|
||||
* Ptrace flags
|
||||
*
|
||||
* The owner ship rules for task->ptrace which holds the ptrace
|
||||
* flags is simple. When a task is running it owns it's task->ptrace
|
||||
* flags. When the a task is stopped the ptracer owns task->ptrace.
|
||||
*/
|
||||
|
||||
#define PT_PTRACED 0x00000001
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
#include <linux/preempt.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#define RADIX_TREE_MAX_TAGS 2
|
||||
|
||||
/* root tags are stored in gfp_mask, shifted by __GFP_BITS_SHIFT */
|
||||
struct radix_tree_root {
|
||||
unsigned int height;
|
||||
gfp_t gfp_mask;
|
||||
@@ -45,8 +48,6 @@ do { \
|
||||
(root)->rnode = NULL; \
|
||||
} while (0)
|
||||
|
||||
#define RADIX_TREE_MAX_TAGS 2
|
||||
|
||||
int radix_tree_insert(struct radix_tree_root *, unsigned long, void *);
|
||||
void *radix_tree_lookup(struct radix_tree_root *, unsigned long);
|
||||
void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long);
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#define _LINUX_RAMFS_H
|
||||
|
||||
struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev);
|
||||
struct super_block *ramfs_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data);
|
||||
extern int ramfs_get_sb(struct file_system_type *fs_type,
|
||||
int flags, const char *dev_name, void *data, struct vfsmount *mnt);
|
||||
|
||||
#ifndef CONFIG_MMU
|
||||
extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file,
|
||||
|
||||
@@ -132,6 +132,10 @@ static inline void rb_set_color(struct rb_node *rb, int color)
|
||||
#define RB_ROOT (struct rb_root) { NULL, }
|
||||
#define rb_entry(ptr, type, member) container_of(ptr, type, member)
|
||||
|
||||
#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL)
|
||||
#define RB_EMPTY_NODE(node) (rb_parent(node) != node)
|
||||
#define RB_CLEAR_NODE(node) (rb_set_parent(node, node))
|
||||
|
||||
extern void rb_insert_color(struct rb_node *, struct rb_root *);
|
||||
extern void rb_erase(struct rb_node *, struct rb_root *);
|
||||
|
||||
|
||||
@@ -246,7 +246,7 @@ extern int rcu_needs_cpu(int cpu);
|
||||
* softirq handlers will have completed, since in some kernels, these
|
||||
* handlers can run in process context, and can block.
|
||||
*
|
||||
* This primitive provides the guarantees made by the (deprecated)
|
||||
* This primitive provides the guarantees made by the (now removed)
|
||||
* synchronize_kernel() API. In contrast, synchronize_rcu() only
|
||||
* guarantees that rcu_read_lock() sections will have completed.
|
||||
* In "classic RCU", these two guarantees happen to be one and
|
||||
@@ -264,7 +264,6 @@ extern void FASTCALL(call_rcu(struct rcu_head *head,
|
||||
void (*func)(struct rcu_head *head)));
|
||||
extern void FASTCALL(call_rcu_bh(struct rcu_head *head,
|
||||
void (*func)(struct rcu_head *head)));
|
||||
extern __deprecated_for_modules void synchronize_kernel(void);
|
||||
extern void synchronize_rcu(void);
|
||||
void synchronize_idle(void);
|
||||
extern void rcu_barrier(void);
|
||||
|
||||
@@ -91,7 +91,6 @@ static inline void page_dup_rmap(struct page *page)
|
||||
*/
|
||||
int page_referenced(struct page *, int is_locked);
|
||||
int try_to_unmap(struct page *, int ignore_refs);
|
||||
void remove_from_swap(struct page *page);
|
||||
|
||||
/*
|
||||
* Called from mm/filemap_xip.c to unmap empty zero page
|
||||
|
||||
@@ -941,12 +941,11 @@ static inline void put_task_struct(struct task_struct *t)
|
||||
#define PF_KSWAPD 0x00040000 /* I am kswapd */
|
||||
#define PF_SWAPOFF 0x00080000 /* I am in swapoff */
|
||||
#define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */
|
||||
#define PF_SYNCWRITE 0x00200000 /* I am doing a sync write */
|
||||
#define PF_BORROWED_MM 0x00400000 /* I am a kthread doing use_mm */
|
||||
#define PF_RANDOMIZE 0x00800000 /* randomize virtual address space */
|
||||
#define PF_SWAPWRITE 0x01000000 /* Allowed to write to swap */
|
||||
#define PF_SPREAD_PAGE 0x04000000 /* Spread page cache over cpuset */
|
||||
#define PF_SPREAD_SLAB 0x08000000 /* Spread some slab caches over cpuset */
|
||||
#define PF_BORROWED_MM 0x00200000 /* I am a kthread doing use_mm */
|
||||
#define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */
|
||||
#define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */
|
||||
#define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */
|
||||
#define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */
|
||||
#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */
|
||||
|
||||
/*
|
||||
@@ -1225,7 +1224,7 @@ static inline int thread_group_empty(task_t *p)
|
||||
(thread_group_leader(p) && !thread_group_empty(p))
|
||||
|
||||
/*
|
||||
* Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring
|
||||
* Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring
|
||||
* subscriptions and synchronises with wait4(). Also used in procfs. Also
|
||||
* pins the final release of task.io_context. Also protects ->cpuset.
|
||||
*
|
||||
|
||||
+44
-11
@@ -171,9 +171,9 @@ struct swap_info_struct;
|
||||
* Deallocate and clear the sb->s_security field.
|
||||
* @sb contains the super_block structure to be modified.
|
||||
* @sb_statfs:
|
||||
* Check permission before obtaining filesystem statistics for the @sb
|
||||
* filesystem.
|
||||
* @sb contains the super_block structure for the filesystem.
|
||||
* Check permission before obtaining filesystem statistics for the @mnt
|
||||
* mountpoint.
|
||||
* @dentry is a handle on the superblock for the filesystem.
|
||||
* Return 0 if permission is granted.
|
||||
* @sb_mount:
|
||||
* Check permission before an object specified by @dev_name is mounted on
|
||||
@@ -577,6 +577,11 @@ struct swap_info_struct;
|
||||
* @p contains the task_struct of process.
|
||||
* @nice contains the new nice value.
|
||||
* Return 0 if permission is granted.
|
||||
* @task_setioprio
|
||||
* Check permission before setting the ioprio value of @p to @ioprio.
|
||||
* @p contains the task_struct of process.
|
||||
* @ioprio contains the new ioprio value
|
||||
* Return 0 if permission is granted.
|
||||
* @task_setrlimit:
|
||||
* Check permission before setting the resource limits of the current
|
||||
* process for @resource to @new_rlim. The old resource limit values can
|
||||
@@ -596,6 +601,10 @@ struct swap_info_struct;
|
||||
* @p.
|
||||
* @p contains the task_struct for process.
|
||||
* Return 0 if permission is granted.
|
||||
* @task_movememory
|
||||
* Check permission before moving memory owned by process @p.
|
||||
* @p contains the task_struct for process.
|
||||
* Return 0 if permission is granted.
|
||||
* @task_kill:
|
||||
* Check permission before sending signal @sig to @p. @info can be NULL,
|
||||
* the constant 1, or a pointer to a siginfo structure. If @info is 1 or
|
||||
@@ -1127,7 +1136,7 @@ struct security_operations {
|
||||
int (*sb_copy_data)(struct file_system_type *type,
|
||||
void *orig, void *copy);
|
||||
int (*sb_kern_mount) (struct super_block *sb, void *data);
|
||||
int (*sb_statfs) (struct super_block * sb);
|
||||
int (*sb_statfs) (struct dentry *dentry);
|
||||
int (*sb_mount) (char *dev_name, struct nameidata * nd,
|
||||
char *type, unsigned long flags, void *data);
|
||||
int (*sb_check_sb) (struct vfsmount * mnt, struct nameidata * nd);
|
||||
@@ -1210,10 +1219,12 @@ struct security_operations {
|
||||
int (*task_getsid) (struct task_struct * p);
|
||||
int (*task_setgroups) (struct group_info *group_info);
|
||||
int (*task_setnice) (struct task_struct * p, int nice);
|
||||
int (*task_setioprio) (struct task_struct * p, int ioprio);
|
||||
int (*task_setrlimit) (unsigned int resource, struct rlimit * new_rlim);
|
||||
int (*task_setscheduler) (struct task_struct * p, int policy,
|
||||
struct sched_param * lp);
|
||||
int (*task_getscheduler) (struct task_struct * p);
|
||||
int (*task_movememory) (struct task_struct * p);
|
||||
int (*task_kill) (struct task_struct * p,
|
||||
struct siginfo * info, int sig);
|
||||
int (*task_wait) (struct task_struct * p);
|
||||
@@ -1313,7 +1324,7 @@ struct security_operations {
|
||||
|
||||
/* key management security hooks */
|
||||
#ifdef CONFIG_KEYS
|
||||
int (*key_alloc)(struct key *key);
|
||||
int (*key_alloc)(struct key *key, struct task_struct *tsk);
|
||||
void (*key_free)(struct key *key);
|
||||
int (*key_permission)(key_ref_t key_ref,
|
||||
struct task_struct *context,
|
||||
@@ -1450,9 +1461,9 @@ static inline int security_sb_kern_mount (struct super_block *sb, void *data)
|
||||
return security_ops->sb_kern_mount (sb, data);
|
||||
}
|
||||
|
||||
static inline int security_sb_statfs (struct super_block *sb)
|
||||
static inline int security_sb_statfs (struct dentry *dentry)
|
||||
{
|
||||
return security_ops->sb_statfs (sb);
|
||||
return security_ops->sb_statfs (dentry);
|
||||
}
|
||||
|
||||
static inline int security_sb_mount (char *dev_name, struct nameidata *nd,
|
||||
@@ -1836,6 +1847,11 @@ static inline int security_task_setnice (struct task_struct *p, int nice)
|
||||
return security_ops->task_setnice (p, nice);
|
||||
}
|
||||
|
||||
static inline int security_task_setioprio (struct task_struct *p, int ioprio)
|
||||
{
|
||||
return security_ops->task_setioprio (p, ioprio);
|
||||
}
|
||||
|
||||
static inline int security_task_setrlimit (unsigned int resource,
|
||||
struct rlimit *new_rlim)
|
||||
{
|
||||
@@ -1854,6 +1870,11 @@ static inline int security_task_getscheduler (struct task_struct *p)
|
||||
return security_ops->task_getscheduler (p);
|
||||
}
|
||||
|
||||
static inline int security_task_movememory (struct task_struct *p)
|
||||
{
|
||||
return security_ops->task_movememory (p);
|
||||
}
|
||||
|
||||
static inline int security_task_kill (struct task_struct *p,
|
||||
struct siginfo *info, int sig)
|
||||
{
|
||||
@@ -2162,7 +2183,7 @@ static inline int security_sb_kern_mount (struct super_block *sb, void *data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int security_sb_statfs (struct super_block *sb)
|
||||
static inline int security_sb_statfs (struct dentry *dentry)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -2478,6 +2499,11 @@ static inline int security_task_setnice (struct task_struct *p, int nice)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int security_task_setioprio (struct task_struct *p, int ioprio)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int security_task_setrlimit (unsigned int resource,
|
||||
struct rlimit *new_rlim)
|
||||
{
|
||||
@@ -2496,6 +2522,11 @@ static inline int security_task_getscheduler (struct task_struct *p)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int security_task_movememory (struct task_struct *p)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int security_task_kill (struct task_struct *p,
|
||||
struct siginfo *info, int sig)
|
||||
{
|
||||
@@ -3008,9 +3039,10 @@ static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid
|
||||
|
||||
#ifdef CONFIG_KEYS
|
||||
#ifdef CONFIG_SECURITY
|
||||
static inline int security_key_alloc(struct key *key)
|
||||
static inline int security_key_alloc(struct key *key,
|
||||
struct task_struct *tsk)
|
||||
{
|
||||
return security_ops->key_alloc(key);
|
||||
return security_ops->key_alloc(key, tsk);
|
||||
}
|
||||
|
||||
static inline void security_key_free(struct key *key)
|
||||
@@ -3027,7 +3059,8 @@ static inline int security_key_permission(key_ref_t key_ref,
|
||||
|
||||
#else
|
||||
|
||||
static inline int security_key_alloc(struct key *key)
|
||||
static inline int security_key_alloc(struct key *key,
|
||||
struct task_struct *tsk)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
+17
-9
@@ -134,9 +134,10 @@ struct skb_frag_struct {
|
||||
struct skb_shared_info {
|
||||
atomic_t dataref;
|
||||
unsigned short nr_frags;
|
||||
unsigned short tso_size;
|
||||
unsigned short tso_segs;
|
||||
unsigned short ufo_size;
|
||||
unsigned short gso_size;
|
||||
/* Warning: this field is not always filled in (UFO)! */
|
||||
unsigned short gso_segs;
|
||||
unsigned short gso_type;
|
||||
unsigned int ip6_frag_id;
|
||||
struct sk_buff *frag_list;
|
||||
skb_frag_t frags[MAX_SKB_FRAGS];
|
||||
@@ -168,6 +169,11 @@ enum {
|
||||
SKB_FCLONE_CLONE,
|
||||
};
|
||||
|
||||
enum {
|
||||
SKB_GSO_TCPV4 = 1 << 0,
|
||||
SKB_GSO_UDPV4 = 1 << 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct sk_buff - socket buffer
|
||||
* @next: Next buffer in list
|
||||
@@ -209,6 +215,8 @@ enum {
|
||||
* @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
|
||||
* @tc_index: Traffic control index
|
||||
* @tc_verd: traffic control verdict
|
||||
* @dma_cookie: a cookie to one of several possible DMA operations
|
||||
* done by skb DMA functions
|
||||
* @secmark: security marking
|
||||
*/
|
||||
|
||||
@@ -345,7 +353,7 @@ extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb,
|
||||
extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
|
||||
int newheadroom, int newtailroom,
|
||||
gfp_t priority);
|
||||
extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad);
|
||||
extern int skb_pad(struct sk_buff *skb, int pad);
|
||||
#define dev_kfree_skb(a) kfree_skb(a)
|
||||
extern void skb_over_panic(struct sk_buff *skb, int len,
|
||||
void *here);
|
||||
@@ -1122,16 +1130,15 @@ static inline int skb_cow(struct sk_buff *skb, unsigned int headroom)
|
||||
*
|
||||
* Pads up a buffer to ensure the trailing bytes exist and are
|
||||
* blanked. If the buffer already contains sufficient data it
|
||||
* is untouched. Returns the buffer, which may be a replacement
|
||||
* for the original, or NULL for out of memory - in which case
|
||||
* the original buffer is still freed.
|
||||
* is untouched. Otherwise it is extended. Returns zero on
|
||||
* success. The skb is freed on error.
|
||||
*/
|
||||
|
||||
static inline struct sk_buff *skb_padto(struct sk_buff *skb, unsigned int len)
|
||||
static inline int skb_padto(struct sk_buff *skb, unsigned int len)
|
||||
{
|
||||
unsigned int size = skb->len;
|
||||
if (likely(size >= len))
|
||||
return skb;
|
||||
return 0;
|
||||
return skb_pad(skb, len-size);
|
||||
}
|
||||
|
||||
@@ -1292,6 +1299,7 @@ extern void skb_split(struct sk_buff *skb,
|
||||
struct sk_buff *skb1, const u32 len);
|
||||
|
||||
extern void skb_release_data(struct sk_buff *skb);
|
||||
extern struct sk_buff *skb_segment(struct sk_buff *skb, int sg);
|
||||
|
||||
static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
|
||||
int len, void *buffer)
|
||||
|
||||
@@ -86,6 +86,51 @@ extern void *__kmalloc_track_caller(size_t, gfp_t, void*);
|
||||
__kmalloc_track_caller(size, flags, __builtin_return_address(0))
|
||||
#endif
|
||||
|
||||
/**
|
||||
* kmalloc - allocate memory
|
||||
* @size: how many bytes of memory are required.
|
||||
* @flags: the type of memory to allocate.
|
||||
*
|
||||
* kmalloc is the normal method of allocating memory
|
||||
* in the kernel.
|
||||
*
|
||||
* The @flags argument may be one of:
|
||||
*
|
||||
* %GFP_USER - Allocate memory on behalf of user. May sleep.
|
||||
*
|
||||
* %GFP_KERNEL - Allocate normal kernel ram. May sleep.
|
||||
*
|
||||
* %GFP_ATOMIC - Allocation will not sleep.
|
||||
* For example, use this inside interrupt handlers.
|
||||
*
|
||||
* %GFP_HIGHUSER - Allocate pages from high memory.
|
||||
*
|
||||
* %GFP_NOIO - Do not do any I/O at all while trying to get memory.
|
||||
*
|
||||
* %GFP_NOFS - Do not make any fs calls while trying to get memory.
|
||||
*
|
||||
* Also it is possible to set different flags by OR'ing
|
||||
* in one or more of the following additional @flags:
|
||||
*
|
||||
* %__GFP_COLD - Request cache-cold pages instead of
|
||||
* trying to return cache-warm pages.
|
||||
*
|
||||
* %__GFP_DMA - Request memory from the DMA-capable zone.
|
||||
*
|
||||
* %__GFP_HIGH - This allocation has high priority and may use emergency pools.
|
||||
*
|
||||
* %__GFP_HIGHMEM - Allocated memory may be from highmem.
|
||||
*
|
||||
* %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail
|
||||
* (think twice before using).
|
||||
*
|
||||
* %__GFP_NORETRY - If memory is not immediately available,
|
||||
* then give up at once.
|
||||
*
|
||||
* %__GFP_NOWARN - If allocation fails, don't issue any warnings.
|
||||
*
|
||||
* %__GFP_REPEAT - If allocation fails initially, try once more before failing.
|
||||
*/
|
||||
static inline void *kmalloc(size_t size, gfp_t flags)
|
||||
{
|
||||
if (__builtin_constant_p(size)) {
|
||||
@@ -111,6 +156,11 @@ found:
|
||||
|
||||
extern void *__kzalloc(size_t, gfp_t);
|
||||
|
||||
/**
|
||||
* kzalloc - allocate memory. The memory is set to zero.
|
||||
* @size: how many bytes of memory are required.
|
||||
* @flags: the type of memory to allocate (see kmalloc).
|
||||
*/
|
||||
static inline void *kzalloc(size_t size, gfp_t flags)
|
||||
{
|
||||
if (__builtin_constant_p(size)) {
|
||||
|
||||
@@ -56,6 +56,7 @@ extern char * strnchr(const char *, size_t, int);
|
||||
#ifndef __HAVE_ARCH_STRRCHR
|
||||
extern char * strrchr(const char *,int);
|
||||
#endif
|
||||
extern char * strstrip(char *);
|
||||
#ifndef __HAVE_ARCH_STRSTR
|
||||
extern char * strstr(const char *,const char *);
|
||||
#endif
|
||||
|
||||
@@ -71,6 +71,7 @@ struct saved_context;
|
||||
void __save_processor_state(struct saved_context *ctxt);
|
||||
void __restore_processor_state(struct saved_context *ctxt);
|
||||
unsigned long get_safe_page(gfp_t gfp_mask);
|
||||
int swsusp_add_arch_pages(unsigned long start, unsigned long end);
|
||||
|
||||
/*
|
||||
* XXX: We try to keep some more pages free so that I/O operations succeed
|
||||
|
||||
+69
-32
@@ -28,7 +28,14 @@ static inline int current_is_kswapd(void)
|
||||
* the type/offset into the pte as 5/27 as well.
|
||||
*/
|
||||
#define MAX_SWAPFILES_SHIFT 5
|
||||
#ifndef CONFIG_MIGRATION
|
||||
#define MAX_SWAPFILES (1 << MAX_SWAPFILES_SHIFT)
|
||||
#else
|
||||
/* Use last two entries for page migration swap entries */
|
||||
#define MAX_SWAPFILES ((1 << MAX_SWAPFILES_SHIFT)-2)
|
||||
#define SWP_MIGRATION_READ MAX_SWAPFILES
|
||||
#define SWP_MIGRATION_WRITE (MAX_SWAPFILES + 1)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Magic header for a swap area. The first part of the union is
|
||||
@@ -48,12 +55,14 @@ union swap_header {
|
||||
char magic[10]; /* SWAP-SPACE or SWAPSPACE2 */
|
||||
} magic;
|
||||
struct {
|
||||
char bootbits[1024]; /* Space for disklabel etc. */
|
||||
unsigned int version;
|
||||
unsigned int last_page;
|
||||
unsigned int nr_badpages;
|
||||
unsigned int padding[125];
|
||||
unsigned int badpages[1];
|
||||
char bootbits[1024]; /* Space for disklabel etc. */
|
||||
__u32 version;
|
||||
__u32 last_page;
|
||||
__u32 nr_badpages;
|
||||
unsigned char sws_uuid[16];
|
||||
unsigned char sws_volume[16];
|
||||
__u32 padding[117];
|
||||
__u32 badpages[1];
|
||||
} info;
|
||||
};
|
||||
|
||||
@@ -176,20 +185,7 @@ extern unsigned long try_to_free_pages(struct zone **, gfp_t);
|
||||
extern unsigned long shrink_all_memory(unsigned long nr_pages);
|
||||
extern int vm_swappiness;
|
||||
extern int remove_mapping(struct address_space *mapping, struct page *page);
|
||||
|
||||
/* possible outcome of pageout() */
|
||||
typedef enum {
|
||||
/* failed to write page out, page is locked */
|
||||
PAGE_KEEP,
|
||||
/* move page to the active list, page is locked */
|
||||
PAGE_ACTIVATE,
|
||||
/* page has been sent to the disk successfully, page is unlocked */
|
||||
PAGE_SUCCESS,
|
||||
/* page is clean and locked */
|
||||
PAGE_CLEAN,
|
||||
} pageout_t;
|
||||
|
||||
extern pageout_t pageout(struct page *page, struct address_space *mapping);
|
||||
extern long vm_total_pages;
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
extern int zone_reclaim_mode;
|
||||
@@ -250,7 +246,6 @@ extern int remove_exclusive_swap_page(struct page *);
|
||||
struct backing_dev_info;
|
||||
|
||||
extern spinlock_t swap_lock;
|
||||
extern int remove_vma_swap(struct vm_area_struct *vma, struct page *page);
|
||||
|
||||
/* linux/mm/thrash.c */
|
||||
extern struct mm_struct * swap_token_mm;
|
||||
@@ -288,18 +283,60 @@ static inline void disable_swap_token(void)
|
||||
#define free_pages_and_swap_cache(pages, nr) \
|
||||
release_pages((pages), (nr), 0);
|
||||
|
||||
#define show_swap_cache_info() /*NOTHING*/
|
||||
#define free_swap_and_cache(swp) /*NOTHING*/
|
||||
#define swap_duplicate(swp) /*NOTHING*/
|
||||
#define swap_free(swp) /*NOTHING*/
|
||||
#define read_swap_cache_async(swp,vma,addr) NULL
|
||||
#define lookup_swap_cache(swp) NULL
|
||||
#define valid_swaphandles(swp, off) 0
|
||||
static inline void show_swap_cache_info(void)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void free_swap_and_cache(swp_entry_t swp)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int swap_duplicate(swp_entry_t swp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void swap_free(swp_entry_t swp)
|
||||
{
|
||||
}
|
||||
|
||||
static inline struct page *read_swap_cache_async(swp_entry_t swp,
|
||||
struct vm_area_struct *vma, unsigned long addr)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline struct page *lookup_swap_cache(swp_entry_t swp)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline int valid_swaphandles(swp_entry_t entry, unsigned long *offset)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define can_share_swap_page(p) (page_mapcount(p) == 1)
|
||||
#define move_to_swap_cache(p, swp) 1
|
||||
#define move_from_swap_cache(p, i, m) 1
|
||||
#define __delete_from_swap_cache(p) /*NOTHING*/
|
||||
#define delete_from_swap_cache(p) /*NOTHING*/
|
||||
|
||||
static inline int move_to_swap_cache(struct page *page, swp_entry_t entry)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int move_from_swap_cache(struct page *page, unsigned long index,
|
||||
struct address_space *mapping)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline void __delete_from_swap_cache(struct page *page)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void delete_from_swap_cache(struct page *page)
|
||||
{
|
||||
}
|
||||
|
||||
#define swap_token_default_timeout 0
|
||||
|
||||
static inline int remove_exclusive_swap_page(struct page *p)
|
||||
|
||||
@@ -67,3 +67,56 @@ static inline pte_t swp_entry_to_pte(swp_entry_t entry)
|
||||
BUG_ON(pte_file(__swp_entry_to_pte(arch_entry)));
|
||||
return __swp_entry_to_pte(arch_entry);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MIGRATION
|
||||
static inline swp_entry_t make_migration_entry(struct page *page, int write)
|
||||
{
|
||||
BUG_ON(!PageLocked(page));
|
||||
return swp_entry(write ? SWP_MIGRATION_WRITE : SWP_MIGRATION_READ,
|
||||
page_to_pfn(page));
|
||||
}
|
||||
|
||||
static inline int is_migration_entry(swp_entry_t entry)
|
||||
{
|
||||
return unlikely(swp_type(entry) == SWP_MIGRATION_READ ||
|
||||
swp_type(entry) == SWP_MIGRATION_WRITE);
|
||||
}
|
||||
|
||||
static inline int is_write_migration_entry(swp_entry_t entry)
|
||||
{
|
||||
return unlikely(swp_type(entry) == SWP_MIGRATION_WRITE);
|
||||
}
|
||||
|
||||
static inline struct page *migration_entry_to_page(swp_entry_t entry)
|
||||
{
|
||||
struct page *p = pfn_to_page(swp_offset(entry));
|
||||
/*
|
||||
* Any use of migration entries may only occur while the
|
||||
* corresponding page is locked
|
||||
*/
|
||||
BUG_ON(!PageLocked(p));
|
||||
return p;
|
||||
}
|
||||
|
||||
static inline void make_migration_entry_read(swp_entry_t *entry)
|
||||
{
|
||||
*entry = swp_entry(SWP_MIGRATION_READ, swp_offset(*entry));
|
||||
}
|
||||
|
||||
extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd,
|
||||
unsigned long address);
|
||||
#else
|
||||
|
||||
#define make_migration_entry(page, write) swp_entry(0, 0)
|
||||
#define is_migration_entry(swp) 0
|
||||
#define migration_entry_to_page(swp) NULL
|
||||
static inline void make_migration_entry_read(swp_entry_t *entryp) { }
|
||||
static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd,
|
||||
unsigned long address) { }
|
||||
static inline int is_write_migration_entry(swp_entry_t entry)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -516,6 +516,16 @@ asmlinkage long sys_set_mempolicy(int mode, unsigned long __user *nmask,
|
||||
asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode,
|
||||
const unsigned long __user *from,
|
||||
const unsigned long __user *to);
|
||||
asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages,
|
||||
const void __user * __user *pages,
|
||||
const int __user *nodes,
|
||||
int __user *status,
|
||||
int flags);
|
||||
asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page,
|
||||
__u32 __user *pages,
|
||||
const int __user *nodes,
|
||||
int __user *status,
|
||||
int flags);
|
||||
asmlinkage long sys_mbind(unsigned long start, unsigned long len,
|
||||
unsigned long mode,
|
||||
unsigned long __user *nmask,
|
||||
|
||||
@@ -186,6 +186,7 @@ enum
|
||||
VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */
|
||||
VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */
|
||||
VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */
|
||||
VM_PANIC_ON_OOM=33, /* panic at out-of-memory */
|
||||
};
|
||||
|
||||
|
||||
|
||||
+17
-1
@@ -37,11 +37,27 @@ struct sysdev_class {
|
||||
struct kset kset;
|
||||
};
|
||||
|
||||
struct sysdev_class_attribute {
|
||||
struct attribute attr;
|
||||
ssize_t (*show)(struct sysdev_class *, char *);
|
||||
ssize_t (*store)(struct sysdev_class *, const char *, size_t);
|
||||
};
|
||||
|
||||
#define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \
|
||||
struct sysdev_class_attribute attr_##_name = { \
|
||||
.attr = {.name = __stringify(_name), .mode = _mode }, \
|
||||
.show = _show, \
|
||||
.store = _store, \
|
||||
};
|
||||
|
||||
|
||||
extern int sysdev_class_register(struct sysdev_class *);
|
||||
extern void sysdev_class_unregister(struct sysdev_class *);
|
||||
|
||||
|
||||
extern int sysdev_class_create_file(struct sysdev_class *,
|
||||
struct sysdev_class_attribute *);
|
||||
extern void sysdev_class_remove_file(struct sysdev_class *,
|
||||
struct sysdev_class_attribute *);
|
||||
/**
|
||||
* Auxillary system device drivers.
|
||||
*/
|
||||
|
||||
+1
-1
@@ -18,7 +18,6 @@
|
||||
#define _LINUX_TCP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/dmaengine.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
struct tcphdr {
|
||||
@@ -161,6 +160,7 @@ struct tcp_info
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/dmaengine.h>
|
||||
#include <net/sock.h>
|
||||
#include <net/inet_connection_sock.h>
|
||||
#include <net/inet_timewait_sock.h>
|
||||
|
||||
+3
-1
@@ -290,7 +290,9 @@ extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc);
|
||||
extern int tty_unregister_ldisc(int disc);
|
||||
extern int tty_register_driver(struct tty_driver *driver);
|
||||
extern int tty_unregister_driver(struct tty_driver *driver);
|
||||
extern void tty_register_device(struct tty_driver *driver, unsigned index, struct device *dev);
|
||||
extern struct class_device *tty_register_device(struct tty_driver *driver,
|
||||
unsigned index,
|
||||
struct device *dev);
|
||||
extern void tty_unregister_device(struct tty_driver *driver, unsigned index);
|
||||
extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp,
|
||||
int buflen);
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef __LINUX_UACCESS_H__
|
||||
#define __LINUX_UACCESS_H__
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#ifndef ARCH_HAS_NOCACHE_UACCESS
|
||||
|
||||
static inline unsigned long __copy_from_user_inatomic_nocache(void *to,
|
||||
const void __user *from, unsigned long n)
|
||||
{
|
||||
return __copy_from_user_inatomic(to, from, n);
|
||||
}
|
||||
|
||||
static inline unsigned long __copy_from_user_nocache(void *to,
|
||||
const void __user *from, unsigned long n)
|
||||
{
|
||||
return __copy_from_user(to, from, n);
|
||||
}
|
||||
|
||||
#endif /* ARCH_HAS_NOCACHE_UACCESS */
|
||||
|
||||
#endif /* __LINUX_UACCESS_H__ */
|
||||
+18
-4
@@ -40,6 +40,8 @@ struct usb_driver;
|
||||
* Devices may also have class-specific or vendor-specific descriptors.
|
||||
*/
|
||||
|
||||
struct ep_device;
|
||||
|
||||
/**
|
||||
* struct usb_host_endpoint - host-side endpoint descriptor and queue
|
||||
* @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder
|
||||
@@ -57,7 +59,7 @@ struct usb_host_endpoint {
|
||||
struct usb_endpoint_descriptor desc;
|
||||
struct list_head urb_list;
|
||||
void *hcpriv;
|
||||
struct kobject *kobj; /* For sysfs info */
|
||||
struct ep_device *ep_dev; /* For sysfs info */
|
||||
|
||||
unsigned char *extra; /* Extra descriptors */
|
||||
int extralen;
|
||||
@@ -101,7 +103,8 @@ enum usb_interface_condition {
|
||||
* @condition: binding state of the interface: not bound, binding
|
||||
* (in probe()), bound to a driver, or unbinding (in disconnect())
|
||||
* @dev: driver model's view of this device
|
||||
* @class_dev: driver model's class view of this device.
|
||||
* @usb_dev: if an interface is bound to the USB major, this will point
|
||||
* to the sysfs representation for that device.
|
||||
*
|
||||
* USB device drivers attach to interfaces on a physical device. Each
|
||||
* interface encapsulates a single high level function, such as feeding
|
||||
@@ -141,7 +144,7 @@ struct usb_interface {
|
||||
* bound to */
|
||||
enum usb_interface_condition condition; /* state of binding */
|
||||
struct device dev; /* interface specific device info */
|
||||
struct class_device *class_dev;
|
||||
struct device *usb_dev; /* pointer to the usb class's device, if any */
|
||||
};
|
||||
#define to_usb_interface(d) container_of(d, struct usb_interface, dev)
|
||||
#define interface_to_usbdev(intf) \
|
||||
@@ -358,7 +361,7 @@ struct usb_device {
|
||||
char *serial; /* iSerialNumber string, if present */
|
||||
|
||||
struct list_head filelist;
|
||||
struct class_device *class_dev;
|
||||
struct device *usbfs_dev;
|
||||
struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */
|
||||
|
||||
/*
|
||||
@@ -386,6 +389,8 @@ extern int usb_lock_device_for_reset(struct usb_device *udev,
|
||||
|
||||
/* USB port reset for device reinitialization */
|
||||
extern int usb_reset_device(struct usb_device *dev);
|
||||
extern int usb_reset_composite_device(struct usb_device *dev,
|
||||
struct usb_interface *iface);
|
||||
|
||||
extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id);
|
||||
|
||||
@@ -554,6 +559,10 @@ struct usb_dynids {
|
||||
* do (or don't) show up otherwise in the filesystem.
|
||||
* @suspend: Called when the device is going to be suspended by the system.
|
||||
* @resume: Called when the device is being resumed by the system.
|
||||
* @pre_reset: Called by usb_reset_composite_device() when the device
|
||||
* is about to be reset.
|
||||
* @post_reset: Called by usb_reset_composite_device() after the device
|
||||
* has been reset.
|
||||
* @id_table: USB drivers use ID table to support hotplugging.
|
||||
* Export this with MODULE_DEVICE_TABLE(usb,...). This must be set
|
||||
* or your driver's probe function will never get called.
|
||||
@@ -592,6 +601,9 @@ struct usb_driver {
|
||||
int (*suspend) (struct usb_interface *intf, pm_message_t message);
|
||||
int (*resume) (struct usb_interface *intf);
|
||||
|
||||
void (*pre_reset) (struct usb_interface *intf);
|
||||
void (*post_reset) (struct usb_interface *intf);
|
||||
|
||||
const struct usb_device_id *id_table;
|
||||
|
||||
struct usb_dynids dynids;
|
||||
@@ -1008,6 +1020,8 @@ void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe,
|
||||
extern int usb_control_msg(struct usb_device *dev, unsigned int pipe,
|
||||
__u8 request, __u8 requesttype, __u16 value, __u16 index,
|
||||
void *data, __u16 size, int timeout);
|
||||
extern int usb_interrupt_msg(struct usb_device *usb_dev, unsigned int pipe,
|
||||
void *data, int len, int *actual_length, int timeout);
|
||||
extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
|
||||
void *data, int len, int *actual_length,
|
||||
int timeout);
|
||||
|
||||
@@ -14,13 +14,13 @@ struct sl811_platform_data {
|
||||
u8 power;
|
||||
|
||||
/* sl811 relies on an external source of VBUS current */
|
||||
void (*port_power)(struct device *dev, int is_on);
|
||||
void (*port_power)(struct device *dev, int is_on);
|
||||
|
||||
/* pulse sl811 nRST (probably with a GPIO) */
|
||||
void (*reset)(struct device *dev);
|
||||
void (*reset)(struct device *dev);
|
||||
|
||||
// some boards need something like these:
|
||||
// int (*check_overcurrent)(struct device *dev);
|
||||
// void (*clock_enable)(struct device *dev, int is_on);
|
||||
// int (*check_overcurrent)(struct device *dev);
|
||||
// void (*clock_enable)(struct device *dev, int is_on);
|
||||
};
|
||||
|
||||
@@ -4,10 +4,13 @@
|
||||
#include <linux/spinlock.h>
|
||||
#include <asm/page.h> /* pgprot_t */
|
||||
|
||||
struct vm_area_struct;
|
||||
|
||||
/* bits in vm_struct->flags */
|
||||
#define VM_IOREMAP 0x00000001 /* ioremap() and friends */
|
||||
#define VM_ALLOC 0x00000002 /* vmalloc() */
|
||||
#define VM_MAP 0x00000004 /* vmap()ed pages */
|
||||
#define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */
|
||||
/* bits [20..32] reserved for arch specific ioremap internals */
|
||||
|
||||
/*
|
||||
@@ -32,9 +35,11 @@ struct vm_struct {
|
||||
* Highlevel APIs for driver use
|
||||
*/
|
||||
extern void *vmalloc(unsigned long size);
|
||||
extern void *vmalloc_user(unsigned long size);
|
||||
extern void *vmalloc_node(unsigned long size, int node);
|
||||
extern void *vmalloc_exec(unsigned long size);
|
||||
extern void *vmalloc_32(unsigned long size);
|
||||
extern void *vmalloc_32_user(unsigned long size);
|
||||
extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot);
|
||||
extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask,
|
||||
pgprot_t prot);
|
||||
@@ -45,6 +50,9 @@ extern void vfree(void *addr);
|
||||
extern void *vmap(struct page **pages, unsigned int count,
|
||||
unsigned long flags, pgprot_t prot);
|
||||
extern void vunmap(void *addr);
|
||||
|
||||
extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
|
||||
unsigned long pgoff);
|
||||
|
||||
/*
|
||||
* Lowlevel-APIs (not for driver use!)
|
||||
|
||||
@@ -50,14 +50,15 @@ struct writeback_control {
|
||||
* a hint that the filesystem need only write out the pages inside that
|
||||
* byterange. The byte at `end' is included in the writeout request.
|
||||
*/
|
||||
loff_t start;
|
||||
loff_t end;
|
||||
loff_t range_start;
|
||||
loff_t range_end;
|
||||
|
||||
unsigned nonblocking:1; /* Don't get stuck on request queues */
|
||||
unsigned encountered_congestion:1; /* An output: a queue is full */
|
||||
unsigned for_kupdate:1; /* A kupdate writeback */
|
||||
unsigned for_reclaim:1; /* Invoked from the page allocator */
|
||||
unsigned for_writepages:1; /* This is a writepages() call */
|
||||
unsigned range_cyclic:1; /* range_start is cyclic */
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -33,6 +33,18 @@
|
||||
*/
|
||||
#ifndef MAX_WBITS
|
||||
# define MAX_WBITS 15 /* 32K LZ77 window */
|
||||
#endif
|
||||
|
||||
/* default windowBits for decompression. MAX_WBITS is for compression only */
|
||||
#ifndef DEF_WBITS
|
||||
# define DEF_WBITS MAX_WBITS
|
||||
#endif
|
||||
|
||||
/* default memLevel */
|
||||
#if MAX_MEM_LEVEL >= 8
|
||||
# define DEF_MEM_LEVEL 8
|
||||
#else
|
||||
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
|
||||
#endif
|
||||
|
||||
/* Type declarations */
|
||||
|
||||
+128
-79
@@ -1,7 +1,6 @@
|
||||
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
||||
version 1.1.3, July 9th, 1998
|
||||
|
||||
Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler
|
||||
Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@@ -24,7 +23,7 @@
|
||||
|
||||
|
||||
The data format used by the zlib library is described by RFCs (Request for
|
||||
Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
|
||||
Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
|
||||
(zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
|
||||
*/
|
||||
|
||||
@@ -33,7 +32,22 @@
|
||||
|
||||
#include <linux/zconf.h>
|
||||
|
||||
#define ZLIB_VERSION "1.1.3"
|
||||
/* zlib deflate based on ZLIB_VERSION "1.1.3" */
|
||||
/* zlib inflate based on ZLIB_VERSION "1.2.3" */
|
||||
|
||||
/*
|
||||
This is a modified version of zlib for use inside the Linux kernel.
|
||||
The main changes are to perform all memory allocation in advance.
|
||||
|
||||
Inflation Changes:
|
||||
* Z_PACKET_FLUSH is added and used by ppp_deflate. Before returning
|
||||
this checks there is no more input data available and the next data
|
||||
is a STORED block. It also resets the mode to be read for the next
|
||||
data, all as per PPP requirements.
|
||||
* Addition of zlib_inflateIncomp which copies incompressible data into
|
||||
the history window and adjusts the accoutning without calling
|
||||
zlib_inflate itself to inflate the data.
|
||||
*/
|
||||
|
||||
/*
|
||||
The 'zlib' compression library provides in-memory compression and
|
||||
@@ -48,9 +62,18 @@
|
||||
application must provide more input and/or consume the output
|
||||
(providing more output space) before each call.
|
||||
|
||||
The compressed data format used by default by the in-memory functions is
|
||||
the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
|
||||
around a deflate stream, which is itself documented in RFC 1951.
|
||||
|
||||
The library also supports reading and writing files in gzip (.gz) format
|
||||
with an interface similar to that of stdio.
|
||||
|
||||
The zlib format was designed to be compact and fast for use in memory
|
||||
and on communications channels. The gzip format was designed for single-
|
||||
file compression on file systems, has a larger header than zlib to maintain
|
||||
directory information, and uses a different, slower check method than zlib.
|
||||
|
||||
The library does not install any signal handler. The decoder checks
|
||||
the consistency of the compressed data, so the library should never
|
||||
crash even in case of corrupted input.
|
||||
@@ -119,7 +142,8 @@ typedef z_stream *z_streamp;
|
||||
#define Z_SYNC_FLUSH 3
|
||||
#define Z_FULL_FLUSH 4
|
||||
#define Z_FINISH 5
|
||||
/* Allowed flush values; see deflate() below for details */
|
||||
#define Z_BLOCK 6 /* Only for inflate at present */
|
||||
/* Allowed flush values; see deflate() and inflate() below for details */
|
||||
|
||||
#define Z_OK 0
|
||||
#define Z_STREAM_END 1
|
||||
@@ -155,13 +179,6 @@ typedef z_stream *z_streamp;
|
||||
|
||||
/* basic functions */
|
||||
|
||||
extern const char * zlib_zlibVersion (void);
|
||||
/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
|
||||
If the first character differs, the library code actually used is
|
||||
not compatible with the zlib.h header file used by the application.
|
||||
This check is automatically made by deflateInit and inflateInit.
|
||||
*/
|
||||
|
||||
extern int zlib_deflate_workspacesize (void);
|
||||
/*
|
||||
Returns the number of bytes that needs to be allocated for a per-
|
||||
@@ -315,9 +332,9 @@ extern int zlib_inflateInit (z_streamp strm);
|
||||
extern int zlib_inflate (z_streamp strm, int flush);
|
||||
/*
|
||||
inflate decompresses as much data as possible, and stops when the input
|
||||
buffer becomes empty or the output buffer becomes full. It may some
|
||||
introduce some output latency (reading input without producing any output)
|
||||
except when forced to flush.
|
||||
buffer becomes empty or the output buffer becomes full. It may introduce
|
||||
some output latency (reading input without producing any output) except when
|
||||
forced to flush.
|
||||
|
||||
The detailed semantics are as follows. inflate performs one or both of the
|
||||
following actions:
|
||||
@@ -341,11 +358,26 @@ extern int zlib_inflate (z_streamp strm, int flush);
|
||||
must be called again after making room in the output buffer because there
|
||||
might be more output pending.
|
||||
|
||||
If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much
|
||||
output as possible to the output buffer. The flushing behavior of inflate is
|
||||
not specified for values of the flush parameter other than Z_SYNC_FLUSH
|
||||
and Z_FINISH, but the current implementation actually flushes as much output
|
||||
as possible anyway.
|
||||
The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
|
||||
Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much
|
||||
output as possible to the output buffer. Z_BLOCK requests that inflate() stop
|
||||
if and when it gets to the next deflate block boundary. When decoding the
|
||||
zlib or gzip format, this will cause inflate() to return immediately after
|
||||
the header and before the first block. When doing a raw inflate, inflate()
|
||||
will go ahead and process the first block, and will return when it gets to
|
||||
the end of that block, or when it runs out of data.
|
||||
|
||||
The Z_BLOCK option assists in appending to or combining deflate streams.
|
||||
Also to assist in this, on return inflate() will set strm->data_type to the
|
||||
number of unused bits in the last byte taken from strm->next_in, plus 64
|
||||
if inflate() is currently decoding the last block in the deflate stream,
|
||||
plus 128 if inflate() returned immediately after decoding an end-of-block
|
||||
code or decoding the complete header up to just before the first byte of the
|
||||
deflate stream. The end-of-block will not be indicated until all of the
|
||||
uncompressed data from that block has been written to strm->next_out. The
|
||||
number of unused bits may in general be greater than seven, except when
|
||||
bit 7 of data_type is set, in which case the number of unused bits will be
|
||||
less than eight.
|
||||
|
||||
inflate() should normally be called until it returns Z_STREAM_END or an
|
||||
error. However if all decompression is to be performed in a single step
|
||||
@@ -355,29 +387,44 @@ extern int zlib_inflate (z_streamp strm, int flush);
|
||||
uncompressed data. (The size of the uncompressed data may have been saved
|
||||
by the compressor for this purpose.) The next operation on this stream must
|
||||
be inflateEnd to deallocate the decompression state. The use of Z_FINISH
|
||||
is never required, but can be used to inform inflate that a faster routine
|
||||
is never required, but can be used to inform inflate that a faster approach
|
||||
may be used for the single inflate() call.
|
||||
|
||||
If a preset dictionary is needed at this point (see inflateSetDictionary
|
||||
below), inflate sets strm-adler to the adler32 checksum of the
|
||||
dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise
|
||||
it sets strm->adler to the adler32 checksum of all output produced
|
||||
so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or
|
||||
an error code as described below. At the end of the stream, inflate()
|
||||
checks that its computed adler32 checksum is equal to that saved by the
|
||||
compressor and returns Z_STREAM_END only if the checksum is correct.
|
||||
In this implementation, inflate() always flushes as much output as
|
||||
possible to the output buffer, and always uses the faster approach on the
|
||||
first call. So the only effect of the flush parameter in this implementation
|
||||
is on the return value of inflate(), as noted below, or when it returns early
|
||||
because Z_BLOCK is used.
|
||||
|
||||
If a preset dictionary is needed after this call (see inflateSetDictionary
|
||||
below), inflate sets strm->adler to the adler32 checksum of the dictionary
|
||||
chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
|
||||
strm->adler to the adler32 checksum of all output produced so far (that is,
|
||||
total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
|
||||
below. At the end of the stream, inflate() checks that its computed adler32
|
||||
checksum is equal to that saved by the compressor and returns Z_STREAM_END
|
||||
only if the checksum is correct.
|
||||
|
||||
inflate() will decompress and check either zlib-wrapped or gzip-wrapped
|
||||
deflate data. The header type is detected automatically. Any information
|
||||
contained in the gzip header is not retained, so applications that need that
|
||||
information should instead use raw inflate, see inflateInit2() below, or
|
||||
inflateBack() and perform their own processing of the gzip header and
|
||||
trailer.
|
||||
|
||||
inflate() returns Z_OK if some progress has been made (more input processed
|
||||
or more output produced), Z_STREAM_END if the end of the compressed data has
|
||||
been reached and all uncompressed output has been produced, Z_NEED_DICT if a
|
||||
preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
|
||||
corrupted (input stream not conforming to the zlib format or incorrect
|
||||
adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent
|
||||
(for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not
|
||||
enough memory, Z_BUF_ERROR if no progress is possible or if there was not
|
||||
enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR
|
||||
case, the application may then call inflateSync to look for a good
|
||||
compression block.
|
||||
corrupted (input stream not conforming to the zlib format or incorrect check
|
||||
value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
|
||||
if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory,
|
||||
Z_BUF_ERROR if no progress is possible or if there was not enough room in the
|
||||
output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
|
||||
inflate() can be called again with more input and more output space to
|
||||
continue decompressing. If Z_DATA_ERROR is returned, the application may then
|
||||
call inflateSync() to look for a good compression block if a partial recovery
|
||||
of the data is desired.
|
||||
*/
|
||||
|
||||
|
||||
@@ -547,16 +594,36 @@ extern int inflateInit2 (z_streamp strm, int windowBits);
|
||||
The windowBits parameter is the base two logarithm of the maximum window
|
||||
size (the size of the history buffer). It should be in the range 8..15 for
|
||||
this version of the library. The default value is 15 if inflateInit is used
|
||||
instead. If a compressed stream with a larger window size is given as
|
||||
input, inflate() will return with the error code Z_DATA_ERROR instead of
|
||||
trying to allocate a larger window.
|
||||
instead. windowBits must be greater than or equal to the windowBits value
|
||||
provided to deflateInit2() while compressing, or it must be equal to 15 if
|
||||
deflateInit2() was not used. If a compressed stream with a larger window
|
||||
size is given as input, inflate() will return with the error code
|
||||
Z_DATA_ERROR instead of trying to allocate a larger window.
|
||||
|
||||
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
||||
memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
|
||||
memLevel). msg is set to null if there is no error message. inflateInit2
|
||||
does not perform any decompression apart from reading the zlib header if
|
||||
present: this will be done by inflate(). (So next_in and avail_in may be
|
||||
modified, but next_out and avail_out are unchanged.)
|
||||
windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
|
||||
determines the window size. inflate() will then process raw deflate data,
|
||||
not looking for a zlib or gzip header, not generating a check value, and not
|
||||
looking for any check values for comparison at the end of the stream. This
|
||||
is for use with other formats that use the deflate compressed data format
|
||||
such as zip. Those formats provide their own check values. If a custom
|
||||
format is developed using the raw deflate format for compressed data, it is
|
||||
recommended that a check value such as an adler32 or a crc32 be applied to
|
||||
the uncompressed data as is done in the zlib, gzip, and zip formats. For
|
||||
most applications, the zlib format should be used as is. Note that comments
|
||||
above on the use in deflateInit2() applies to the magnitude of windowBits.
|
||||
|
||||
windowBits can also be greater than 15 for optional gzip decoding. Add
|
||||
32 to windowBits to enable zlib and gzip decoding with automatic header
|
||||
detection, or add 16 to decode only the gzip format (the zlib format will
|
||||
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is
|
||||
a crc32 instead of an adler32.
|
||||
|
||||
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
||||
memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg
|
||||
is set to null if there is no error message. inflateInit2 does not perform
|
||||
any decompression apart from reading the zlib header if present: this will
|
||||
be done by inflate(). (So next_in and avail_in may be modified, but next_out
|
||||
and avail_out are unchanged.)
|
||||
*/
|
||||
|
||||
extern int zlib_inflateSetDictionary (z_streamp strm,
|
||||
@@ -564,16 +631,19 @@ extern int zlib_inflateSetDictionary (z_streamp strm,
|
||||
uInt dictLength);
|
||||
/*
|
||||
Initializes the decompression dictionary from the given uncompressed byte
|
||||
sequence. This function must be called immediately after a call of inflate
|
||||
if this call returned Z_NEED_DICT. The dictionary chosen by the compressor
|
||||
can be determined from the Adler32 value returned by this call of
|
||||
inflate. The compressor and decompressor must use exactly the same
|
||||
dictionary (see deflateSetDictionary).
|
||||
sequence. This function must be called immediately after a call of inflate,
|
||||
if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
|
||||
can be determined from the adler32 value returned by that call of inflate.
|
||||
The compressor and decompressor must use exactly the same dictionary (see
|
||||
deflateSetDictionary). For raw inflate, this function can be called
|
||||
immediately after inflateInit2() or inflateReset() and before any call of
|
||||
inflate() to set the dictionary. The application must insure that the
|
||||
dictionary that was used for compression is provided.
|
||||
|
||||
inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
|
||||
parameter is invalid (such as NULL dictionary) or the stream state is
|
||||
inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
|
||||
expected one (incorrect Adler32 value). inflateSetDictionary does not
|
||||
expected one (incorrect adler32 value). inflateSetDictionary does not
|
||||
perform any decompression: this will be done by subsequent calls of
|
||||
inflate().
|
||||
*/
|
||||
@@ -614,40 +684,19 @@ extern int zlib_inflateIncomp (z_stream *strm);
|
||||
containing the data at next_in (except that the data is not output).
|
||||
*/
|
||||
|
||||
/* various hacks, don't look :) */
|
||||
|
||||
/* deflateInit and inflateInit are macros to allow checking the zlib version
|
||||
* and the compiler's view of z_stream:
|
||||
*/
|
||||
extern int zlib_deflateInit_ (z_streamp strm, int level,
|
||||
const char *version, int stream_size);
|
||||
extern int zlib_inflateInit_ (z_streamp strm,
|
||||
const char *version, int stream_size);
|
||||
extern int zlib_deflateInit2_ (z_streamp strm, int level, int method,
|
||||
int windowBits, int memLevel,
|
||||
int strategy, const char *version,
|
||||
int stream_size);
|
||||
extern int zlib_inflateInit2_ (z_streamp strm, int windowBits,
|
||||
const char *version, int stream_size);
|
||||
#define zlib_deflateInit(strm, level) \
|
||||
zlib_deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
|
||||
zlib_deflateInit2((strm), (level), Z_DEFLATED, MAX_WBITS, \
|
||||
DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY)
|
||||
#define zlib_inflateInit(strm) \
|
||||
zlib_inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
|
||||
#define zlib_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
|
||||
zlib_deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
|
||||
(strategy), ZLIB_VERSION, sizeof(z_stream))
|
||||
#define zlib_inflateInit2(strm, windowBits) \
|
||||
zlib_inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
|
||||
zlib_inflateInit2((strm), DEF_WBITS)
|
||||
|
||||
extern int zlib_deflateInit2(z_streamp strm, int level, int method,
|
||||
int windowBits, int memLevel,
|
||||
int strategy);
|
||||
extern int zlib_inflateInit2(z_streamp strm, int windowBits);
|
||||
|
||||
#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
|
||||
struct internal_state {int dummy;}; /* hack for buggy compilers */
|
||||
#endif
|
||||
|
||||
extern const char * zlib_zError (int err);
|
||||
#if 0
|
||||
extern int zlib_inflateSyncPoint (z_streamp z);
|
||||
#endif
|
||||
extern const uLong * zlib_get_crc_table (void);
|
||||
|
||||
#endif /* _ZLIB_H */
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
#ifndef _LINUX_ZORRO_H
|
||||
#define _LINUX_ZORRO_H
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <linux/device.h>
|
||||
|
||||
|
||||
@@ -112,45 +110,6 @@ struct ConfigDev {
|
||||
__u32 cd_Unused[4]; /* for whatever the driver wants */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#else /* __ASSEMBLY__ */
|
||||
|
||||
LN_Succ = 0
|
||||
LN_Pred = LN_Succ+4
|
||||
LN_Type = LN_Pred+4
|
||||
LN_Pri = LN_Type+1
|
||||
LN_Name = LN_Pri+1
|
||||
LN_sizeof = LN_Name+4
|
||||
|
||||
ER_Type = 0
|
||||
ER_Product = ER_Type+1
|
||||
ER_Flags = ER_Product+1
|
||||
ER_Reserved03 = ER_Flags+1
|
||||
ER_Manufacturer = ER_Reserved03+1
|
||||
ER_SerialNumber = ER_Manufacturer+2
|
||||
ER_InitDiagVec = ER_SerialNumber+4
|
||||
ER_Reserved0c = ER_InitDiagVec+2
|
||||
ER_Reserved0d = ER_Reserved0c+1
|
||||
ER_Reserved0e = ER_Reserved0d+1
|
||||
ER_Reserved0f = ER_Reserved0e+1
|
||||
ER_sizeof = ER_Reserved0f+1
|
||||
|
||||
CD_Node = 0
|
||||
CD_Flags = CD_Node+LN_sizeof
|
||||
CD_Pad = CD_Flags+1
|
||||
CD_Rom = CD_Pad+1
|
||||
CD_BoardAddr = CD_Rom+ER_sizeof
|
||||
CD_BoardSize = CD_BoardAddr+4
|
||||
CD_SlotAddr = CD_BoardSize+4
|
||||
CD_SlotSize = CD_SlotAddr+2
|
||||
CD_Driver = CD_SlotSize+2
|
||||
CD_NextCD = CD_Driver+4
|
||||
CD_Unused = CD_NextCD+4
|
||||
CD_sizeof = CD_Unused+(4*4)
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#define ZORRO_NUM_AUTO 16
|
||||
|
||||
#ifdef __KERNEL__
|
||||
@@ -290,7 +249,6 @@ extern DECLARE_BITMAP(zorro_unused_z2ram, 128);
|
||||
#define Z2RAM_CHUNKSHIFT (16)
|
||||
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _LINUX_ZORRO_H */
|
||||
|
||||
@@ -23,18 +23,6 @@ typedef unsigned long ulg;
|
||||
|
||||
/* common constants */
|
||||
|
||||
#ifndef DEF_WBITS
|
||||
# define DEF_WBITS MAX_WBITS
|
||||
#endif
|
||||
/* default windowBits for decompression. MAX_WBITS is for compression only */
|
||||
|
||||
#if MAX_MEM_LEVEL >= 8
|
||||
# define DEF_MEM_LEVEL 8
|
||||
#else
|
||||
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
|
||||
#endif
|
||||
/* default memLevel */
|
||||
|
||||
#define STORED_BLOCK 0
|
||||
#define STATIC_TREES 1
|
||||
#define DYN_TREES 2
|
||||
|
||||
Reference in New Issue
Block a user