|
From: Zeljko V. <zel...@av...> - 2003-08-18 10:49:31
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, Aug 14, 2003 at 11:29:44AM -0700, John Reiser wrote: > >Lucky for us, so does the x86. There is a flag you can set in some > >register or other which makes the CPU trap on unaligned access. So long > >as we don't do it internally, you could set that and watch all the > >unaligned accesses in your program (even without Valgrind). > > Yes, it's the AC [Alignment Check] bit of the processor flags, > which is bit 18 (the bit with positional value (1<<18) or 0x40000). > It checks for unaligned access in user mode. > But not only AC. As I recall, some other bit in some control register (CR) must be enabled also. And even then, AC occurs only in user mode (ring 3). - -- v Zeljko Vrba, dipl. ing. http://pgp.mit.edu:11371/pks/lookup?op=vindex&search=0x3B375F1C zel...@av... Advanced Simulation Technologies http://www.avl.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/QKw2zT2jbzs3XxwRAhUCAJ0dDXnGKC/OAxbGRYXg/HFufg21CACfXs78 /n9YBcjBGtSdVYUM3p+e790= =5Z3H -----END PGP SIGNATURE----- |