MCPcopy Create free account
hub / github.com/ading2210/linuxpdf / cmos_write

Function cmos_write

tinyemu/x86_machine.c:225–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225static void cmos_write(void *opaque, uint32_t offset,
226 uint32_t data, int size_log2)
227{
228 CMOSState *s = opaque;
229
230 if (offset == 0) {
231 s->cmos_index = data & 0x7f;
232 } else {
233#ifdef DEBUG_CMOS
234 printf("cmos_write: reg=0x%02x val=0x%02x\n", s->cmos_index, data);
235#endif
236 switch(s->cmos_index) {
237 case RTC_REG_A:
238 s->cmos_data[RTC_REG_A] = (data & ~REG_A_UIP) |
239 (s->cmos_data[RTC_REG_A] & REG_A_UIP);
240 cmos_update_timer(s);
241 break;
242 case RTC_REG_B:
243 s->cmos_data[s->cmos_index] = data;
244 cmos_update_timer(s);
245 break;
246 default:
247 s->cmos_data[s->cmos_index] = data;
248 break;
249 }
250 }
251}
252
253static uint32_t cmos_read(void *opaque, uint32_t offset, int size_log2)
254{

Callers

nothing calls this directly

Calls 1

cmos_update_timerFunction · 0.85

Tested by

no test coverage detected