Commit da085726 authored by David S. Miller's avatar David S. Miller

Merge davem@nuts.ninka.net:/home/davem/src/BK/sparc-2.5

into kernel.bkbits.net:/home/davem/sparc-2.5
parents 5103c926 f1969635
...@@ -450,13 +450,13 @@ struct ifreq32 { ...@@ -450,13 +450,13 @@ struct ifreq32 {
struct ifmap32 ifru_map; struct ifmap32 ifru_map;
char ifru_slave[IFNAMSIZ]; /* Just fits the size */ char ifru_slave[IFNAMSIZ]; /* Just fits the size */
char ifru_newname[IFNAMSIZ]; char ifru_newname[IFNAMSIZ];
__kernel_caddr_t32 ifru_data; compat_caddr_t ifru_data;
} ifr_ifru; } ifr_ifru;
}; };
struct ifconf32 { struct ifconf32 {
int ifc_len; /* size of buffer */ int ifc_len; /* size of buffer */
__kernel_caddr_t32 ifcbuf; compat_caddr_t ifcbuf;
}; };
#ifdef CONFIG_NET #ifdef CONFIG_NET
...@@ -1009,7 +1009,7 @@ static int fbiogscursor(unsigned int fd, unsigned int cmd, unsigned long arg) ...@@ -1009,7 +1009,7 @@ static int fbiogscursor(unsigned int fd, unsigned int cmd, unsigned long arg)
struct fb_fix_screeninfo32 { struct fb_fix_screeninfo32 {
char id[16]; char id[16];
__kernel_caddr_t32 smem_start; compat_caddr_t smem_start;
__u32 smem_len; __u32 smem_len;
__u32 type; __u32 type;
__u32 type_aux; __u32 type_aux;
...@@ -1018,7 +1018,7 @@ struct fb_fix_screeninfo32 { ...@@ -1018,7 +1018,7 @@ struct fb_fix_screeninfo32 {
__u16 ypanstep; __u16 ypanstep;
__u16 ywrapstep; __u16 ywrapstep;
__u32 line_length; __u32 line_length;
__kernel_caddr_t32 mmio_start; compat_caddr_t mmio_start;
__u32 mmio_len; __u32 mmio_len;
__u32 accel; __u32 accel;
__u16 reserved[3]; __u16 reserved[3];
...@@ -1027,10 +1027,10 @@ struct fb_fix_screeninfo32 { ...@@ -1027,10 +1027,10 @@ struct fb_fix_screeninfo32 {
struct fb_cmap32 { struct fb_cmap32 {
__u32 start; __u32 start;
__u32 len; __u32 len;
__kernel_caddr_t32 red; compat_caddr_t red;
__kernel_caddr_t32 green; compat_caddr_t green;
__kernel_caddr_t32 blue; compat_caddr_t blue;
__kernel_caddr_t32 transp; compat_caddr_t transp;
}; };
static int fb_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) static int fb_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
...@@ -1169,7 +1169,7 @@ struct floppy_struct32 { ...@@ -1169,7 +1169,7 @@ struct floppy_struct32 {
unsigned char rate; unsigned char rate;
unsigned char spec1; unsigned char spec1;
unsigned char fmt_gap; unsigned char fmt_gap;
const __kernel_caddr_t32 name; const compat_caddr_t name;
}; };
struct floppy_drive_params32 { struct floppy_drive_params32 {
...@@ -1208,7 +1208,7 @@ struct floppy_drive_struct32 { ...@@ -1208,7 +1208,7 @@ struct floppy_drive_struct32 {
int fd_ref; int fd_ref;
int fd_device; int fd_device;
int last_checked; int last_checked;
__kernel_caddr_t32 dmabuf; compat_caddr_t dmabuf;
int bufblocks; int bufblocks;
}; };
...@@ -1732,7 +1732,7 @@ static int ppp_sock_fprog_ioctl_trans(unsigned int fd, unsigned int cmd, unsigne ...@@ -1732,7 +1732,7 @@ static int ppp_sock_fprog_ioctl_trans(unsigned int fd, unsigned int cmd, unsigne
} }
struct ppp_option_data32 { struct ppp_option_data32 {
__kernel_caddr_t32 ptr; compat_caddr_t ptr;
__u32 length; __u32 length;
int transmit; int transmit;
}; };
...@@ -1813,8 +1813,8 @@ struct mtget32 { ...@@ -1813,8 +1813,8 @@ struct mtget32 {
__u32 mt_dsreg; __u32 mt_dsreg;
__u32 mt_gstat; __u32 mt_gstat;
__u32 mt_erreg; __u32 mt_erreg;
__kernel_daddr_t32 mt_fileno; compat_daddr_t mt_fileno;
__kernel_daddr_t32 mt_blkno; compat_daddr_t mt_blkno;
}; };
#define MTIOCGET32 _IOR('m', 2, struct mtget32) #define MTIOCGET32 _IOR('m', 2, struct mtget32)
...@@ -1932,7 +1932,7 @@ static int mt_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) ...@@ -1932,7 +1932,7 @@ static int mt_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
struct cdrom_read32 { struct cdrom_read32 {
int cdread_lba; int cdread_lba;
__kernel_caddr_t32 cdread_bufaddr; compat_caddr_t cdread_bufaddr;
int cdread_buflen; int cdread_buflen;
}; };
...@@ -1940,16 +1940,16 @@ struct cdrom_read_audio32 { ...@@ -1940,16 +1940,16 @@ struct cdrom_read_audio32 {
union cdrom_addr addr; union cdrom_addr addr;
u_char addr_format; u_char addr_format;
int nframes; int nframes;
__kernel_caddr_t32 buf; compat_caddr_t buf;
}; };
struct cdrom_generic_command32 { struct cdrom_generic_command32 {
unsigned char cmd[CDROM_PACKET_SIZE]; unsigned char cmd[CDROM_PACKET_SIZE];
__kernel_caddr_t32 buffer; compat_caddr_t buffer;
unsigned int buflen; unsigned int buflen;
int stat; int stat;
__kernel_caddr_t32 sense; compat_caddr_t sense;
__kernel_caddr_t32 reserved[3]; compat_caddr_t reserved[3];
}; };
static int cdrom_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) static int cdrom_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
...@@ -1958,7 +1958,7 @@ static int cdrom_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long ar ...@@ -1958,7 +1958,7 @@ static int cdrom_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long ar
struct cdrom_read cdread; struct cdrom_read cdread;
struct cdrom_read_audio cdreadaudio; struct cdrom_read_audio cdreadaudio;
struct cdrom_generic_command cgc; struct cdrom_generic_command cgc;
__kernel_caddr_t32 addr; compat_caddr_t addr;
char *data = 0; char *data = 0;
void *karg; void *karg;
int err = 0; int err = 0;
...@@ -2041,9 +2041,9 @@ out: if (data) ...@@ -2041,9 +2041,9 @@ out: if (data)
struct loop_info32 { struct loop_info32 {
int lo_number; /* ioctl r/o */ int lo_number; /* ioctl r/o */
__kernel_dev_t32 lo_device; /* ioctl r/o */ compat_dev_t lo_device; /* ioctl r/o */
unsigned int lo_inode; /* ioctl r/o */ unsigned int lo_inode; /* ioctl r/o */
__kernel_dev_t32 lo_rdevice; /* ioctl r/o */ compat_dev_t lo_rdevice; /* ioctl r/o */
int lo_offset; int lo_offset;
int lo_encrypt_type; int lo_encrypt_type;
int lo_encrypt_key_size; /* ioctl w/o */ int lo_encrypt_key_size; /* ioctl w/o */
...@@ -2248,7 +2248,7 @@ static int do_smb_getmountuid(unsigned int fd, unsigned int cmd, unsigned long a ...@@ -2248,7 +2248,7 @@ static int do_smb_getmountuid(unsigned int fd, unsigned int cmd, unsigned long a
set_fs(old_fs); set_fs(old_fs);
if (err >= 0) if (err >= 0)
err = put_user(kuid, (__kernel_uid_t32 *)arg); err = put_user(kuid, (compat_uid_t *)arg);
return err; return err;
} }
...@@ -2256,7 +2256,7 @@ static int do_smb_getmountuid(unsigned int fd, unsigned int cmd, unsigned long a ...@@ -2256,7 +2256,7 @@ static int do_smb_getmountuid(unsigned int fd, unsigned int cmd, unsigned long a
struct ncp_ioctl_request_32 { struct ncp_ioctl_request_32 {
unsigned int function; unsigned int function;
unsigned int size; unsigned int size;
__kernel_caddr_t32 data; compat_caddr_t data;
}; };
struct ncp_fs_info_v2_32 { struct ncp_fs_info_v2_32 {
...@@ -2277,13 +2277,13 @@ struct ncp_objectname_ioctl_32 ...@@ -2277,13 +2277,13 @@ struct ncp_objectname_ioctl_32
{ {
int auth_type; int auth_type;
unsigned int object_name_len; unsigned int object_name_len;
__kernel_caddr_t32 object_name; /* an userspace data, in most cases user name */ compat_caddr_t object_name; /* an userspace data, in most cases user name */
}; };
struct ncp_privatedata_ioctl_32 struct ncp_privatedata_ioctl_32
{ {
unsigned int len; unsigned int len;
__kernel_caddr_t32 data; /* ~1000 for NDS */ compat_caddr_t data; /* ~1000 for NDS */
}; };
#define NCP_IOC_NCPREQUEST_32 _IOR('n', 1, struct ncp_ioctl_request_32) #define NCP_IOC_NCPREQUEST_32 _IOR('n', 1, struct ncp_ioctl_request_32)
...@@ -2557,12 +2557,12 @@ static int do_ncp_setprivatedata(unsigned int fd, unsigned int cmd, unsigned lon ...@@ -2557,12 +2557,12 @@ static int do_ncp_setprivatedata(unsigned int fd, unsigned int cmd, unsigned lon
struct atmif_sioc32 { struct atmif_sioc32 {
int number; int number;
int length; int length;
__kernel_caddr_t32 arg; compat_caddr_t arg;
}; };
struct atm_iobuf32 { struct atm_iobuf32 {
int length; int length;
__kernel_caddr_t32 buffer; compat_caddr_t buffer;
}; };
#define ATM_GETLINKRATE32 _IOW('a', ATMIOC_ITF+1, struct atmif_sioc32) #define ATM_GETLINKRATE32 _IOW('a', ATMIOC_ITF+1, struct atmif_sioc32)
...@@ -2623,7 +2623,7 @@ static int do_atm_iobuf(unsigned int fd, unsigned int cmd, unsigned long arg) ...@@ -2623,7 +2623,7 @@ static int do_atm_iobuf(unsigned int fd, unsigned int cmd, unsigned long arg)
iobuf.length = iobuf32.length; iobuf.length = iobuf32.length;
if (iobuf32.buffer == (__kernel_caddr_t32) NULL || iobuf32.length == 0) { if (iobuf32.buffer == (compat_caddr_t) NULL || iobuf32.length == 0) {
iobuf.buffer = (void*)(unsigned long)iobuf32.buffer; iobuf.buffer = (void*)(unsigned long)iobuf32.buffer;
} else { } else {
iobuf.buffer = kmalloc(iobuf.length, GFP_KERNEL); iobuf.buffer = kmalloc(iobuf.length, GFP_KERNEL);
...@@ -2677,7 +2677,7 @@ static int do_atmif_sioc(unsigned int fd, unsigned int cmd, unsigned long arg) ...@@ -2677,7 +2677,7 @@ static int do_atmif_sioc(unsigned int fd, unsigned int cmd, unsigned long arg)
sioc.number = sioc32.number; sioc.number = sioc32.number;
sioc.length = sioc32.length; sioc.length = sioc32.length;
if (sioc32.arg == (__kernel_caddr_t32) NULL || sioc32.length == 0) { if (sioc32.arg == (compat_caddr_t) NULL || sioc32.length == 0) {
sioc.arg = (void*)(unsigned long)sioc32.arg; sioc.arg = (void*)(unsigned long)sioc32.arg;
} else { } else {
sioc.arg = kmalloc(sioc.length, GFP_KERNEL); sioc.arg = kmalloc(sioc.length, GFP_KERNEL);
...@@ -2835,7 +2835,7 @@ typedef struct { ...@@ -2835,7 +2835,7 @@ typedef struct {
} lv_status_byindex_req32_t; } lv_status_byindex_req32_t;
typedef struct { typedef struct {
__kernel_dev_t32 dev; compat_dev_t dev;
u32 lv; u32 lv;
} lv_status_bydev_req32_t; } lv_status_bydev_req32_t;
...@@ -5128,7 +5128,7 @@ HANDLE_IOCTL(VIDIOCSFBUF32, do_video_ioctl) ...@@ -5128,7 +5128,7 @@ HANDLE_IOCTL(VIDIOCSFBUF32, do_video_ioctl)
HANDLE_IOCTL(VIDIOCGFREQ32, do_video_ioctl) HANDLE_IOCTL(VIDIOCGFREQ32, do_video_ioctl)
HANDLE_IOCTL(VIDIOCSFREQ32, do_video_ioctl) HANDLE_IOCTL(VIDIOCSFREQ32, do_video_ioctl)
/* One SMB ioctl needs translations. */ /* One SMB ioctl needs translations. */
#define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, __kernel_uid_t32) #define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_uid_t)
HANDLE_IOCTL(SMB_IOC_GETMOUNTUID_32, do_smb_getmountuid) HANDLE_IOCTL(SMB_IOC_GETMOUNTUID_32, do_smb_getmountuid)
/* NCPFS */ /* NCPFS */
HANDLE_IOCTL(NCP_IOC_NCPREQUEST_32, do_ncp_ncprequest) HANDLE_IOCTL(NCP_IOC_NCPREQUEST_32, do_ncp_ncprequest)
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <linux/compat.h>
#include <asm/kbio.h> #include <asm/kbio.h>
/* Use this to get at 32-bit user passed pointers. */ /* Use this to get at 32-bit user passed pointers. */
...@@ -80,13 +81,13 @@ struct ifreq32 { ...@@ -80,13 +81,13 @@ struct ifreq32 {
int ifru_mtu; int ifru_mtu;
struct ifmap32 ifru_map; struct ifmap32 ifru_map;
char ifru_slave[IFNAMSIZ]; /* Just fits the size */ char ifru_slave[IFNAMSIZ]; /* Just fits the size */
__kernel_caddr_t32 ifru_data; compat_caddr_t ifru_data;
} ifr_ifru; } ifr_ifru;
}; };
struct ifconf32 { struct ifconf32 {
int ifc_len; /* size of buffer */ int ifc_len; /* size of buffer */
__kernel_caddr_t32 ifcbuf; compat_caddr_t ifcbuf;
}; };
extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg); extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
......
...@@ -290,11 +290,11 @@ struct msgbuf32 { s32 mtype; char mtext[1]; }; ...@@ -290,11 +290,11 @@ struct msgbuf32 { s32 mtype; char mtext[1]; };
struct ipc_perm32 struct ipc_perm32
{ {
key_t key; key_t key;
__kernel_uid_t32 uid; compat_uid_t uid;
__kernel_gid_t32 gid; compat_gid_t gid;
__kernel_uid_t32 cuid; compat_uid_t cuid;
__kernel_gid_t32 cgid; compat_gid_t cgid;
__kernel_mode_t32 mode; compat_mode_t mode;
unsigned short seq; unsigned short seq;
}; };
...@@ -333,8 +333,8 @@ struct msqid_ds32 ...@@ -333,8 +333,8 @@ struct msqid_ds32
unsigned short msg_cbytes; unsigned short msg_cbytes;
unsigned short msg_qnum; unsigned short msg_qnum;
unsigned short msg_qbytes; unsigned short msg_qbytes;
__kernel_ipc_pid_t32 msg_lspid; compat_ipc_pid_t msg_lspid;
__kernel_ipc_pid_t32 msg_lrpid; compat_ipc_pid_t msg_lrpid;
}; };
struct msqid64_ds32 { struct msqid64_ds32 {
...@@ -348,8 +348,8 @@ struct msqid64_ds32 { ...@@ -348,8 +348,8 @@ struct msqid64_ds32 {
unsigned int msg_cbytes; unsigned int msg_cbytes;
unsigned int msg_qnum; unsigned int msg_qnum;
unsigned int msg_qbytes; unsigned int msg_qbytes;
__kernel_pid_t32 msg_lspid; compat_pid_t msg_lspid;
__kernel_pid_t32 msg_lrpid; compat_pid_t msg_lrpid;
unsigned int __unused1; unsigned int __unused1;
unsigned int __unused2; unsigned int __unused2;
}; };
...@@ -361,8 +361,8 @@ struct shmid_ds32 { ...@@ -361,8 +361,8 @@ struct shmid_ds32 {
compat_time_t shm_atime; compat_time_t shm_atime;
compat_time_t shm_dtime; compat_time_t shm_dtime;
compat_time_t shm_ctime; compat_time_t shm_ctime;
__kernel_ipc_pid_t32 shm_cpid; compat_ipc_pid_t shm_cpid;
__kernel_ipc_pid_t32 shm_lpid; compat_ipc_pid_t shm_lpid;
unsigned short shm_nattch; unsigned short shm_nattch;
}; };
...@@ -375,8 +375,8 @@ struct shmid64_ds32 { ...@@ -375,8 +375,8 @@ struct shmid64_ds32 {
unsigned int __pad3; unsigned int __pad3;
compat_time_t shm_ctime; compat_time_t shm_ctime;
compat_size_t shm_segsz; compat_size_t shm_segsz;
__kernel_pid_t32 shm_cpid; compat_pid_t shm_cpid;
__kernel_pid_t32 shm_lpid; compat_pid_t shm_lpid;
unsigned int shm_nattch; unsigned int shm_nattch;
unsigned int __unused1; unsigned int __unused1;
unsigned int __unused2; unsigned int __unused2;
...@@ -1378,6 +1378,9 @@ int cp_compat_stat(struct kstat *stat, struct compat_stat *statbuf) ...@@ -1378,6 +1378,9 @@ int cp_compat_stat(struct kstat *stat, struct compat_stat *statbuf)
{ {
int err; int err;
if (stat->size > MAX_NON_LFS)
return -EOVERFLOW;
err = put_user(stat->dev, &statbuf->st_dev); err = put_user(stat->dev, &statbuf->st_dev);
err |= put_user(stat->ino, &statbuf->st_ino); err |= put_user(stat->ino, &statbuf->st_ino);
err |= put_user(stat->mode, &statbuf->st_mode); err |= put_user(stat->mode, &statbuf->st_mode);
...@@ -1385,8 +1388,6 @@ int cp_compat_stat(struct kstat *stat, struct compat_stat *statbuf) ...@@ -1385,8 +1388,6 @@ int cp_compat_stat(struct kstat *stat, struct compat_stat *statbuf)
err |= put_user(high2lowuid(stat->uid), &statbuf->st_uid); err |= put_user(high2lowuid(stat->uid), &statbuf->st_uid);
err |= put_user(high2lowgid(stat->gid), &statbuf->st_gid); err |= put_user(high2lowgid(stat->gid), &statbuf->st_gid);
err |= put_user(stat->rdev, &statbuf->st_rdev); err |= put_user(stat->rdev, &statbuf->st_rdev);
if (stat->size > MAX_NON_LFS)
return -EOVERFLOW;
err |= put_user(stat->size, &statbuf->st_size); err |= put_user(stat->size, &statbuf->st_size);
err |= put_user(stat->atime.tv_sec, &statbuf->st_atime); err |= put_user(stat->atime.tv_sec, &statbuf->st_atime);
err |= put_user(0, &statbuf->__unused1); err |= put_user(0, &statbuf->__unused1);
...@@ -1412,16 +1413,16 @@ asmlinkage int sys32_sysfs(int option, u32 arg1, u32 arg2) ...@@ -1412,16 +1413,16 @@ asmlinkage int sys32_sysfs(int option, u32 arg1, u32 arg2)
struct ncp_mount_data32_v3 { struct ncp_mount_data32_v3 {
int version; int version;
unsigned int ncp_fd; unsigned int ncp_fd;
__kernel_uid_t32 mounted_uid; compat_uid_t mounted_uid;
__kernel_pid_t32 wdog_pid; compat_pid_t wdog_pid;
unsigned char mounted_vol[NCP_VOLNAME_LEN + 1]; unsigned char mounted_vol[NCP_VOLNAME_LEN + 1];
unsigned int time_out; unsigned int time_out;
unsigned int retry_count; unsigned int retry_count;
unsigned int flags; unsigned int flags;
__kernel_uid_t32 uid; compat_uid_t uid;
__kernel_gid_t32 gid; compat_gid_t gid;
__kernel_mode_t32 file_mode; compat_mode_t file_mode;
__kernel_mode_t32 dir_mode; compat_mode_t dir_mode;
}; };
struct ncp_mount_data32_v4 { struct ncp_mount_data32_v4 {
...@@ -1492,11 +1493,11 @@ static void *do_ncp_super_data_conv(void *raw_data) ...@@ -1492,11 +1493,11 @@ static void *do_ncp_super_data_conv(void *raw_data)
struct smb_mount_data32 { struct smb_mount_data32 {
int version; int version;
__kernel_uid_t32 mounted_uid; compat_uid_t mounted_uid;
__kernel_uid_t32 uid; compat_uid_t uid;
__kernel_gid_t32 gid; compat_gid_t gid;
__kernel_mode_t32 file_mode; compat_mode_t file_mode;
__kernel_mode_t32 dir_mode; compat_mode_t dir_mode;
}; };
static void *do_smb_super_data_conv(void *raw_data) static void *do_smb_super_data_conv(void *raw_data)
...@@ -1656,7 +1657,7 @@ static int put_rusage (struct rusage32 *ru, struct rusage *r) ...@@ -1656,7 +1657,7 @@ static int put_rusage (struct rusage32 *ru, struct rusage *r)
return err; return err;
} }
asmlinkage int sys32_wait4(__kernel_pid_t32 pid, unsigned int *stat_addr, int options, struct rusage32 *ru) asmlinkage int sys32_wait4(compat_pid_t pid, unsigned int *stat_addr, int options, struct rusage32 *ru)
{ {
if (!ru) if (!ru)
return sys_wait4(pid, stat_addr, options, NULL); return sys_wait4(pid, stat_addr, options, NULL);
...@@ -1718,7 +1719,7 @@ asmlinkage int sys32_sysinfo(struct sysinfo32 *info) ...@@ -1718,7 +1719,7 @@ asmlinkage int sys32_sysinfo(struct sysinfo32 *info)
extern asmlinkage int sys_sched_rr_get_interval(pid_t pid, struct timespec *interval); extern asmlinkage int sys_sched_rr_get_interval(pid_t pid, struct timespec *interval);
asmlinkage int sys32_sched_rr_get_interval(__kernel_pid_t32 pid, struct compat_timespec *interval) asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid, struct compat_timespec *interval)
{ {
struct timespec t; struct timespec t;
int ret; int ret;
...@@ -3027,27 +3028,27 @@ struct nfsctl_client32 { ...@@ -3027,27 +3028,27 @@ struct nfsctl_client32 {
struct nfsctl_export32 { struct nfsctl_export32 {
s8 ex32_client[NFSCLNT_IDMAX+1]; s8 ex32_client[NFSCLNT_IDMAX+1];
s8 ex32_path[NFS_MAXPATHLEN+1]; s8 ex32_path[NFS_MAXPATHLEN+1];
__kernel_dev_t32 ex32_dev; compat_dev_t ex32_dev;
__kernel_ino_t32 ex32_ino; compat_ino_t ex32_ino;
s32 ex32_flags; s32 ex32_flags;
__kernel_uid_t32 ex32_anon_uid; compat_uid_t ex32_anon_uid;
__kernel_gid_t32 ex32_anon_gid; compat_gid_t ex32_anon_gid;
}; };
struct nfsctl_uidmap32 { struct nfsctl_uidmap32 {
u32 ug32_ident; /* char * */ u32 ug32_ident; /* char * */
__kernel_uid_t32 ug32_uidbase; compat_uid_t ug32_uidbase;
s32 ug32_uidlen; s32 ug32_uidlen;
u32 ug32_udimap; /* uid_t * */ u32 ug32_udimap; /* uid_t * */
__kernel_uid_t32 ug32_gidbase; compat_uid_t ug32_gidbase;
s32 ug32_gidlen; s32 ug32_gidlen;
u32 ug32_gdimap; /* gid_t * */ u32 ug32_gdimap; /* gid_t * */
}; };
struct nfsctl_fhparm32 { struct nfsctl_fhparm32 {
struct sockaddr gf32_addr; struct sockaddr gf32_addr;
__kernel_dev_t32 gf32_dev; compat_dev_t gf32_dev;
__kernel_ino_t32 gf32_ino; compat_ino_t gf32_ino;
s32 gf32_version; s32 gf32_version;
}; };
...@@ -3176,7 +3177,7 @@ static int nfs_uud32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32) ...@@ -3176,7 +3177,7 @@ static int nfs_uud32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
return -ENOMEM; return -ENOMEM;
for(i = 0; i < karg->ca_umap.ug_uidlen; i++) for(i = 0; i < karg->ca_umap.ug_uidlen; i++)
err |= __get_user(karg->ca_umap.ug_udimap[i], err |= __get_user(karg->ca_umap.ug_udimap[i],
&(((__kernel_uid_t32 *)A(uaddr))[i])); &(((compat_uid_t *)A(uaddr))[i]));
err |= __get_user(karg->ca_umap.ug_gidbase, err |= __get_user(karg->ca_umap.ug_gidbase,
&arg32->ca32_umap.ug32_gidbase); &arg32->ca32_umap.ug32_gidbase);
err |= __get_user(karg->ca_umap.ug_uidlen, err |= __get_user(karg->ca_umap.ug_uidlen,
...@@ -3190,7 +3191,7 @@ static int nfs_uud32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32) ...@@ -3190,7 +3191,7 @@ static int nfs_uud32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32)
return -ENOMEM; return -ENOMEM;
for(i = 0; i < karg->ca_umap.ug_gidlen; i++) for(i = 0; i < karg->ca_umap.ug_gidlen; i++)
err |= __get_user(karg->ca_umap.ug_gdimap[i], err |= __get_user(karg->ca_umap.ug_gdimap[i],
&(((__kernel_gid_t32 *)A(uaddr))[i])); &(((compat_gid_t *)A(uaddr))[i]));
return (err ? -EFAULT : 0); return (err ? -EFAULT : 0);
} }
...@@ -3482,7 +3483,7 @@ asmlinkage compat_ssize_t sys32_readahead(int fd, u32 offhi, u32 offlo, s32 coun ...@@ -3482,7 +3483,7 @@ asmlinkage compat_ssize_t sys32_readahead(int fd, u32 offhi, u32 offlo, s32 coun
extern asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t *offset, size_t count); extern asmlinkage ssize_t sys_sendfile(int out_fd, int in_fd, off_t *offset, size_t count);
asmlinkage int sys32_sendfile(int out_fd, int in_fd, __kernel_off_t32 *offset, s32 count) asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset, s32 count)
{ {
mm_segment_t old_fs = get_fs(); mm_segment_t old_fs = get_fs();
int ret; int ret;
...@@ -3503,7 +3504,7 @@ asmlinkage int sys32_sendfile(int out_fd, int in_fd, __kernel_off_t32 *offset, s ...@@ -3503,7 +3504,7 @@ asmlinkage int sys32_sendfile(int out_fd, int in_fd, __kernel_off_t32 *offset, s
extern asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, loff_t *offset, size_t count); extern asmlinkage ssize_t sys_sendfile64(int out_fd, int in_fd, loff_t *offset, size_t count);
asmlinkage int sys32_sendfile64(int out_fd, int in_fd, __kernel_loff_t32 *offset, s32 count) asmlinkage int sys32_sendfile64(int out_fd, int in_fd, compat_loff_t *offset, s32 count)
{ {
mm_segment_t old_fs = get_fs(); mm_segment_t old_fs = get_fs();
int ret; int ret;
...@@ -3737,7 +3738,7 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 *args) ...@@ -3737,7 +3738,7 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 *args)
extern asmlinkage int sys_sched_setaffinity(pid_t pid, unsigned int len, extern asmlinkage int sys_sched_setaffinity(pid_t pid, unsigned int len,
unsigned long *user_mask_ptr); unsigned long *user_mask_ptr);
asmlinkage int sys32_sched_setaffinity(__kernel_pid_t32 pid, unsigned int len, asmlinkage int sys32_sched_setaffinity(compat_pid_t pid, unsigned int len,
u32 *user_mask_ptr) u32 *user_mask_ptr)
{ {
unsigned long kernel_mask; unsigned long kernel_mask;
...@@ -3761,7 +3762,7 @@ asmlinkage int sys32_sched_setaffinity(__kernel_pid_t32 pid, unsigned int len, ...@@ -3761,7 +3762,7 @@ asmlinkage int sys32_sched_setaffinity(__kernel_pid_t32 pid, unsigned int len,
extern asmlinkage int sys_sched_getaffinity(pid_t pid, unsigned int len, extern asmlinkage int sys_sched_getaffinity(pid_t pid, unsigned int len,
unsigned long *user_mask_ptr); unsigned long *user_mask_ptr);
asmlinkage int sys32_sched_getaffinity(__kernel_pid_t32 pid, unsigned int len, asmlinkage int sys32_sched_getaffinity(compat_pid_t pid, unsigned int len,
u32 *user_mask_ptr) u32 *user_mask_ptr)
{ {
unsigned long kernel_mask; unsigned long kernel_mask;
......
...@@ -798,14 +798,14 @@ asmlinkage int sunos_setpgrp(pid_t pid, pid_t pgid) ...@@ -798,14 +798,14 @@ asmlinkage int sunos_setpgrp(pid_t pid, pid_t pgid)
} }
/* So stupid... */ /* So stupid... */
extern asmlinkage int sys32_wait4(__kernel_pid_t32 pid, extern asmlinkage int sys32_wait4(compat_pid_t pid,
u32 stat_addr, int options, u32 ru); u32 stat_addr, int options, u32 ru);
asmlinkage int sunos_wait4(__kernel_pid_t32 pid, u32 stat_addr, int options, u32 ru) asmlinkage int sunos_wait4(compat_pid_t pid, u32 stat_addr, int options, u32 ru)
{ {
int ret; int ret;
ret = sys32_wait4((pid ? pid : ((__kernel_pid_t32)-1)), ret = sys32_wait4((pid ? pid : ((compat_pid_t)-1)),
stat_addr, options, ru); stat_addr, options, ru);
return ret; return ret;
} }
...@@ -931,11 +931,11 @@ struct msgbuf32 { ...@@ -931,11 +931,11 @@ struct msgbuf32 {
struct ipc_perm32 struct ipc_perm32
{ {
key_t key; key_t key;
__kernel_uid_t32 uid; compat_uid_t uid;
__kernel_gid_t32 gid; compat_gid_t gid;
__kernel_uid_t32 cuid; compat_uid_t cuid;
__kernel_gid_t32 cgid; compat_gid_t cgid;
__kernel_mode_t32 mode; compat_mode_t mode;
unsigned short seq; unsigned short seq;
}; };
...@@ -952,8 +952,8 @@ struct msqid_ds32 ...@@ -952,8 +952,8 @@ struct msqid_ds32
unsigned short msg_cbytes; unsigned short msg_cbytes;
unsigned short msg_qnum; unsigned short msg_qnum;
unsigned short msg_qbytes; unsigned short msg_qbytes;
__kernel_ipc_pid_t32 msg_lspid; compat_ipc_pid_t msg_lspid;
__kernel_ipc_pid_t32 msg_lrpid; compat_ipc_pid_t msg_lrpid;
}; };
static inline int sunos_msqid_get(struct msqid_ds32 *user, static inline int sunos_msqid_get(struct msqid_ds32 *user,
...@@ -1084,8 +1084,8 @@ struct shmid_ds32 { ...@@ -1084,8 +1084,8 @@ struct shmid_ds32 {
compat_time_t shm_atime; compat_time_t shm_atime;
compat_time_t shm_dtime; compat_time_t shm_dtime;
compat_time_t shm_ctime; compat_time_t shm_ctime;
__kernel_ipc_pid_t32 shm_cpid; compat_ipc_pid_t shm_cpid;
__kernel_ipc_pid_t32 shm_lpid; compat_ipc_pid_t shm_lpid;
unsigned short shm_nattch; unsigned short shm_nattch;
}; };
......
...@@ -149,17 +149,17 @@ void data_access_exception (struct pt_regs *regs, ...@@ -149,17 +149,17 @@ void data_access_exception (struct pt_regs *regs,
if (regs->tstate & TSTATE_PRIV) { if (regs->tstate & TSTATE_PRIV) {
/* Test if this comes from uaccess places. */ /* Test if this comes from uaccess places. */
const struct exception_table_entry *entry; unsigned long fixup;
unsigned long g2 = regs->u_regs[UREG_G2]; unsigned long g2 = regs->u_regs[UREG_G2];
if ((entry = search_extables_range(regs->tpc, &g2))) { if ((fixup = search_extables_range(regs->tpc, &g2))) {
/* Ouch, somebody is trying ugly VM hole tricks on us... */ /* Ouch, somebody is trying ugly VM hole tricks on us... */
#ifdef DEBUG_EXCEPTIONS #ifdef DEBUG_EXCEPTIONS
printk("Exception: PC<%016lx> faddr<UNKNOWN>\n", regs->tpc); printk("Exception: PC<%016lx> faddr<UNKNOWN>\n", regs->tpc);
printk("EX_TABLE: insn<%016lx> fixup<%016lx> " printk("EX_TABLE: insn<%016lx> fixup<%016lx> "
"g2<%016lx>\n", regs->tpc, entry->fixup, g2); "g2<%016lx>\n", regs->tpc, fixup, g2);
#endif #endif
regs->tpc = entry->fixup; regs->tpc = fixup;
regs->tnpc = regs->tpc + 4; regs->tnpc = regs->tpc + 4;
regs->u_regs[UREG_G2] = g2; regs->u_regs[UREG_G2] = g2;
return; return;
...@@ -1390,8 +1390,8 @@ void cheetah_deferred_handler(struct pt_regs *regs, unsigned long afsr, unsigned ...@@ -1390,8 +1390,8 @@ void cheetah_deferred_handler(struct pt_regs *regs, unsigned long afsr, unsigned
/* Only perform fixup if we still have a /* Only perform fixup if we still have a
* recoverable condition. * recoverable condition.
*/ */
if (entry && recoverable) { if (recoverable) {
regs->tpc = entry->fixup; regs->tpc = fixup;
regs->tnpc = regs->tpc + 4; regs->tnpc = regs->tpc + 4;
regs->u_regs[UREG_G2] = g2; regs->u_regs[UREG_G2] = g2;
} }
......
...@@ -361,7 +361,7 @@ void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) __asm__ ("ke ...@@ -361,7 +361,7 @@ void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) __asm__ ("ke
void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
{ {
unsigned long g2 = regs->u_regs [UREG_G2]; unsigned long g2 = regs->u_regs [UREG_G2];
unsigned long fixup = search_exception_table (regs->tpc, &g2); unsigned long fixup = search_extables_range(regs->tpc, &g2);
if (!fixup) { if (!fixup) {
unsigned long address = compute_effective_address(regs, insn, ((insn >> 25) & 0x1f)); unsigned long address = compute_effective_address(regs, insn, ((insn >> 25) & 0x1f));
......
...@@ -31,7 +31,7 @@ search_extable(const struct exception_table_entry *start, ...@@ -31,7 +31,7 @@ search_extable(const struct exception_table_entry *start,
*/ */
/* 1. Try to find an exact match. */ /* 1. Try to find an exact match. */
for (walk = start; walk <= end; walk++) { for (walk = start; walk <= last; walk++) {
if (walk->fixup == 0) { if (walk->fixup == 0) {
/* A range entry, skip both parts. */ /* A range entry, skip both parts. */
walk++; walk++;
...@@ -43,7 +43,7 @@ search_extable(const struct exception_table_entry *start, ...@@ -43,7 +43,7 @@ search_extable(const struct exception_table_entry *start,
} }
/* 2. Try to find a range match. */ /* 2. Try to find a range match. */
for (walk = start; walk <= (end - 1); walk++) { for (walk = start; walk <= (last - 1); walk++) {
if (walk->fixup) if (walk->fixup)
continue; continue;
......
...@@ -286,7 +286,7 @@ static void do_kernel_fault(struct pt_regs *regs, int si_code, int fault_code, ...@@ -286,7 +286,7 @@ static void do_kernel_fault(struct pt_regs *regs, int si_code, int fault_code,
/* Look in asi.h: All _S asis have LS bit set */ /* Look in asi.h: All _S asis have LS bit set */
if ((asi & 0x1) && if ((asi & 0x1) &&
(fizup = search_extables_range(regs->tpc, &g2))) { (fixup = search_extables_range(regs->tpc, &g2))) {
regs->tpc = fixup; regs->tpc = fixup;
regs->tnpc = regs->tpc + 4; regs->tnpc = regs->tpc + 4;
regs->u_regs[UREG_G2] = g2; regs->u_regs[UREG_G2] = g2;
......
...@@ -886,7 +886,7 @@ static void probeLptPort(unsigned idx) ...@@ -886,7 +886,7 @@ static void probeLptPort(unsigned idx)
instances[idx].run_flag = 0; instances[idx].run_flag = 0;
init_timer(&instances[idx].timer_list); init_timer(&instances[idx].timer_list);
instances[idx].timer_list.function = bpp_wake_up; instances[idx].timer_list.function = bpp_wake_up;
if (check_region(lpAddr,3)) return; if (!request_region(lpAddr,3, dev_name)) return;
/* /*
* First, make sure the instance exists. Do this by writing to * First, make sure the instance exists. Do this by writing to
...@@ -904,7 +904,6 @@ static void probeLptPort(unsigned idx) ...@@ -904,7 +904,6 @@ static void probeLptPort(unsigned idx)
unsigned save; unsigned save;
instances[idx].present = 1; instances[idx].present = 1;
request_region(lpAddr,3, dev_name);
save = inb_p(lpAddr+2); save = inb_p(lpAddr+2);
for (testvalue=0; testvalue<BPP_DELAY; testvalue++) for (testvalue=0; testvalue<BPP_DELAY; testvalue++)
; ;
...@@ -921,7 +920,9 @@ static void probeLptPort(unsigned idx) ...@@ -921,7 +920,9 @@ static void probeLptPort(unsigned idx)
instances[idx].enhanced = 1; instances[idx].enhanced = 1;
outb_p(save, lpAddr+2); outb_p(save, lpAddr+2);
} }
else {
release_region(lpAddr,3);
}
/* /*
* Leave the port in compat idle mode. * Leave the port in compat idle mode.
*/ */
......
...@@ -892,6 +892,10 @@ static void envctrl_init_i2c_child(struct linux_ebus_child *edev_child, ...@@ -892,6 +892,10 @@ static void envctrl_init_i2c_child(struct linux_ebus_child *edev_child,
} }
pchild->tables = kmalloc(tbls_size, GFP_KERNEL); pchild->tables = kmalloc(tbls_size, GFP_KERNEL);
if (pchild->tables == NULL){
printk("envctrl: Failed to allocate table.\n");
return;
}
len = prom_getproperty(node, "tables", len = prom_getproperty(node, "tables",
(char *) pchild->tables, tbls_size); (char *) pchild->tables, tbls_size);
if (len <= 0) { if (len <= 0) {
......
...@@ -11,26 +11,19 @@ typedef u32 compat_size_t; ...@@ -11,26 +11,19 @@ typedef u32 compat_size_t;
typedef s32 compat_ssize_t; typedef s32 compat_ssize_t;
typedef s32 compat_time_t; typedef s32 compat_time_t;
typedef s32 compat_clock_t; typedef s32 compat_clock_t;
typedef s32 compat_pid_t;
struct compat_stat { typedef u16 compat_uid_t;
__kernel_dev_t32 st_dev; typedef u16 compat_gid_t;
__kernel_ino_t32 st_ino; typedef u16 compat_mode_t;
__kernel_mode_t32 st_mode; typedef u32 compat_ino_t;
s16 st_nlink; typedef u16 compat_dev_t;
__kernel_uid_t32 st_uid; typedef s32 compat_off_t;
__kernel_gid_t32 st_gid; typedef s64 compat_loff_t;
__kernel_dev_t32 st_rdev; typedef s16 compat_nlink_t;
__kernel_off_t32 st_size; typedef u16 compat_ipc_pid_t;
compat_time_t st_atime; typedef s32 compat_daddr_t;
u32 __unused1; typedef u32 compat_caddr_t;
compat_time_t st_mtime; typedef __kernel_fsid_t compat_fsid_t;
u32 __unused2;
compat_time_t st_ctime;
u32 __unused3;
__kernel_off_t32 st_blksize;
__kernel_off_t32 st_blocks;
u32 __unused4[2];
};
struct compat_timespec { struct compat_timespec {
compat_time_t tv_sec; compat_time_t tv_sec;
...@@ -42,12 +35,32 @@ struct compat_timeval { ...@@ -42,12 +35,32 @@ struct compat_timeval {
s32 tv_usec; s32 tv_usec;
}; };
struct compat_stat {
compat_dev_t st_dev;
compat_ino_t st_ino;
compat_mode_t st_mode;
compat_nlink_t st_nlink;
compat_uid_t st_uid;
compat_gid_t st_gid;
compat_dev_t st_rdev;
compat_off_t st_size;
compat_time_t st_atime;
u32 __unused1;
compat_time_t st_mtime;
u32 __unused2;
compat_time_t st_ctime;
u32 __unused3;
compat_off_t st_blksize;
compat_off_t st_blocks;
u32 __unused4[2];
};
struct compat_flock { struct compat_flock {
short l_type; short l_type;
short l_whence; short l_whence;
__kernel_off_t32 l_start; compat_off_t l_start;
__kernel_off_t32 l_len; compat_off_t l_len;
__kernel_pid_t32 l_pid; compat_pid_t l_pid;
short __unused; short __unused;
}; };
......
...@@ -47,23 +47,6 @@ typedef struct { ...@@ -47,23 +47,6 @@ typedef struct {
#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */ #endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
} __kernel_fsid_t; } __kernel_fsid_t;
/* Now 32bit compatibility types */
typedef int __kernel_ptrdiff_t32;
typedef int __kernel_pid_t32;
typedef unsigned short __kernel_ipc_pid_t32;
typedef unsigned short __kernel_uid_t32;
typedef unsigned short __kernel_gid_t32;
typedef unsigned short __kernel_dev_t32;
typedef unsigned int __kernel_ino_t32;
typedef unsigned short __kernel_mode_t32;
typedef unsigned short __kernel_umode_t32;
typedef short __kernel_nlink_t32;
typedef int __kernel_daddr_t32;
typedef int __kernel_off_t32;
typedef unsigned int __kernel_caddr_t32;
typedef long __kernel_loff_t32;
typedef __kernel_fsid_t __kernel_fsid_t32;
#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
#undef __FD_SET #undef __FD_SET
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <asm/compat.h> #include <linux/compat.h>
typedef union sigval32 { typedef union sigval32 {
int sival_int; int sival_int;
...@@ -30,7 +30,7 @@ typedef struct siginfo32 { ...@@ -30,7 +30,7 @@ typedef struct siginfo32 {
/* kill() */ /* kill() */
struct { struct {
__kernel_pid_t32 _pid; /* sender's pid */ compat_pid_t _pid; /* sender's pid */
unsigned int _uid; /* sender's uid */ unsigned int _uid; /* sender's uid */
} _kill; } _kill;
...@@ -42,14 +42,14 @@ typedef struct siginfo32 { ...@@ -42,14 +42,14 @@ typedef struct siginfo32 {
/* POSIX.1b signals */ /* POSIX.1b signals */
struct { struct {
__kernel_pid_t32 _pid; /* sender's pid */ compat_pid_t _pid; /* sender's pid */
unsigned int _uid; /* sender's uid */ unsigned int _uid; /* sender's uid */
sigval_t32 _sigval; sigval_t32 _sigval;
} _rt; } _rt;
/* SIGCHLD */ /* SIGCHLD */
struct { struct {
__kernel_pid_t32 _pid; /* which child */ compat_pid_t _pid; /* which child */
unsigned int _uid; /* sender's uid */ unsigned int _uid; /* sender's uid */
int _status; /* exit code */ int _status; /* exit code */
compat_clock_t _utime; compat_clock_t _utime;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef __KERNEL_STRICT_NAMES #ifndef __KERNEL_STRICT_NAMES
#include <linux/types.h> #include <linux/types.h>
#include <linux/compat.h> /* for compat_fsid_t */
typedef __kernel_fsid_t fsid_t; typedef __kernel_fsid_t fsid_t;
...@@ -18,7 +19,7 @@ struct statfs32 { ...@@ -18,7 +19,7 @@ struct statfs32 {
int f_bavail; int f_bavail;
int f_files; int f_files;
int f_ffree; int f_ffree;
__kernel_fsid_t32 f_fsid; compat_fsid_t f_fsid;
int f_namelen; /* SunOS ignores this field. */ int f_namelen; /* SunOS ignores this field. */
int f_spare[6]; int f_spare[6];
}; };
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <linux/string.h>
#include <linux/sunrpc/msg_prot.h> #include <linux/sunrpc/msg_prot.h>
#include <linux/sunrpc/cache.h> #include <linux/sunrpc/cache.h>
#include <linux/string.h> #include <linux/string.h>
......
...@@ -273,7 +273,7 @@ void __init pidhash_init(void) ...@@ -273,7 +273,7 @@ void __init pidhash_init(void)
pidhash_shift = min(12, pidhash_shift); pidhash_shift = min(12, pidhash_shift);
pidhash_size = 1 << pidhash_shift; pidhash_size = 1 << pidhash_shift;
printk("PID hash table entries: %d (order %d: %d bytes)\n", printk("PID hash table entries: %d (order %d: %Zd bytes)\n",
pidhash_size, pidhash_shift, pidhash_size, pidhash_shift,
pidhash_size * sizeof(struct list_head)); pidhash_size * sizeof(struct list_head));
......
...@@ -92,7 +92,7 @@ u32 attribute((pure)) crc32_le(u32 crc, unsigned char const *p, size_t len) ...@@ -92,7 +92,7 @@ u32 attribute((pure)) crc32_le(u32 crc, unsigned char const *p, size_t len)
crc = __cpu_to_le32(crc); crc = __cpu_to_le32(crc);
/* Align it */ /* Align it */
for ( ; ((u32)b)&3 && len ; len--){ for ( ; ((long)b)&3 && len ; len--){
# ifdef __LITTLE_ENDIAN # ifdef __LITTLE_ENDIAN
crc = (crc>>8) ^ crc32table_le[ (crc ^ *((u8 *)b)++) & 0xff ]; crc = (crc>>8) ^ crc32table_le[ (crc ^ *((u8 *)b)++) & 0xff ];
# else # else
...@@ -201,7 +201,7 @@ u32 attribute((pure)) crc32_be(u32 crc, unsigned char const *p, size_t len) ...@@ -201,7 +201,7 @@ u32 attribute((pure)) crc32_be(u32 crc, unsigned char const *p, size_t len)
crc = __cpu_to_be32(crc); crc = __cpu_to_be32(crc);
/* Align it */ /* Align it */
for ( ; ((u32)b)&3 && len ; len--){ for ( ; ((long)b)&3 && len ; len--){
# ifdef __LITTLE_ENDIAN # ifdef __LITTLE_ENDIAN
crc = (crc>>8) ^ crc32table_be[ (crc ^ *((u8 *)b)++) & 0xff ]; crc = (crc>>8) ^ crc32table_be[ (crc ^ *((u8 *)b)++) & 0xff ];
# else # else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment