[parisc-linux] Call to IODC hangs.!!!!
Gururaj Ananthateerta
gururaj@cup.hp.com
Mon, 18 Mar 2002 21:40:39 -0800
I am using the following code to write a page to the swap space
using the iodc calls.
The IODC call for writing a boot device in blocks is
ENTRY_IO with a subfunction BOOT_BLK_DEV_WRITE = 17.
The call never returns.
Is there anythin I need to do more...
-------------------------------PARTITION TABLE Start -----------------
This is the partition of my disk.
Disk /dev/sda: 67 heads, 62 sectors, 1009 cylinders
Units = sectors of 1 * 512 bytes
Device Boot Start End Blocks Id System
/dev/sda1 62 33231 16585 f0 Linux/PA-RISC boot
/dev/sda2 33232 531711 249240 82 Linux swap
/dev/sda3 531712 1030191 249240 83 Linux
/dev/sda4 1030192 4191385 1580597 83 Linux
-------------------------------------------PARTITION TABLE End-----------------
-------------------------CALL to Firmware.c-----------------------------
I am calling a pdc_iodc_bootout() as below.
err = pdc_iodc_bootout((unsigned long)17014784, dump_page_buf,
1, &count);
17014784 is the start of the swap space.
I got this number by doing this.
Start sector of the swap partition * 512
33232 * 512 = 17014784
-------------------------------------------------------------END calling
-------------
---------------------------------------Call to
IODC------------------------------
This is the call to IODC
int
pdc_iodc_bootout(unsigned devaddr, char *memaddr, unsigned size,
unsigned *count)
{
int r;
static int __attribute__((aligned(8))) iodc_retbuf[32];
static char __attribute__((aligned(64))) iodc_dbuf[4096];
memcpy(iodc_dbuf, memaddr, size);
if(!(PAGE0->mem_boot.iodc_io)) {
return -1;
}
r = real32_call(PAGE0->mem_boot.iodc_io,
(unsigned long)PAGE0->mem_boot.hpa,
ENTRY_IO_BLK_BOOTOUT,
PAGE0->mem_boot.spa, __pa(PAGE0->mem_boot.dp.layers),
__pa(iodc_retbuf), devaddr, __pa(iodc_dbuf), size,
size);
memcpy(count, iodc_retbuf, sizeof(*count));
if (r == 3) /* EOF */
{
printk("pdc_iodc_bootin:EOF\n");
return 0; /* count = 0 at EOF */
}
else if (r >= 0)
{
convert_to_wide(pdc_result);
return pdc_result[0]; /* count */
}
return r; /* r < 0; error */
}