Guest User

Untitled

a guest
Jul 20th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #include <xmmintrin.h>
  2. #include <assert.h>
  3. #include <stdint.h>
  4.  
  5. int main() {
  6. void *ptr = malloc(sizeof(__m128));
  7. assert(!((intptr_t)ptr) % __alignof__(__m128));
  8. return 0;
  9. }
  10.  
  11. // Treat these HW regs as volatile
  12. typedef uint32_t volatile hw_reg;
  13.  
  14. // C friendly, hence the typedef
  15. typedef struct
  16. {
  17. hw_reg TimerCount;
  18. hw_reg TimerControl;
  19. } TIMER;
  20.  
  21. // Cast the integer 0xFFFF0000 as being the base address of a timer peripheral.
  22. #define Timer1 ((TIMER *)0xFFFF0000)
  23.  
  24. // Read the current timer tick value.
  25. // e.g. read the 32-bit value @ 0xFFFF.0000
  26. uint32_t CurrentTicks = Timer1->TimerCount;
  27.  
  28. // Stop / reset the timer.
  29. // e.g. write the value 0 to the 32-bit location @ 0xFFFF.0004
  30. Timer1->TimerControl = 0;
  31.  
  32. inline Page* GetPage(void* pMemory)
  33. {
  34. return &pPages[((UINT_PTR)pMemory - (UINT_PTR)pReserve) >> nPageShift];
  35. }
  36.  
  37. int* my_pointer;
  38.  
  39. int* p = new int();
  40. seed(intptr_t(p) ^ *p);
  41. delete p;
Add Comment
Please, Sign In to add comment