mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
bitkeeper revision 1.180 (3e9eda02F_PKMkDPKMOgXZtjVifQdA)
Merge boulderdash.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk into boulderdash.cl.cam.ac.uk:/local/scratch/smh22/xeno.bk
This commit is contained in:
commit
f967810e15
9 files changed
+1979
-1923
No files matched your search
@@ -153,3 +153,22 @@ xen/net/eth.o
|
||||
xen/net/network.o
|
||||
xen/net/skbuff.o
|
||||
xen/tools/elf-reloc
|
||||
tools/balloon/balloon
|
||||
xen/common/dom_mem_ops.o
|
||||
xen/common/string.o
|
||||
xen/drivers/block/xen_segment.o
|
||||
xen/drivers/cdrom/cdrom.o
|
||||
xen/drivers/cdrom/driver.o
|
||||
xen/drivers/ide/ide-cd.o
|
||||
xen/drivers/scsi/aic7xxx/aic7770.o
|
||||
xen/drivers/scsi/aic7xxx/aic7770_osm.o
|
||||
xen/drivers/scsi/aic7xxx/aic7xxx.o
|
||||
xen/drivers/scsi/aic7xxx/aic7xxx_93cx6.o
|
||||
xen/drivers/scsi/aic7xxx/aic7xxx_core.o
|
||||
xen/drivers/scsi/aic7xxx/aic7xxx_osm.o
|
||||
xen/drivers/scsi/aic7xxx/aic7xxx_osm_pci.o
|
||||
xen/drivers/scsi/aic7xxx/aic7xxx_pci.o
|
||||
xen/drivers/scsi/aic7xxx/aic7xxx_proc.o
|
||||
xen/drivers/scsi/megaraid.o
|
||||
xen/image.s
|
||||
xen/include/hypervisor-ifs/hypervisor-ifs
|
||||
+1888
-1887
File diff suppressed because it is too large.
Load diff
@@ -1322,10 +1322,6 @@ static void idedisk_setup (ide_drive_t *drive)
|
||||
struct hd_driveid *id = drive->id;
|
||||
unsigned long capacity;
|
||||
|
||||
printk (KERN_ALERT
|
||||
"ide-disk.c::idedisk_setup: chs %d %d %d\n",
|
||||
drive->cyl, drive->head, drive->sect);
|
||||
|
||||
idedisk_add_settings(drive);
|
||||
|
||||
if (id == NULL)
|
||||
@@ -1388,7 +1384,7 @@ static void idedisk_setup (ide_drive_t *drive)
|
||||
if ((capacity >= (drive->bios_cyl * drive->bios_sect * drive->bios_head)) &&
|
||||
(!drive->forced_geom) && drive->bios_sect && drive->bios_head)
|
||||
drive->bios_cyl = (capacity / drive->bios_sect) / drive->bios_head;
|
||||
printk (KERN_INFO "[XEN] %s: %ld sectors", drive->name, capacity);
|
||||
printk (KERN_INFO "%s: %ld sectors", drive->name, capacity);
|
||||
|
||||
/* Give size in megabytes (MB), not mebibytes (MiB). */
|
||||
/* We compute the exact rounded value, avoiding overflow. */
|
||||
|
||||
@@ -12,7 +12,8 @@ void ide_probe_devices(xen_disk_info_t* xdi)
|
||||
int loop;
|
||||
unsigned int unit;
|
||||
xen_disk_info_t *xen_xdi = map_domain_mem(virt_to_phys(xdi));
|
||||
unsigned long capacity, device;
|
||||
unsigned long capacity;
|
||||
unsigned short device, type;
|
||||
ide_drive_t *drive;
|
||||
|
||||
for ( loop = 0; loop < MAX_HWIFS; loop++ )
|
||||
@@ -23,17 +24,27 @@ void ide_probe_devices(xen_disk_info_t* xdi)
|
||||
for ( unit = 0; unit < MAX_DRIVES; unit++ )
|
||||
{
|
||||
drive = &hwif->drives[unit];
|
||||
|
||||
if ( !drive->present ) continue;
|
||||
|
||||
/*
|
||||
** NB: we use the ide 'media' field (ide_disk, ide_cdrom, etc)
|
||||
** as our 'type' field (XD_TYPE_DISK, XD_TYPE_CDROM, etc).
|
||||
** Hence must ensure these are kept in sync.
|
||||
*/
|
||||
type = drive->media;
|
||||
device = MK_IDE_XENDEV((loop * MAX_DRIVES) + unit);
|
||||
capacity = current_capacity(drive);
|
||||
|
||||
xen_xdi->disks[xen_xdi->count].device = device;
|
||||
xen_xdi->disks[xen_xdi->count].device = device;
|
||||
xen_xdi->disks[xen_xdi->count].type = type;
|
||||
xen_xdi->disks[xen_xdi->count].capacity = capacity;
|
||||
xen_xdi->count++;
|
||||
|
||||
printk("Disk %d: IDE-XENO capacity %ldkB (%ldMB)\n",
|
||||
xen_xdi->count, capacity>>1, capacity>>11);
|
||||
printk("Device %d: IDE-XENO (%s) capacity %ldkB (%ldMB)\n",
|
||||
xen_xdi->count, (type == XD_TYPE_DISK) ? "disk" :
|
||||
((type == XD_TYPE_CDROM) ? "cdrom" : "unknown"),
|
||||
capacity>>1, capacity>>11);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-14
@@ -2061,21 +2061,14 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio
|
||||
/* XXX SMH: spin waiting for response */
|
||||
if (action == ide_wait) {
|
||||
|
||||
/* if we get an error, ide-cd.c requeues (and kills our 'waitq') */
|
||||
if((rq->waiting != NULL) && *(int *)(rq->waiting)) {
|
||||
do {
|
||||
udelay(500);
|
||||
usecs += 500;
|
||||
if(usecs > 1000000) {
|
||||
printk("ide_do_drive_cmd [ide_wait]: giving "
|
||||
"up after 1s\n");
|
||||
*(int *)rq->waiting = 0;
|
||||
}
|
||||
} while((rq->waiting != NULL) && *(int *)(rq->waiting));
|
||||
while(wait) {
|
||||
udelay(500);
|
||||
usecs += 500;
|
||||
if(usecs > 1000000) {
|
||||
printk("ide_do_drive_cmd [ide_wait]: still waiting\n");
|
||||
usecs = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(rq->waiting == NULL)
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -847,12 +847,12 @@ void scsi_wait_req (Scsi_Request * SRpnt, const void *cmnd ,
|
||||
we've waited on &wait -- hence we deallocate the command structure
|
||||
if it hasn't been done already. This is not the correct behaviour
|
||||
in xen ... hmm .. how to fix? */
|
||||
while(*(int *)(SRpnt->sr_request.waiting)) {
|
||||
while(wait) {
|
||||
udelay(500);
|
||||
usecs += 500;
|
||||
if(usecs > 1000000) {
|
||||
printk("scsi_wait_req: giving up after 1 seconds!\n");
|
||||
*(int *)(SRpnt->sr_request.waiting) = 0;
|
||||
printk("scsi_wait_req: still waiting...!\n");
|
||||
usecs = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1329,11 +1329,13 @@ void scsi_probe_devices(xen_disk_info_t *xdi)
|
||||
device = MK_SCSI_XENDEV(i);
|
||||
capacity = sd->capacity;
|
||||
|
||||
/* XXX SMH: if make generic, need to properly determine 'type' */
|
||||
xen_xdi->disks[xen_xdi->count].device = device;
|
||||
xen_xdi->disks[xen_xdi->count].type = XD_TYPE_DISK;
|
||||
xen_xdi->disks[xen_xdi->count].capacity = capacity;
|
||||
xen_xdi->count++;
|
||||
|
||||
printk("Disk %d: SCSI-XENO capacity %ldkB (%ldMB)\n",
|
||||
printk("Device %d: SCSI-XENO (disk) capacity %ldkB (%ldMB)\n",
|
||||
xen_xdi->count, capacity>>1, capacity>>11);
|
||||
}
|
||||
|
||||
|
||||
@@ -94,10 +94,18 @@ typedef struct blk_ring_st
|
||||
|
||||
#define XEN_MAX_DISK_COUNT 100
|
||||
|
||||
/* XXX SMH: below types chosen to align with ide_xxx types in ide.h */
|
||||
#define XD_TYPE_FLOPPY 0x00
|
||||
#define XD_TYPE_TAPE 0x01
|
||||
#define XD_TYPE_CDROM 0x05
|
||||
#define XD_TYPE_OPTICAL 0x07
|
||||
#define XD_TYPE_DISK 0x20
|
||||
|
||||
typedef struct xen_disk
|
||||
{
|
||||
unsigned short device;
|
||||
unsigned long capacity;
|
||||
unsigned short device; /* device number (see top of file) */
|
||||
unsigned short type; /* device type, i.e. disk, cdrom, etc */
|
||||
unsigned long capacity; /* size in terms of #512 byte sectors */
|
||||
} xen_disk_t;
|
||||
|
||||
typedef struct xen_disk_info
|
||||
|
||||
@@ -28,7 +28,6 @@ static struct block_device_operations xlide_block_fops =
|
||||
revalidate: xenolinux_block_revalidate,
|
||||
};
|
||||
|
||||
|
||||
int xlide_hwsect(int minor)
|
||||
{
|
||||
return xlide_hardsect_size[minor];
|
||||
@@ -38,7 +37,9 @@ int xlide_hwsect(int minor)
|
||||
int xlide_init(xen_disk_info_t *xdi)
|
||||
{
|
||||
int i, result, units, minors, disk;
|
||||
unsigned short minor;
|
||||
struct gendisk *gd;
|
||||
char buf[64];
|
||||
|
||||
/* If we don't have any usable IDE devices we may as well bail now. */
|
||||
units = 0;
|
||||
@@ -107,18 +108,43 @@ int xlide_init(xen_disk_info_t *xdi)
|
||||
/* Now register each disk in turn. */
|
||||
for ( i = 0; i < xdi->count; i++ )
|
||||
{
|
||||
disk = xdi->disks[i].device & XENDEV_IDX_MASK;
|
||||
disk = xdi->disks[i].device & XENDEV_IDX_MASK;
|
||||
minor = disk << XLIDE_PARTN_SHIFT;
|
||||
|
||||
|
||||
/* We can use the first 16 IDE devices. */
|
||||
if ( !IS_IDE_XENDEV(xdi->disks[i].device) || (disk >= 16) ) continue;
|
||||
|
||||
((xl_disk_t *)gd->real_devices)[disk].capacity =
|
||||
xdi->disks[i].capacity;
|
||||
register_disk(gd,
|
||||
MKDEV(XLIDE_MAJOR, disk<<XLIDE_PARTN_SHIFT),
|
||||
1<<XLIDE_PARTN_SHIFT,
|
||||
&xlide_block_fops,
|
||||
xdi->disks[i].capacity);
|
||||
|
||||
|
||||
switch (xdi->disks[i].type) {
|
||||
case XD_TYPE_CDROM:
|
||||
set_device_ro(MKDEV(XLIDE_MAJOR, minor), 1);
|
||||
// fall through
|
||||
|
||||
case XD_TYPE_FLOPPY:
|
||||
case XD_TYPE_TAPE:
|
||||
gd->flags[disk] = GENHD_FL_REMOVABLE;
|
||||
printk(KERN_ALERT "Skipping partition check on %s /dev/%s\n",
|
||||
xdi->disks[i].type == XD_TYPE_CDROM ? "cdrom" :
|
||||
(xdi->disks[i].type == XD_TYPE_TAPE ? "tape" : "floppy"),
|
||||
disk_name(gd, minor, buf));
|
||||
break;
|
||||
|
||||
case XD_TYPE_DISK:
|
||||
register_disk(gd, MKDEV(XLIDE_MAJOR, minor), 1<<XLIDE_PARTN_SHIFT,
|
||||
&xlide_block_fops, xdi->disks[i].capacity);
|
||||
break;
|
||||
|
||||
default:
|
||||
printk(KERN_ALERT "XenoLinux: unknown ide device type %d\n",
|
||||
xdi->disks[i].type);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
printk(KERN_ALERT
|
||||
|
||||