File: xtensa_bootparam.h

package info (click to toggle)
qemu 2.0.0%2Bdfsg-4~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 51,176 kB
  • sloc: ansic: 779,192; sh: 11,338; asm: 10,524; python: 7,568; cpp: 6,085; perl: 4,521; makefile: 2,240; objc: 895; xml: 526
file content (25 lines) | stat: -rw-r--r-- 528 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef HW_XTENSA_BOOTPARAM
#define HW_XTENSA_BOOTPARAM

typedef struct BpTag {
    uint16_t tag;
    uint16_t size;
} BpTag;

static inline ram_addr_t put_tag(ram_addr_t addr, uint16_t tag,
        size_t size, const void *data)
{
    BpTag bp_tag = {
        .tag = tswap16(tag),
        .size = tswap16((size + 3) & ~3),
    };

    cpu_physical_memory_write(addr, &bp_tag, sizeof(bp_tag));
    addr += sizeof(bp_tag);
    cpu_physical_memory_write(addr, data, size);
    addr += (size + 3) & ~3;

    return addr;
}

#endif