- Removed unused HandleEvent method.
[AROS.git] / rom / partition / writepartitiondata.c
blob08f7f67a49921ffac4cbd839bf7360a020d3b26e
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, WritePartitionDataQ,
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, 26, Partition)
21 /* FUNCTION
22 Write raw data to 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 writing from.
31 RESULT
32 A return code of DoIO() function which was used to write 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->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);
61 AROS_LIBFUNC_EXIT