From: Erik M. <J.A...@it...> - 2003-12-09 14:10:01
|
On Mon, Dec 08, 2003 at 07:28:33PM -0800, Russ Dill wrote: > Update of /cvsroot/blob/blob/src/blob > In directory sc8-pr-cvs1:/tmp/cvs-serv1976/src/blob >=20 > Modified Files: > memory.c=20 > Log Message: > allow probing of ram at 0x0 Could you make the magic word a define? Something like: #define mem_magic 0xabadcafe or static const u32 mem_magic =3D 0xabadcafe; (I think the compiler will generate slightly better code for the latter case). > --- memory.c 13 Feb 2002 00:09:51 -0000 1.5 > +++ memory.c 9 Dec 2003 03:28:31 -0000 1.6 > @@ -56,16 +56,16 @@ > for(i =3D 0; i < NUM_MEM_AREAS; i++) > memory_map[i].used =3D 0; > =20 > - /* first write a 0 to all memory locations */ > + /* first write a magic value to all memory locations */ > for(addr =3D MEMORY_START; addr < MEMORY_END; addr +=3D TEST_BLOCK_SIZE) > - * (u32 *)addr =3D 0; > + * (u32 *)addr =3D 0xabadcafe; And this will become: * (u32 *)addr =3D mem_magic; =20 etc. Same code, slightly better readable. Erik --=20 Erik Mouw J.A...@it... mo...@nl... |