kmem.h 814 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef kmem_h
  2. #define kmem_h
  3. #include <mach/mach.h>
  4. uint32_t rk32_electra(uint64_t kaddr);
  5. uint64_t rk64_electra(uint64_t kaddr);
  6. void wk32_electra(uint64_t kaddr, uint32_t val);
  7. void wk64_electra(uint64_t kaddr, uint64_t val);
  8. void wkbuffer(uint64_t kaddr, void* buffer, uint32_t length);
  9. void rkbuffer(uint64_t kaddr, void* buffer, uint32_t length);
  10. void kmemcpy(uint64_t dest, uint64_t src, uint32_t length);
  11. void kmem_protect(uint64_t kaddr, uint32_t size, int prot);
  12. uint64_t kmem_alloc(uint64_t size);
  13. uint64_t kmem_alloc_wired(uint64_t size);
  14. void kmem_free(uint64_t kaddr, uint64_t size);
  15. void prepare_rk_via_kmem_read_port(mach_port_t port);
  16. void prepare_rwk_via_tfp0(mach_port_t port);
  17. // query whether kmem read or write is present
  18. int have_kmem_read(void);
  19. int have_kmem_write(void);
  20. #endif