1 #include <aros/libcall.h>
2 #include <proto/exec.h>
4 #include "partition_intern.h"
5 #include "partition_support.h"
7 /*****************************************************************************
10 AROS_LH3QUAD1(LONG
, WritePartitionDataQ
,
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
),
19 struct Library
*, PartitionBase
, 26, Partition
)
22 Write raw data to the partition.
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 writing from.
32 A return code of DoIO() function which was used to write the data
46 *****************************************************************************/
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
->cmdwrite
;
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
);