Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void memory_test()
- {
- #define WRAPPED(x) ((void*)(((uint32_t)(x)) | 0x10000000))
- static uint32_t memtest = 0x123;
- volatile uint32_t *p1 = &memtest;
- volatile uint32_t *p2 = WRAPPED(&memtest);
- volatile uint32_t *p3 = UNCACHEABLE(&memtest);
- DryosDebugMsg( 0, 0, "%s p1 p2 p3", "POINTER ");
- DryosDebugMsg( 0, 0, "%s 0x%08X 0x%08X 0x%08X", "ADDRESS ", p1, p2, p3);
- DryosDebugMsg( 0, 0, "%s 0x%08X 0x%08X 0x%08X", "(init) ", *p1, *p2, *p3);
- memtest++;
- DryosDebugMsg( 0, 0, "%s 0x%08X 0x%08X 0x%08X", "memtest++", *p1, *p2, *p3);
- (*p1)++;
- DryosDebugMsg( 0, 0, "%s 0x%08X 0x%08X 0x%08X", "(*p1)++ ", *p1, *p2, *p3);
- (*p2)++;
- DryosDebugMsg( 0, 0, "%s 0x%08X 0x%08X 0x%08X", "(*p2)++ ", *p1, *p2, *p3);
- (*p3)++;
- DryosDebugMsg( 0, 0, "%s 0x%08X 0x%08X 0x%08X", "(*p3)++ ", *p1, *p2, *p3);
- }
- // Output
- init:00b1c75c:00:00: POINTER p1 p2 p3
- init:00b1c77c:00:00: ADDRESS 0x00B7F204 0x10B7F204 0x40B7F204
- init:00b1c7a8:00:00: (init) 0x00000123 0x00000123 0x00000123
- init:00b1c7e0:00:00: memtest++ 0x00000124 0x00000123 0x00000123
- init:00b1c818:00:00: (*p1)++ 0x00000125 0x00000123 0x00000123
- init:00b1c850:00:00: (*p2)++ 0x00000125 0x00000123 0x00000123
- init:00b1c888:00:00: (*p3)++ 0x00000125 0x00000124 0x00000124
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement