Added missing properties.
[AROS.git] / rom / devs / ata / bootwait.c
blob3483faf464eccb88ea218831b89c996170863689
1 #include <aros/asmcall.h>
2 #include <aros/debug.h>
3 #include <exec/resident.h>
4 #include <libraries/expansionbase.h>
5 #include <proto/exec.h>
7 #include LC_LIBDEFS_FILE
9 #include "ata.h"
11 extern const char ata_LibName[];
12 extern const char ata_LibID[];
13 extern const int ata_End;
15 AROS_UFP3(static APTR, ata_Wait,
16 AROS_UFPA(void *, dummy, D0),
17 AROS_UFPA(BPTR, segList, A0),
18 AROS_UFPA(struct ExecBase *, SysBase, A6));
20 const struct Resident ata_BootWait =
22 RTC_MATCHWORD,
23 (struct Resident *)&ata_BootWait,
24 (void *)&ata_End,
25 RTF_COLDSTART,
26 VERSION_NUMBER,
27 NT_TASK,
28 -49, /* dosboot.resource is -50 */
29 "ATA boot wait",
30 &ata_LibID[6],
31 &ata_Wait,
35 * The purpose of this delay is to wait until device detection is done
36 * before boot sequence enters DOS bootstrap. Without this we reach the
37 * bootstrap earlier than devices are detected (and BootNodes inserted).
38 * As a result, we end up in unbootable system.
39 * Actually, i dislike this solution a bit. I think something else has
40 * to be implemented. However i do not know what. Even if we rewrite
41 * adding BootNodes, bootmenu still has to wait until all nodes are added.
42 * Making device detection synchronous is IMHO not a good option, it will
43 * increase booting time of our OS.
46 AROS_UFH3(static APTR, ata_Wait,
47 AROS_UFPA(void *, dummy, D0),
48 AROS_UFPA(BPTR, segList, A0),
49 AROS_UFPA(struct ExecBase *, SysBase, A6))
51 AROS_USERFUNC_INIT
53 struct ataBase *ATABase;
55 /* We do not want to deal with IORequest and units, so just FindName() */
56 ATABase = (struct ataBase *)FindName(&SysBase->DeviceList, ata_LibName);
57 if (ATABase)
59 D(bug("[ATA ] Waiting for device detection to complete...\n"));
60 ObtainSemaphore(&ATABase->DetectionSem);
61 ReleaseSemaphore(&ATABase->DetectionSem);
64 return NULL;
66 AROS_USERFUNC_EXIT