blob: e0ce54feed12f51dc9d0fda654378b5a2a7b92eb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#include <xeno/config.h>
#include <xeno/types.h>
#include <xeno/lib.h>
#include <xeno/ide.h>
#include <hypervisor-ifs/block.h>
void ide_probe_devices (xen_disk_info_t* xdi)
{
int loop;
for (loop = 0; loop < MAX_HWIFS; ++loop) {
ide_hwif_t *hwif = &ide_hwifs[loop];
if (hwif->present) {
struct gendisk *gd = hwif->gd;
unsigned int unit;
for (unit = 0; unit < MAX_DRIVES; ++unit) {
unsigned long capacity;
ide_drive_t *drive = &hwif->drives[unit];
if (drive->present) {
capacity = current_capacity (drive);
xdi->disks[xdi->count].type = XEN_DISK_IDE;
xdi->disks[xdi->count].capacity = capacity;
xdi->count++;
printk (KERN_ALERT "IDE-XENO %d\n", xdi->count);
printk (KERN_ALERT " capacity 0x%x\n", capacity);
printk (KERN_ALERT " head 0x%x\n", drive->bios_head);
printk (KERN_ALERT " sector 0x%x\n", drive->bios_sect);
printk (KERN_ALERT " cylinder 0x%x\n", drive->bios_cyl);
}
}
}
}
return;
}
|