|
From: James S. <jsi...@us...> - 2002-05-03 22:16:50
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/ppc64/kernel
In directory usw-pr-cvs1:/tmp/cvs-serv29603/linux/arch/ppc64/kernel
Modified Files:
chrp_setup.c iSeries_setup.c ioctl32.c open_pic.c setup.c
Log Message:
Synced against 2.5.13
Index: chrp_setup.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc64/kernel/chrp_setup.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- chrp_setup.c 16 Apr 2002 17:41:49 -0000 1.2
+++ chrp_setup.c 3 May 2002 22:16:46 -0000 1.3
@@ -56,7 +56,7 @@
#include <asm/irq.h>
#include <asm/keyboard.h>
#include <asm/init.h>
-#include <asm/Naca.h>
+#include <asm/naca.h>
#include <asm/time.h>
#include "local_irq.h"
@@ -66,7 +66,6 @@
#include <asm/ppcdebug.h>
extern volatile unsigned char *chrp_int_ack_special;
-extern struct Naca *naca;
void chrp_setup_pci_ptrs(void);
void chrp_progress(char *, unsigned short);
@@ -82,6 +81,9 @@
extern void pSeries_get_rtc_time(struct rtc_time *rtc_time);
extern int pSeries_set_rtc_time(struct rtc_time *rtc_time);
void pSeries_calibrate_decr(void);
+static void fwnmi_init(void);
+extern void SystemReset_FWNMI(void), MachineCheck_FWNMI(void); /* from head.S */
+int fwnmi_active; /* TRUE if an FWNMI handler is present */
kdev_t boot_dev;
unsigned long virtPython0Facilities = 0; // python0 facility area (memory mapped io) (64-bit format) VIRTUAL address.
@@ -144,6 +146,8 @@
printk("Boot arguments: %s\n", cmd_line);
+ fwnmi_init();
+
/* Find and initialize PCI host bridges */
/* iSeries needs to be done much later. */
#ifndef CONFIG_PPC_ISERIES
@@ -181,6 +185,23 @@
ppc_md.progress(UTS_RELEASE, 0x7777);
}
+/* Initialize firmware assisted non-maskable interrupts if
+ * the firmware supports this feature.
+ *
+ */
+static void __init fwnmi_init(void)
+{
+ long ret;
+ int ibm_nmi_register = rtas_token("ibm,nmi-register");
+ if (ibm_nmi_register == RTAS_UNKNOWN_SERVICE)
+ return;
+ ret = rtas_call(ibm_nmi_register, 2, 1, NULL,
+ __pa((unsigned long)SystemReset_FWNMI),
+ __pa((unsigned long)MachineCheck_FWNMI));
+ if (ret == 0)
+ fwnmi_active = 1;
+}
+
/* Early initialization. Relocation is on but do not reference unbolted pages */
void __init pSeries_init_early(void)
@@ -221,7 +242,7 @@
#endif /* CONFIG_BLK_DEV_INITRD */
#endif
- ppc_md.ppc_machine = _machine;
+ ppc_md.ppc_machine = naca->platform;
ppc_md.setup_arch = chrp_setup_arch;
ppc_md.setup_residual = NULL;
@@ -229,11 +250,9 @@
if(naca->interrupt_controller == IC_OPEN_PIC) {
ppc_md.init_IRQ = openpic_init_IRQ;
ppc_md.get_irq = openpic_get_irq;
- ppc_md.post_irq = NULL;
} else {
ppc_md.init_IRQ = xics_init_IRQ;
ppc_md.get_irq = xics_get_irq;
- ppc_md.post_irq = NULL;
}
ppc_md.init_ras_IRQ = init_ras_IRQ;
@@ -273,7 +292,7 @@
if (hex)
udbg_printf("<chrp_progress> %s\n", s);
- if (!rtas.base || (_machine != _MACH_pSeries))
+ if (!rtas.base || (naca->platform != PLATFORM_PSERIES))
return;
if (max_width == 0) {
Index: iSeries_setup.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc64/kernel/iSeries_setup.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- iSeries_setup.c 16 Apr 2002 17:41:49 -0000 1.2
+++ iSeries_setup.c 3 May 2002 22:16:46 -0000 1.3
@@ -37,8 +37,8 @@
#include <asm/time.h>
#include "iSeries_setup.h"
-#include <asm/Naca.h>
-#include <asm/Paca.h>
+#include <asm/naca.h>
+#include <asm/paca.h>
#include <asm/iSeries/LparData.h>
#include <asm/iSeries/HvCallHpt.h>
#include <asm/iSeries/HvLpConfig.h>
@@ -85,7 +85,6 @@
extern char _end[];
-extern struct Naca *naca;
extern int rd_size; /* Defined in drivers/block/rd.c */
extern unsigned long klimit;
extern unsigned long embedded_sysmap_start;
@@ -296,7 +295,7 @@
initrd_start = (unsigned long)__va(naca->xRamDisk);
initrd_end = initrd_start + naca->xRamDiskSize * PAGE_SIZE;
initrd_below_start_ok = 1; // ramdisk in kernel space
- ROOT_DEV = MKDEV( RAMDISK_MAJOR, 0 );
+ ROOT_DEV = mk_kdev( RAMDISK_MAJOR, 0 );
if ( ((rd_size*1024)/PAGE_SIZE) < naca->xRamDiskSize )
rd_size = (naca->xRamDiskSize*PAGE_SIZE)/1024;
@@ -305,7 +304,7 @@
#endif /* CONFIG_BLK_DEV_INITRD */
{
- /* ROOT_DEV = MKDEV( VIODASD_MAJOR, 1 ); */
+ /* ROOT_DEV = mk_kdev( VIODASD_MAJOR, 1 ); */
}
iSeries_recal_tb = get_tb();
@@ -878,13 +877,13 @@
{
if ( dprof_buffer ) {
unsigned i;
- for (i=0; i<maxPacas; ++i) {
- xPaca[i].prof_shift = dprof_shift;
- xPaca[i].prof_len = dprof_len-1;
- xPaca[i].prof_buffer = dprof_buffer;
- xPaca[i].prof_stext = (unsigned *)&_stext;
+ for (i=0; i<MAX_PACAS; ++i) {
+ paca[i].prof_shift = dprof_shift;
+ paca[i].prof_len = dprof_len-1;
+ paca[i].prof_buffer = dprof_buffer;
+ paca[i].prof_stext = (unsigned *)&_stext;
mb();
- xPaca[i].prof_enabled = 1;
+ paca[i].prof_enabled = 1;
}
}
}
Index: ioctl32.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc64/kernel/ioctl32.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ioctl32.c 16 Apr 2002 17:41:49 -0000 1.3
+++ ioctl32.c 3 May 2002 22:16:46 -0000 1.4
@@ -44,6 +44,7 @@
#include <linux/ppp_defs.h>
#include <linux/if_ppp.h>
#include <linux/if_pppox.h>
+#include <linux/if_tun.h>
#include <linux/mtio.h>
#include <linux/cdrom.h>
#include <linux/loop.h>
@@ -102,20 +103,10 @@
#include <linux/usb.h>
#include <linux/usbdevice_fs.h>
#include <linux/nbd.h>
+#include <linux/random.h>
#include <asm/ppc32.h>
#include <asm/ppcdebug.h>
-/* Use this to get at 32-bit user passed pointers.
- See sys_sparc32.c for description about these. */
-#define A(__x) ((unsigned long)(__x))
-#define AA(__x) \
-({ unsigned long __ret; \
- __asm__ ("clrldi %0, %0, 32" \
- : "=r" (__ret) \
- : "0" (__x)); \
- __ret; \
-})
-
/* Aiee. Someone does not find a difference between int and long */
#define EXT2_IOC32_GETFLAGS _IOR('f', 1, int)
#define EXT2_IOC32_SETFLAGS _IOW('f', 2, int)
@@ -480,6 +471,7 @@
return -ENODEV;
strcpy(ifr32.ifr_name, dev->name);
+ dev_put(dev);
err = copy_to_user((struct ifreq32 *)arg, &ifr32, sizeof(struct ifreq32));
return (err ? -EFAULT : 0);
@@ -1168,6 +1160,234 @@
return err;
}
+typedef struct sg_io_hdr32 {
+ s32 interface_id; /* [i] 'S' for SCSI generic (required) */
+ s32 dxfer_direction; /* [i] data transfer direction */
+ u8 cmd_len; /* [i] SCSI command length ( <= 16 bytes) */
+ u8 mx_sb_len; /* [i] max length to write to sbp */
+ u16 iovec_count; /* [i] 0 implies no scatter gather */
+ u32 dxfer_len; /* [i] byte count of data transfer */
+ u32 dxferp; /* [i], [*io] points to data transfer memory
+ or scatter gather list */
+ u32 cmdp; /* [i], [*i] points to command to perform */
+ u32 sbp; /* [i], [*o] points to sense_buffer memory */
+ u32 timeout; /* [i] MAX_UINT->no timeout (unit: millisec) */
+ u32 flags; /* [i] 0 -> default, see SG_FLAG... */
+ s32 pack_id; /* [i->o] unused internally (normally) */
+ u32 usr_ptr; /* [i->o] unused internally */
+ u8 status; /* [o] scsi status */
+ u8 masked_status; /* [o] shifted, masked scsi status */
+ u8 msg_status; /* [o] messaging level data (optional) */
+ u8 sb_len_wr; /* [o] byte count actually written to sbp */
+ u16 host_status; /* [o] errors from host adapter */
+ u16 driver_status; /* [o] errors from software driver */
+ s32 resid; /* [o] dxfer_len - actual_transferred */
+ u32 duration; /* [o] time taken by cmd (unit: millisec) */
+ u32 info; /* [o] auxiliary information */
+} sg_io_hdr32_t; /* 64 bytes long (on sparc32) */
+
+typedef struct sg_iovec32 {
+ u32 iov_base;
+ u32 iov_len;
+} sg_iovec32_t;
+
+static int alloc_sg_iovec(sg_io_hdr_t *sgp, u32 uptr32)
+{
+ sg_iovec32_t *uiov = (sg_iovec32_t *) A(uptr32);
+ sg_iovec_t *kiov;
+ int i;
+
+ sgp->dxferp = kmalloc(sgp->iovec_count *
+ sizeof(sg_iovec_t), GFP_KERNEL);
+ if (!sgp->dxferp)
+ return -ENOMEM;
+ memset(sgp->dxferp, 0,
+ sgp->iovec_count * sizeof(sg_iovec_t));
+
+ kiov = (sg_iovec_t *) sgp->dxferp;
+ for (i = 0; i < sgp->iovec_count; i++) {
+ u32 iov_base32;
+ if (__get_user(iov_base32, &uiov->iov_base) ||
+ __get_user(kiov->iov_len, &uiov->iov_len))
+ return -EFAULT;
+
+ kiov->iov_base = kmalloc(kiov->iov_len, GFP_KERNEL);
+ if (!kiov->iov_base)
+ return -ENOMEM;
+ if (copy_from_user(kiov->iov_base,
+ (void *) A(iov_base32),
+ kiov->iov_len))
+ return -EFAULT;
+
+ uiov++;
+ kiov++;
+ }
+
+ return 0;
+}
+
+static int copy_back_sg_iovec(sg_io_hdr_t *sgp, u32 uptr32)
+{
+ sg_iovec32_t *uiov = (sg_iovec32_t *) A(uptr32);
+ sg_iovec_t *kiov = (sg_iovec_t *) sgp->dxferp;
+ int i;
+
+ for (i = 0; i < sgp->iovec_count; i++) {
+ u32 iov_base32;
+
+ if (__get_user(iov_base32, &uiov->iov_base))
+ return -EFAULT;
+
+ if (copy_to_user((void *) A(iov_base32),
+ kiov->iov_base,
+ kiov->iov_len))
+ return -EFAULT;
+
+ uiov++;
+ kiov++;
+ }
+
+ return 0;
+}
+
+static void free_sg_iovec(sg_io_hdr_t *sgp)
+{
+ sg_iovec_t *kiov = (sg_iovec_t *) sgp->dxferp;
+ int i;
+
+ for (i = 0; i < sgp->iovec_count; i++) {
+ if (kiov->iov_base) {
+ kfree(kiov->iov_base);
+ kiov->iov_base = NULL;
+ }
+ kiov++;
+ }
+ kfree(sgp->dxferp);
+ sgp->dxferp = NULL;
+}
+
+static int sg_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+ sg_io_hdr32_t *sg_io32;
+ sg_io_hdr_t sg_io64;
+ u32 dxferp32, cmdp32, sbp32;
+ mm_segment_t old_fs;
+ int err = 0;
+
+ sg_io32 = (sg_io_hdr32_t *)arg;
+ err = __get_user(sg_io64.interface_id, &sg_io32->interface_id);
+ err |= __get_user(sg_io64.dxfer_direction, &sg_io32->dxfer_direction);
+ err |= __get_user(sg_io64.cmd_len, &sg_io32->cmd_len);
+ err |= __get_user(sg_io64.mx_sb_len, &sg_io32->mx_sb_len);
+ err |= __get_user(sg_io64.iovec_count, &sg_io32->iovec_count);
+ err |= __get_user(sg_io64.dxfer_len, &sg_io32->dxfer_len);
+ err |= __get_user(sg_io64.timeout, &sg_io32->timeout);
+ err |= __get_user(sg_io64.flags, &sg_io32->flags);
+ err |= __get_user(sg_io64.pack_id, &sg_io32->pack_id);
+
+ sg_io64.dxferp = NULL;
+ sg_io64.cmdp = NULL;
+ sg_io64.sbp = NULL;
+
+ err |= __get_user(cmdp32, &sg_io32->cmdp);
+ sg_io64.cmdp = kmalloc(sg_io64.cmd_len, GFP_KERNEL);
+ if (!sg_io64.cmdp) {
+ err = -ENOMEM;
+ goto out;
+ }
+ if (copy_from_user(sg_io64.cmdp,
+ (void *) A(cmdp32),
+ sg_io64.cmd_len)) {
+ err = -EFAULT;
+ goto out;
+ }
+
+ err |= __get_user(sbp32, &sg_io32->sbp);
+ sg_io64.sbp = kmalloc(sg_io64.mx_sb_len, GFP_KERNEL);
+ if (!sg_io64.sbp) {
+ err = -ENOMEM;
+ goto out;
+ }
+ if (copy_from_user(sg_io64.sbp,
+ (void *) A(sbp32),
+ sg_io64.mx_sb_len)) {
+ err = -EFAULT;
+ goto out;
+ }
+
+ err |= __get_user(dxferp32, &sg_io32->dxferp);
+ if (sg_io64.iovec_count) {
+ int ret;
+
+ if ((ret = alloc_sg_iovec(&sg_io64, dxferp32))) {
+ err = ret;
+ goto out;
+ }
+ } else {
+ sg_io64.dxferp = kmalloc(sg_io64.dxfer_len, GFP_KERNEL);
+ if (!sg_io64.dxferp) {
+ err = -ENOMEM;
+ goto out;
+ }
+ if (copy_from_user(sg_io64.dxferp,
+ (void *) A(dxferp32),
+ sg_io64.dxfer_len)) {
+ err = -EFAULT;
+ goto out;
+ }
+ }
+
+ /* Unused internally, do not even bother to copy it over. */
+ sg_io64.usr_ptr = NULL;
+
+ if (err)
+ return -EFAULT;
+
+ old_fs = get_fs();
+ set_fs (KERNEL_DS);
+ err = sys_ioctl (fd, cmd, (unsigned long) &sg_io64);
+ set_fs (old_fs);
+
+ if (err < 0)
+ goto out;
+
+ err = __put_user(sg_io64.pack_id, &sg_io32->pack_id);
+ err |= __put_user(sg_io64.status, &sg_io32->status);
+ err |= __put_user(sg_io64.masked_status, &sg_io32->masked_status);
+ err |= __put_user(sg_io64.msg_status, &sg_io32->msg_status);
+ err |= __put_user(sg_io64.sb_len_wr, &sg_io32->sb_len_wr);
+ err |= __put_user(sg_io64.host_status, &sg_io32->host_status);
+ err |= __put_user(sg_io64.driver_status, &sg_io32->driver_status);
+ err |= __put_user(sg_io64.resid, &sg_io32->resid);
+ err |= __put_user(sg_io64.duration, &sg_io32->duration);
+ err |= __put_user(sg_io64.info, &sg_io32->info);
+ err |= copy_to_user((void *)A(sbp32), sg_io64.sbp, sg_io64.mx_sb_len);
+ if (sg_io64.dxferp) {
+ if (sg_io64.iovec_count)
+ err |= copy_back_sg_iovec(&sg_io64, dxferp32);
+ else
+ err |= copy_to_user((void *)A(dxferp32),
+ sg_io64.dxferp,
+ sg_io64.dxfer_len);
+ }
+ if (err)
+ err = -EFAULT;
+
+out:
+ if (sg_io64.cmdp)
+ kfree(sg_io64.cmdp);
+ if (sg_io64.sbp)
+ kfree(sg_io64.sbp);
+ if (sg_io64.dxferp) {
+ if (sg_io64.iovec_count) {
+ free_sg_iovec(&sg_io64);
+ } else {
+ kfree(sg_io64.dxferp);
+ }
+ }
+ return err;
+}
+
struct ppp_option_data32 {
__kernel_caddr_t32 ptr;
__u32 length;
@@ -3066,13 +3286,12 @@
return rw_long(fd, AUTOFS_IOC_SETTIMEOUT, arg);
}
-#if 0
struct usbdevfs_ctrltransfer32 {
- __u8 requesttype;
- __u8 request;
- __u16 value;
- __u16 index;
- __u16 length;
+ __u8 bRequestType;
+ __u8 bRequest;
+ __u16 wValue;
+ __u16 wIndex;
+ __u16 wLength;
__u32 timeout; /* in milliseconds */
__u32 data;
};
@@ -3102,14 +3321,14 @@
/* In usbdevice_fs, it limits the control buffer to a page,
* for simplicity so do we.
*/
- if (!uptr || kctrl.length > PAGE_SIZE)
+ if (!uptr || kctrl.wLength > PAGE_SIZE)
return -EINVAL;
kptr = (void *)__get_free_page(GFP_KERNEL);
- if ((kctrl.requesttype & 0x80) == 0) {
+ if ((kctrl.bRequestType & 0x80) == 0) {
err = -EFAULT;
- if (copy_from_user(kptr, uptr, kctrl.length))
+ if (copy_from_user(kptr, uptr, kctrl.wLength))
goto out;
}
@@ -3121,8 +3340,8 @@
set_fs(old_fs);
if (err >= 0 &&
- ((kctrl.requesttype & 0x80) != 0)) {
- if (copy_to_user(uptr, kptr, kctrl.length))
+ ((kctrl.bRequestType & 0x80) != 0)) {
+ if (copy_to_user(uptr, kptr, kctrl.wLength))
err = -EFAULT;
}
@@ -3457,7 +3676,6 @@
return err;
}
-#endif
struct mtd_oob_buf32 {
u32 start;
@@ -3515,119 +3733,6 @@
return ((0 == ret) ? 0 : -EFAULT);
}
-struct sg_io_hdr_32
-{
- int interface_id;
- int dxfer_direction;
- unsigned char cmd_len;
- unsigned char mx_sb_len;
- unsigned short iovec_count;
- unsigned int dxfer_len;
- u32 dxferp;
- u32 cmdp;
- u32 sbp;
- unsigned int timeout;
- unsigned int flags;
- int pack_id;
- u32 usr_ptr;
- unsigned char status;
- unsigned char masked_status;
- unsigned char msg_status;
- unsigned char sb_len_wr;
- unsigned short host_status;
- unsigned short driver_status;
- int resid;
- unsigned int duration;
- unsigned int info;
-};
-
-static int do_sg_io(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
- struct sg_io_hdr *sg = kmalloc(sizeof(struct sg_io_hdr), GFP_KERNEL);
- struct sg_io_hdr_32 *sg_32 = (struct sg_io_hdr_32 *)arg;
- u32 dxferp_32;
- u32 cmdp_32;
- u32 sbp_32;
- u32 usr_ptr_32;
- int ret = -EFAULT;
- int err;
- mm_segment_t old_fs = get_fs();
-
- if (!sg)
- return -ENOMEM;
-
- memset(sg, 0, sizeof(*sg));
-
- err = copy_from_user(sg, sg_32, offsetof(struct sg_io_hdr, dxferp));
- err |= __get_user(dxferp_32, &sg_32->dxferp);
- err |= __get_user(cmdp_32, &sg_32->cmdp);
- err |= __get_user(sbp_32, &sg_32->sbp);
-
- if (err)
- goto error;
-
- sg->dxferp = (void *)A(dxferp_32);
- sg->cmdp = (void *)A(cmdp_32);
- sg->sbp = (void *)A(sbp_32);
-
- err = __copy_from_user(&sg->timeout, &sg_32->timeout,
- (long)&sg->usr_ptr - (long)&sg->timeout);
-
- err |= __get_user(usr_ptr_32, &sg_32->usr_ptr);
-
- if (err)
- goto error;
-
- sg->usr_ptr = (void *)A(usr_ptr_32);
-
- err = __copy_from_user(&sg->status, &sg_32->status,
- sizeof(struct sg_io_hdr) -
- offsetof(struct sg_io_hdr, status));
-
- if (err)
- goto error;
-
- set_fs(KERNEL_DS);
- ret = sys_ioctl(fd, cmd, (unsigned long)sg);
- set_fs(old_fs);
-
- err = copy_to_user(sg_32, sg, offsetof(struct sg_io_hdr, dxferp));
-
- dxferp_32 = (unsigned long)sg->dxferp;
- cmdp_32 = (unsigned long)sg->cmdp;
- sbp_32 = (unsigned long)sg->sbp;
- err |= __put_user(dxferp_32, &sg_32->dxferp);
- err |= __put_user(cmdp_32, &sg_32->cmdp);
- err |= __put_user(sbp_32, &sg_32->sbp);
-
- if (err) {
- ret = -EFAULT;
- goto error;
- }
-
- err = __copy_to_user(&sg_32->timeout, &sg->timeout,
- (long)&sg->usr_ptr - (long)&sg->timeout);
-
- usr_ptr_32 = (unsigned long)sg->usr_ptr;
- err |= __put_user(usr_ptr_32, &sg_32->usr_ptr);
-
- if (err) {
- ret = -EFAULT;
- goto error;
- }
-
- err = __copy_to_user(&sg_32->status, &sg->status,
- sizeof(struct sg_io_hdr) -
- offsetof(struct sg_io_hdr, status));
-
- if (err)
- ret = -EFAULT;
-
-error:
- kfree(sg);
- return ret;
-}
-
struct ioctl_trans {
unsigned long cmd;
unsigned long handler;
@@ -3714,7 +3819,6 @@
*/
COMPATIBLE_IOCTL(HDIO_GET_IDENTITY),
COMPATIBLE_IOCTL(HDIO_SET_DMA),
-COMPATIBLE_IOCTL(HDIO_SET_KEEPSETTINGS),
COMPATIBLE_IOCTL(HDIO_SET_UNMASKINTR),
COMPATIBLE_IOCTL(HDIO_SET_NOWERR),
COMPATIBLE_IOCTL(HDIO_SET_32BIT),
@@ -3805,6 +3909,7 @@
/* Big S */
COMPATIBLE_IOCTL(SCSI_IOCTL_GET_IDLUN),
COMPATIBLE_IOCTL(SCSI_IOCTL_PROBE_HOST),
+COMPATIBLE_IOCTL(SCSI_IOCTL_GET_PCI),
COMPATIBLE_IOCTL(SCSI_IOCTL_DOORLOCK),
COMPATIBLE_IOCTL(SCSI_IOCTL_DOORUNLOCK),
COMPATIBLE_IOCTL(SCSI_IOCTL_TEST_UNIT_READY),
@@ -3812,6 +3917,12 @@
COMPATIBLE_IOCTL(SCSI_IOCTL_TAGGED_DISABLE),
COMPATIBLE_IOCTL(SCSI_IOCTL_GET_BUS_NUMBER),
COMPATIBLE_IOCTL(SCSI_IOCTL_SEND_COMMAND),
+/* Big T */
+COMPATIBLE_IOCTL(TUNSETNOCSUM),
+COMPATIBLE_IOCTL(TUNSETDEBUG),
+COMPATIBLE_IOCTL(TUNSETIFF),
+COMPATIBLE_IOCTL(TUNSETPERSIST),
+COMPATIBLE_IOCTL(TUNSETOWNER),
/* Big V */
COMPATIBLE_IOCTL(VT_SETMODE),
COMPATIBLE_IOCTL(VT_GETMODE),
@@ -3888,6 +3999,11 @@
COMPATIBLE_IOCTL(SIOCDRARP),
COMPATIBLE_IOCTL(SIOCADDDLCI),
COMPATIBLE_IOCTL(SIOCDELDLCI),
+COMPATIBLE_IOCTL(SIOCGMIIPHY),
+COMPATIBLE_IOCTL(SIOCGMIIREG),
+COMPATIBLE_IOCTL(SIOCSMIIREG),
+COMPATIBLE_IOCTL(SIOCGIFVLAN),
+COMPATIBLE_IOCTL(SIOCSIFVLAN),
/* SG stuff */
COMPATIBLE_IOCTL(SG_SET_TIMEOUT),
COMPATIBLE_IOCTL(SG_GET_TIMEOUT),
@@ -4217,6 +4333,13 @@
COMPATIBLE_IOCTL(WDIOC_GETTEMP),
COMPATIBLE_IOCTL(WDIOC_SETOPTIONS),
COMPATIBLE_IOCTL(WDIOC_KEEPALIVE),
+/* Big R */
+COMPATIBLE_IOCTL(RNDGETENTCNT),
+COMPATIBLE_IOCTL(RNDADDTOENTCNT),
+COMPATIBLE_IOCTL(RNDGETPOOL),
+COMPATIBLE_IOCTL(RNDADDENTROPY),
+COMPATIBLE_IOCTL(RNDZAPENTCNT),
+COMPATIBLE_IOCTL(RNDCLEARPOOL),
/* Bluetooth ioctls */
COMPATIBLE_IOCTL(HCIDEVUP),
COMPATIBLE_IOCTL(HCIDEVDOWN),
@@ -4261,13 +4384,6 @@
COMPATIBLE_IOCTL(NBD_PRINT_DEBUG),
COMPATIBLE_IOCTL(NBD_SET_SIZE_BLOCKS),
COMPATIBLE_IOCTL(NBD_DISCONNECT),
-/* Remove *PRIVATE in 2.5 */
-COMPATIBLE_IOCTL(SIOCDEVPRIVATE),
-COMPATIBLE_IOCTL(SIOCDEVPRIVATE+1),
-COMPATIBLE_IOCTL(SIOCDEVPRIVATE+2),
-COMPATIBLE_IOCTL(SIOCGMIIPHY),
-COMPATIBLE_IOCTL(SIOCGMIIREG),
-COMPATIBLE_IOCTL(SIOCSMIIREG),
/* And these ioctls need translation */
HANDLE_IOCTL(MEMREADOOB32, mtd_rw_oob),
HANDLE_IOCTL(MEMWRITEOOB32, mtd_rw_oob),
@@ -4320,7 +4436,6 @@
HANDLE_IOCTL(0x1260, broken_blkgetsize),
HANDLE_IOCTL(BLKSECTGET, w_long),
HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans),
-HANDLE_IOCTL(HDIO_GET_KEEPSETTINGS, hdio_ioctl_trans),
HANDLE_IOCTL(HDIO_GET_UNMASKINTR, hdio_ioctl_trans),
HANDLE_IOCTL(HDIO_GET_DMA, hdio_ioctl_trans),
HANDLE_IOCTL(HDIO_GET_32BIT, hdio_ioctl_trans),
@@ -4336,6 +4451,7 @@
HANDLE_IOCTL(FDPOLLDRVSTAT32, fd_ioctl_trans),
HANDLE_IOCTL(FDGETFDCSTAT32, fd_ioctl_trans),
HANDLE_IOCTL(FDWERRORGET32, fd_ioctl_trans),
+HANDLE_IOCTL(SG_IO,sg_ioctl_trans),
HANDLE_IOCTL(PPPIOCGIDLE32, ppp_ioctl_trans),
HANDLE_IOCTL(PPPIOCSCOMPRESS32, ppp_ioctl_trans),
HANDLE_IOCTL(MTIOCGET32, mt_ioctl_trans),
@@ -4430,15 +4546,12 @@
HANDLE_IOCTL(DRM32_IOCTL_DMA, drm32_dma),
HANDLE_IOCTL(DRM32_IOCTL_RES_CTX, drm32_res_ctx),
#endif /* DRM */
-#if 0
HANDLE_IOCTL(USBDEVFS_CONTROL32, do_usbdevfs_control),
HANDLE_IOCTL(USBDEVFS_BULK32, do_usbdevfs_bulk),
/*HANDLE_IOCTL(USBDEVFS_SUBMITURB32, do_usbdevfs_urb)*/
HANDLE_IOCTL(USBDEVFS_REAPURB32, do_usbdevfs_reapurb),
HANDLE_IOCTL(USBDEVFS_REAPURBNDELAY32, do_usbdevfs_reapurb),
HANDLE_IOCTL(USBDEVFS_DISCSIGNAL32, do_usbdevfs_discsignal),
-#endif
-HANDLE_IOCTL(SG_IO, do_sg_io),
};
unsigned long ioctl32_hash_table[1024];
Index: open_pic.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc64/kernel/open_pic.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- open_pic.c 15 Mar 2002 18:28:12 -0000 1.1
+++ open_pic.c 3 May 2002 22:16:46 -0000 1.2
@@ -47,7 +47,6 @@
OpenPIC_SourcePtr ISU[OPENPIC_MAX_ISU];
static void openpic_end_irq(unsigned int irq_nr);
-static void openpic_ack_irq(unsigned int irq_nr);
static void openpic_set_affinity(unsigned int irq_nr, unsigned long cpumask);
struct hw_interrupt_type open_pic = {
@@ -56,14 +55,13 @@
NULL,
openpic_enable_irq,
openpic_disable_irq,
- openpic_ack_irq,
+ NULL,
openpic_end_irq,
openpic_set_affinity
};
#ifdef CONFIG_SMP
static void openpic_end_ipi(unsigned int irq_nr);
-static void openpic_ack_ipi(unsigned int irq_nr);
static void openpic_enable_ipi(unsigned int irq_nr);
static void openpic_disable_ipi(unsigned int irq_nr);
@@ -73,9 +71,9 @@
NULL,
openpic_enable_ipi,
openpic_disable_ipi,
- openpic_ack_ipi,
+ NULL,
openpic_end_ipi,
- 0
+ NULL
};
#endif /* CONFIG_SMP */
@@ -753,13 +751,6 @@
(sense ? OPENPIC_SENSE_LEVEL : 0));
}
-/* No spinlocks, should not be necessary with the OpenPIC
- * (1 register = 1 interrupt and we have the desc lock).
- */
-static void openpic_ack_irq(unsigned int irq_nr)
-{
-}
-
static void openpic_end_irq(unsigned int irq_nr)
{
if ((irq_desc[irq_nr].status & IRQ_LEVEL) != 0)
@@ -772,10 +763,6 @@
}
#ifdef CONFIG_SMP
-static void openpic_ack_ipi(unsigned int irq_nr)
-{
-}
-
static void openpic_end_ipi(unsigned int irq_nr)
{
/* IPIs are marked IRQ_PER_CPU. This has the side effect of
Index: setup.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc64/kernel/setup.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- setup.c 16 Apr 2002 17:41:49 -0000 1.2
+++ setup.c 3 May 2002 22:16:46 -0000 1.3
@@ -32,8 +32,8 @@
#include <asm/elf.h>
#include <asm/machdep.h>
#include <asm/iSeries/LparData.h>
-#include <asm/Naca.h>
-#include <asm/Paca.h>
+#include <asm/naca.h>
+#include <asm/paca.h>
#include <asm/ppcdebug.h>
#include <asm/time.h>
@@ -75,14 +75,11 @@
unsigned long r6, unsigned long r7);
int parse_bootinfo(void);
-int _machine = _MACH_unknown;
-
#ifdef CONFIG_MAGIC_SYSRQ
unsigned long SYSRQ_KEY;
#endif /* CONFIG_MAGIC_SYSRQ */
struct machdep_calls ppc_md;
-struct Naca *naca;
/*
* Perhaps we can put the pmac screen_info[] here
@@ -117,34 +114,11 @@
*/
void ppcdbg_initialize(void) {
unsigned long offset = reloc_offset();
- struct Naca *_naca = RELOC(naca);
+ struct naca_struct *_naca = RELOC(naca);
_naca->debug_switch = PPC_DEBUG_DEFAULT; /* | PPCDBG_BUSWALK | PPCDBG_PHBINIT | PPCDBG_MM | PPCDBG_MMINIT | PPCDBG_TCEINIT | PPCDBG_TCE */;
}
-/*
- * Initialize a set of PACA's, one for each processor.
- *
- * At this point, relocation is on, but we have not done any other
- * setup of the mm subsystem.
- */
-void paca_init(void) {
-#if 0
- int processorCount = naca->processorCount, i;
- struct Paca *paca[];
-
- /* Put the array of paca's on a page boundary & allocate 1/2 page of */
- /* storage for each. */
- klimit += (PAGE_SIZE-1) & PAGE_MASK;
- naca->xPaca = paca[0] = klimit;
- klimit += ((PAGE_SIZE>>1) * processorCount);
-
- for(i=0; i<processorCount; i++) {
- paca[0]->xPacaIndex = i;
- }
-#endif
-}
-
/*
* Do some initial setup of the system. The paramters are those which
* were passed in from the bootloader.
@@ -157,14 +131,15 @@
/* pSeries systems are identified in prom.c via OF. */
if ( itLpNaca.xLparInstalled == 1 )
- _machine = _MACH_iSeries;
- switch (_machine) {
- case _MACH_iSeries:
+ naca->platform = PLATFORM_ISERIES_LPAR;
+
+ switch (naca->platform) {
+ case PLATFORM_ISERIES_LPAR:
iSeries_init_early();
break;
#ifdef CONFIG_PPC_PSERIES
- case _MACH_pSeries:
+ case PLATFORM_PSERIES:
pSeries_init_early();
#ifdef CONFIG_BLK_DEV_INITRD
initrd_start = initrd_end = 0;
@@ -172,7 +147,7 @@
parse_bootinfo();
break;
- case _MACH_pSeriesLP:
+ case PLATFORM_PSERIES_LPAR:
pSeriesLP_init_early();
#ifdef CONFIG_BLK_DEV_INITRD
initrd_start = initrd_end = 0;
@@ -243,15 +218,15 @@
udbg_puts("\n-----------------------------------------------------\n");
- if ( _machine & _MACH_pSeries ) {
+ if (naca->platform & PLATFORM_PSERIES) {
finish_device_tree();
chrp_init(r3, r4, r5, r6, r7);
}
mm_init_ppc64();
- switch (_machine) {
- case _MACH_iSeries:
+ switch (naca->platform) {
+ case PLATFORM_ISERIES_LPAR:
iSeries_init();
break;
default:
@@ -299,14 +274,14 @@
return 0;
#endif
- pvr = xPaca[cpu_id].pvr;
+ pvr = paca[cpu_id].pvr;
maj = (pvr >> 8) & 0xFF;
min = pvr & 0xFF;
seq_printf(m, "processor\t: %lu\n", cpu_id);
seq_printf(m, "cpu\t\t: ");
- pvr = xPaca[cpu_id].pvr;
+ pvr = paca[cpu_id].pvr;
switch (PVR_VER(pvr)) {
case PV_PULSAR:
@@ -336,7 +311,7 @@
* Assume here that all clock rates are the same in a
* smp system. -- Cort
*/
- if (_machine != _MACH_iSeries) {
+ if (naca->platform != PLATFORM_ISERIES_LPAR) {
struct device_node *cpu_node;
int *fp;
@@ -563,6 +538,7 @@
ppc_md.setup_arch();
paging_init();
+ sort_exception_table();
ppc_md.progress("setup_arch: exit", 0x3eab);
}
@@ -680,9 +656,9 @@
/* The parameter is the number of processors to share in processing lp events */
unsigned long i;
unsigned long val = simple_strtoul( str, NULL, 0 );
- if ( ( val > 0 ) && ( val <= maxPacas ) ) {
+ if ( ( val > 0 ) && ( val <= MAX_PACAS ) ) {
for ( i=1; i<val; ++i )
- xPaca[i].lpQueuePtr = xPaca[0].lpQueuePtr;
+ paca[i].lpQueuePtr = paca[0].lpQueuePtr;
printk("lpevent processing spread over %ld processors\n", val);
}
else
@@ -693,13 +669,13 @@
/* This should only be called on processor 0 during calibrate decr */
void setup_default_decr(void)
{
- struct Paca * paca = (struct Paca *)mfspr(SPRG3);
+ struct paca_struct *lpaca = get_paca();
if ( decr_overclock_set && !decr_overclock_proc0_set )
decr_overclock_proc0 = decr_overclock;
- paca->default_decr = tb_ticks_per_jiffy / decr_overclock_proc0;
- paca->next_jiffy_update_tb = get_tb() + tb_ticks_per_jiffy;
+ lpaca->default_decr = tb_ticks_per_jiffy / decr_overclock_proc0;
+ lpaca->next_jiffy_update_tb = get_tb() + tb_ticks_per_jiffy;
}
int set_decr_overclock_proc0( char * str )
|