xtensa_bootparam.h 528 B

12345678910111213141516171819202122232425
  1. #ifndef HW_XTENSA_BOOTPARAM
  2. #define HW_XTENSA_BOOTPARAM
  3. typedef struct BpTag {
  4. uint16_t tag;
  5. uint16_t size;
  6. } BpTag;
  7. static inline ram_addr_t put_tag(ram_addr_t addr, uint16_t tag,
  8. size_t size, const void *data)
  9. {
  10. BpTag bp_tag = {
  11. .tag = tswap16(tag),
  12. .size = tswap16((size + 3) & ~3),
  13. };
  14. cpu_physical_memory_write(addr, &bp_tag, sizeof(bp_tag));
  15. addr += sizeof(bp_tag);
  16. cpu_physical_memory_write(addr, data, size);
  17. addr += (size + 3) & ~3;
  18. return addr;
  19. }
  20. #endif