Build fix, include deflibdefs.h during dependencies generation.
[AROS.git] / rom / exec / sumkickdata.c
blobaaee4cd97c9a885642f289a8f28829a0e66f21af
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Build checksum for Kickstart.
6 Lang: english
7 */
8 #include <aros/debug.h>
9 #include "exec_intern.h"
10 #include <proto/exec.h>
12 /*****************************************************************************
14 NAME */
16 AROS_LH0(ULONG, SumKickData,
18 /* SYNOPSIS */
19 /* void */
21 /* LOCATION */
22 struct ExecBase *, SysBase, 102, Exec)
24 /* FUNCTION
26 INPUTS
28 RESULT
30 NOTES
32 EXAMPLE
34 BUGS
36 SEE ALSO
38 INTERNALS
40 *****************************************************************************/
42 AROS_LIBFUNC_INIT
44 ULONG chksum = 0;
46 if (SysBase->KickTagPtr) {
47 IPTR *list = SysBase->KickTagPtr;
48 while(*list)
50 chksum += (ULONG)*list;
51 /* on amiga, if bit 31 is set then this points to another list of
52 * modules rather than pointing to a single module. bit 31 is
53 * inconvenient on architectures where code may be loaded above
54 * 2GB. on these platforms we assume aligned pointers and use bit
55 * 0 instead */
56 #ifdef __mc68000__
57 if(*list & 0x80000000) { list = (IPTR *)(*list & 0x7fffffff); continue; }
58 #else
59 if(*list & 0x1) { list = (IPTR *)(*list & ~(IPTR)0x1); continue; }
60 #endif
61 list++;
65 if (SysBase->KickMemPtr) {
66 struct MemList *ml = (struct MemList*)SysBase->KickMemPtr;
67 while (ml->ml_Node.ln_Succ) {
68 UBYTE i;
69 ULONG *p = (ULONG*)ml;
70 for (i = 0; i < sizeof(struct MemList) / sizeof(ULONG); i++)
71 chksum += p[i];
72 ml = (struct MemList*)ml->ml_Node.ln_Succ;
76 return chksum;
78 AROS_LIBFUNC_EXIT
79 } /* SumKickData */