gcc-4.6.2: Update with patch for gengtype.c
[AROS.git] / rom / dosboot / cleanup.c
blob320bb27844086aad9160537d22aa405040fb5f1b
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 "dosboot_intern.h"
11 extern const char Dosboot_LibID[];
12 extern const int Dosboot_End;
14 AROS_UFP3(static APTR, dosboot_Cleanup,
15 AROS_UFPA(void *, dummy, D0),
16 AROS_UFPA(BPTR, segList, A0),
17 AROS_UFPA(struct ExecBase *, SysBase, A6));
19 const struct Resident db_Cleanup =
21 RTC_MATCHWORD,
22 (struct Resident *)&db_Cleanup,
23 (void *)&Dosboot_End,
24 RTF_AFTERDOS,
25 VERSION_NUMBER,
26 NT_PROCESS,
27 -120,
28 "DOSBoot cleanup",
29 &Dosboot_LibID[6],
30 &dosboot_Cleanup,
33 AROS_UFH3(static APTR, dosboot_Cleanup,
34 AROS_UFPA(void *, dummy, D0),
35 AROS_UFPA(BPTR, segList, A0),
36 AROS_UFPA(struct ExecBase *, SysBase, A6))
38 AROS_USERFUNC_INIT
40 struct DOSBootBase *base = OpenResource("dosboot.resource");
42 if (!base)
44 /* ??? What ??? */
45 return NULL;
48 D(bug("[dosboot cleanup] Boot screen 0x%p\n", base->bm_Screen));
49 if (base->bm_Screen)
51 /* Close "No boot media" screen. This is actually what we are here for. */
52 CloseBootScreen(base->bm_Screen, base);
54 anim_Stop(base);
56 /* Well, since we are here, let's completely expunge. :) */
57 CloseLibrary(&base->bm_ExpansionBase->LibNode);
59 Remove(&base->db_Node);
60 FreeMem(base, sizeof(struct DOSBootBase));
62 return NULL;
64 AROS_USERFUNC_EXIT;