Forum Discussion
Altera_Forum
Honored Contributor
14 years agoSetting the top bit is as simple as:
ptr = (void *)((unsigned int)ptr) | 0x80000000); Although it is probably worth encapsulating it in a# define. I don't know where you are getting the address from. It might be from a numeric constant in a header file - in which case you can or in the top bit then. An alternative is to get the linker script to define the value of a symbol (instead of using the contents of a variable) - in which case it can just define the high value (useful for small systems when the IO addresses can be arranged to be accessible from %gp).