Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <xmmintrin.h>
- #include <assert.h>
- #include <stdint.h>
- int main() {
- void *ptr = malloc(sizeof(__m128));
- assert(!((intptr_t)ptr) % __alignof__(__m128));
- return 0;
- }
- // Treat these HW regs as volatile
- typedef uint32_t volatile hw_reg;
- // C friendly, hence the typedef
- typedef struct
- {
- hw_reg TimerCount;
- hw_reg TimerControl;
- } TIMER;
- // Cast the integer 0xFFFF0000 as being the base address of a timer peripheral.
- #define Timer1 ((TIMER *)0xFFFF0000)
- // Read the current timer tick value.
- // e.g. read the 32-bit value @ 0xFFFF.0000
- uint32_t CurrentTicks = Timer1->TimerCount;
- // Stop / reset the timer.
- // e.g. write the value 0 to the 32-bit location @ 0xFFFF.0004
- Timer1->TimerControl = 0;
- inline Page* GetPage(void* pMemory)
- {
- return &pPages[((UINT_PTR)pMemory - (UINT_PTR)pReserve) >> nPageShift];
- }
- int* my_pointer;
- int* p = new int();
- seed(intptr_t(p) ^ *p);
- delete p;
Add Comment
Please, Sign In to add comment