arch/um/drivers/rtc_user.c
Source file repositories/reference/linux-study-clean/arch/um/drivers/rtc_user.c
File Facts
- System
- Linux kernel
- Corpus path
arch/um/drivers/rtc_user.c- Extension
.c- Size
- 1512 bytes
- Lines
- 82
- Domain
- Architecture Layer
- Bucket
- arch/um
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
stdbool.hos.herrno.hsched.hunistd.hkern_util.hsys/select.hstdio.hsys/timerfd.hrtc.h
Detected Declarations
function uml_rtc_send_timetravel_alarmfunction uml_rtc_startfunction uml_rtc_enable_alarmfunction uml_rtc_disable_alarmfunction uml_rtc_stop
Annotated Snippet
if (uml_rtc_irq_fds[0] < 0) {
err = -errno;
goto fail;
}
/* apparently timerfd won't send SIGIO, use workaround */
sigio_broken();
err = add_sigio_fd(uml_rtc_irq_fds[0]);
if (err < 0) {
close(uml_rtc_irq_fds[0]);
goto fail;
}
}
return uml_rtc_irq_fds[0];
fail:
uml_rtc_stop(timetravel);
return err;
}
int uml_rtc_enable_alarm(unsigned long long delta_seconds)
{
struct itimerspec it = {
.it_value = {
.tv_sec = delta_seconds,
},
};
if (timerfd_settime(uml_rtc_irq_fds[0], 0, &it, NULL))
return -errno;
return 0;
}
void uml_rtc_disable_alarm(void)
{
uml_rtc_enable_alarm(0);
}
void uml_rtc_stop(bool timetravel)
{
if (timetravel)
os_close_file(uml_rtc_irq_fds[1]);
else
ignore_sigio_fd(uml_rtc_irq_fds[0]);
os_close_file(uml_rtc_irq_fds[0]);
}
Annotation
- Immediate include surface: `stdbool.h`, `os.h`, `errno.h`, `sched.h`, `unistd.h`, `kern_util.h`, `sys/select.h`, `stdio.h`.
- Detected declarations: `function uml_rtc_send_timetravel_alarm`, `function uml_rtc_start`, `function uml_rtc_enable_alarm`, `function uml_rtc_disable_alarm`, `function uml_rtc_stop`.
- Atlas domain: Architecture Layer / arch/um.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.