arch/sparc/include/asm/vdso/gettimeofday.h
Source file repositories/reference/linux-study-clean/arch/sparc/include/asm/vdso/gettimeofday.h
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/include/asm/vdso/gettimeofday.h- Extension
.h- Size
- 4725 bytes
- Lines
- 185
- Domain
- Architecture Layer
- Bucket
- arch/sparc
- 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
uapi/linux/time.huapi/linux/unistd.hvdso/align.hvdso/clocksource.hvdso/datapage.hvdso/page.hlinux/types.h
Detected Declarations
function vread_tickfunction vread_tick_stickfunction vdso_shift_nsfunction vread_tickfunction vread_tick_stickfunction __arch_get_hw_counterfunction clock_gettime_fallbackfunction clock_gettime_fallbackfunction clock_gettime32_fallbackfunction gettimeofday_fallback
Annotated Snippet
#ifndef _ASM_SPARC_VDSO_GETTIMEOFDAY_H
#define _ASM_SPARC_VDSO_GETTIMEOFDAY_H
#include <uapi/linux/time.h>
#include <uapi/linux/unistd.h>
#include <vdso/align.h>
#include <vdso/clocksource.h>
#include <vdso/datapage.h>
#include <vdso/page.h>
#include <linux/types.h>
#ifdef CONFIG_SPARC64
static __always_inline u64 vread_tick(void)
{
u64 ret;
__asm__ __volatile__("rd %%tick, %0" : "=r" (ret));
return ret;
}
static __always_inline u64 vread_tick_stick(void)
{
u64 ret;
__asm__ __volatile__("rd %%asr24, %0" : "=r" (ret));
return ret;
}
#else
static __always_inline u64 vdso_shift_ns(u64 val, u32 amt)
{
u64 ret;
__asm__ __volatile__("sllx %H1, 32, %%g1\n\t"
"srl %L1, 0, %L1\n\t"
"or %%g1, %L1, %%g1\n\t"
"srlx %%g1, %2, %L0\n\t"
"srlx %L0, 32, %H0"
: "=r" (ret)
: "r" (val), "r" (amt)
: "g1");
return ret;
}
#define vdso_shift_ns vdso_shift_ns
static __always_inline u64 vread_tick(void)
{
register unsigned long long ret asm("o4");
__asm__ __volatile__("rd %%tick, %L0\n\t"
"srlx %L0, 32, %H0"
: "=r" (ret));
return ret;
}
static __always_inline u64 vread_tick_stick(void)
{
register unsigned long long ret asm("o4");
__asm__ __volatile__("rd %%asr24, %L0\n\t"
"srlx %L0, 32, %H0"
: "=r" (ret));
return ret;
}
#endif
static __always_inline u64 __arch_get_hw_counter(s32 clock_mode, const struct vdso_time_data *vd)
{
if (likely(clock_mode == VDSO_CLOCKMODE_STICK))
return vread_tick_stick();
else
return vread_tick();
}
#ifdef CONFIG_SPARC64
#define SYSCALL_STRING \
"ta 0x6d;" \
"bcs,a 1f;" \
" sub %%g0, %%o0, %%o0;" \
"1:"
#else
#define SYSCALL_STRING \
"ta 0x10;" \
"bcs,a 1f;" \
" sub %%g0, %%o0, %%o0;" \
"1:"
#endif
#define SYSCALL_CLOBBERS \
Annotation
- Immediate include surface: `uapi/linux/time.h`, `uapi/linux/unistd.h`, `vdso/align.h`, `vdso/clocksource.h`, `vdso/datapage.h`, `vdso/page.h`, `linux/types.h`.
- Detected declarations: `function vread_tick`, `function vread_tick_stick`, `function vdso_shift_ns`, `function vread_tick`, `function vread_tick_stick`, `function __arch_get_hw_counter`, `function clock_gettime_fallback`, `function clock_gettime_fallback`, `function clock_gettime32_fallback`, `function gettimeofday_fallback`.
- Atlas domain: Architecture Layer / arch/sparc.
- 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.