Enforce libdir. On OpenSUSE the libs where stored in "lib64". They weren't
[AROS.git] / rom / devs / ata / bootwait.c
blob14619ece0e392dd6ed007c79c41f6a5544209c83
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <aros/asmcall.h>
7 #include <aros/debug.h>
8 #include <exec/resident.h>
9 #include <libraries/expansionbase.h>
10 #include <proto/exec.h>
12 #include LC_LIBDEFS_FILE
14 #include "ata.h"
16 extern const char ata_LibName[];
17 extern const char ata_LibID[];
18 extern const int ata_End;
20 AROS_UFP3(static APTR, ata_Wait,
21 AROS_UFPA(void *, dummy, D0),
22 AROS_UFPA(BPTR, segList, A0),
23 AROS_UFPA(struct ExecBase *, SysBase, A6));
25 const struct Resident ata_BootWait =
27 RTC_MATCHWORD,
28 (struct Resident *)&ata_BootWait,
29 (void *)&ata_End,
30 RTF_COLDSTART,
31 VERSION_NUMBER,
32 NT_TASK,
33 -49, /* dosboot.resource is -50 */
34 "ATA boot wait",
35 &ata_LibID[6],
36 &ata_Wait,
40 * The purpose of this delay is to wait until device detection is done
41 * before boot sequence enters DOS bootstrap. Without this we reach the
42 * bootstrap earlier than devices are detected (and BootNodes inserted).
43 * As a result, we end up in unbootable system.
44 * Actually, i dislike this solution a bit. I think something else has
45 * to be implemented. However i do not know what. Even if we rewrite
46 * adding BootNodes, bootmenu still has to wait until all nodes are added.
47 * Making device detection synchronous is IMHO not a good option, it will
48 * increase booting time of our OS.
51 AROS_UFH3(static APTR, ata_Wait,
52 AROS_UFPA(void *, dummy, D0),
53 AROS_UFPA(BPTR, segList, A0),
54 AROS_UFPA(struct ExecBase *, SysBase, A6))
56 AROS_USERFUNC_INIT
58 struct ataBase *ATABase;
60 /* We do not want to deal with IORequest and units, so just FindName() */
61 ATABase = (struct ataBase *)FindName(&SysBase->DeviceList, ata_LibName);
62 if (ATABase)
64 D(bug("[ATA ] Waiting for device detection to complete...\n"));
65 ObtainSemaphore(&ATABase->DetectionSem);
66 ReleaseSemaphore(&ATABase->DetectionSem);
69 return NULL;
71 AROS_USERFUNC_EXIT