adopt previous changes. (NicJA)
[AROS.git] / rom / partition / closerootpartition.c
blobbdd19a6a852494e641bcc5425d0919846333187d
1 /*
2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <proto/exec.h>
7 #include <exec/memory.h>
9 #include "partition_intern.h"
10 #include "partition_support.h"
11 #include "platform.h"
13 /*****************************************************************************
15 NAME */
16 #include <libraries/partition.h>
18 AROS_LH1(void, CloseRootPartition,
20 /* SYNOPSIS */
21 AROS_LHA(struct PartitionHandle *, ph, A1),
23 /* LOCATION */
24 struct Library *, PartitionBase, 6, Partition)
26 /* FUNCTION
27 Close a root handle allocated by OpenRootPartition().
29 INPUTS
30 ph - root handle created by OpenRootPartition()
32 RESULT
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
42 INTERNALS
44 *****************************************************************************/
46 AROS_LIBFUNC_INIT
48 if (ph->table)
50 struct PTFunctionTable *handler = ph->table->handler;
52 if (handler->closePartitionTable)
53 handler->closePartitionTable(PartitionBase, ph);
56 CloseDevice((struct IORequest *)ph->bd->ioreq);
57 DeleteIORequest((struct IORequest *)ph->bd->ioreq);
58 DeleteMsgPort(ph->bd->port);
59 FreeMem(ph->bd, sizeof(struct PartitionBlockDevice));
60 FreeMem(ph, sizeof(struct PartitionHandle));
62 AROS_LIBFUNC_EXIT