MCPcopy Create free account
hub / github.com/coreboot/coreboot / read_rcba32

Function read_rcba32

util/intelmetool/src/rcba.c:73–94  ·  view source on GitHub ↗

* Reads RCBA register at address 'addr' and stores it in 'val'. * Returns 1 on error and 0 on success. */

Source from the content-addressed store, hash-verified

71 * Returns 1 on error and 0 on success.
72 */
73int read_rcba32(uint32_t addr, uint32_t *val)
74{
75 volatile uint8_t *rcba;
76 const uint32_t rcba_phys = get_rcba_phys();
77
78 if (!rcba_phys) {
79 printf("Could not get RCBA address\n");
80 return 1;
81 }
82
83 rcba = map_physical((off_t)rcba_phys, size);
84 if (rcba == NULL) {
85 printf("Could not map RCBA\n"
86 "Do you have kernel cmdline argument 'iomem=relaxed' set ?\n");
87 return 1;
88 }
89
90 *val = *(uint32_t *)(rcba + addr);
91
92 munmap((void *)rcba, size);
93 return 0;
94}

Callers 2

activate_meFunction · 0.85
rehide_meFunction · 0.85

Calls 3

get_rcba_physFunction · 0.85
printfFunction · 0.85
map_physicalFunction · 0.70

Tested by

no test coverage detected