Fixed HiFi modes.
[AROS.git] / rom / partition / readpartitiondata.c
bloba0243ecfb2e57af0e4ec531023359b7e9486e72c
1 #include <aros/libcall.h>
2 #include <proto/exec.h>
4 #include "partition_intern.h"
5 #include "partition_support.h"
7 /*****************************************************************************
9 NAME */
10 AROS_LH3QUAD1(LONG, ReadPartitionDataQ,
12 /* SYNOPSIS */
13 AROS_LHA(struct PartitionHandle *, Partition , A0),
14 AROS_LHA(APTR , Buffer , A1),
15 AROS_LHA(ULONG , DataSize , D0),
16 AROS_LHAQUAD(UQUAD , StartBlock, D1, D2),
18 /* LOCATION */
19 struct Library *, PartitionBase, 25, Partition)
21 /* FUNCTION
22 Read raw data from the partition.
24 INPUTS
25 Partition - a handle to a partition to read from
26 Buffer - a pointer to a data buffer
27 DataSize - Size of data to read in bytes. This size must be a multiple of block size,
28 in order to ensure correct operation
29 StartBlock - Number of the first block to start reading from.
31 RESULT
32 A return code of DoIO() function which was used to read the data
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
42 INTERNALS
44 HISTORY
46 *****************************************************************************/
48 AROS_LIBFUNC_INIT
50 UQUAD offset = (getStartBlock(Partition) + StartBlock) * (Partition->de.de_SizeBlock << 2);
51 struct IOExtTD *ioreq = Partition->bd->ioreq;
53 ioreq->iotd_Req.io_Command = Partition->bd->cmdread;
54 ioreq->iotd_Req.io_Length = DataSize;
55 ioreq->iotd_Req.io_Data = Buffer;
56 ioreq->iotd_Req.io_Offset = offset;
57 ioreq->iotd_Req.io_Actual = offset >> 32;
59 return DoIO((struct IORequest *)ioreq);
61 AROS_LIBFUNC_EXIT