arch/s390/include/asm/timex.h
Source file repositories/reference/linux-study-clean/arch/s390/include/asm/timex.h
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/include/asm/timex.h- Extension
.h- Size
- 6374 bytes
- Lines
- 272
- Domain
- Architecture Layer
- Bucket
- arch/s390
- 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
linux/preempt.hlinux/time64.hasm/tod_types.hasm/lowcore.hasm/machine.hasm/asm.h
Detected Declarations
struct ptff_qtostruct ptff_quistruct addrtypefunction set_tod_clockfunction store_tod_clock_ext_ccfunction store_tod_clock_extfunction set_clock_comparatorfunction set_tod_programmable_fieldfunction ptff_queryfunction local_tick_disablefunction local_tick_enablefunction get_tod_clockfunction get_tod_clock_fastfunction __get_tod_clock_monotonicfunction get_tod_clock_monotonicfunction get_cyclesfunction tod_to_nsfunction eitod_to_nsfunction tod_afterfunction tod_after_eq
Annotated Snippet
struct ptff_qto {
unsigned long physical_clock;
unsigned long tod_offset;
unsigned long logical_tod_offset;
unsigned long tod_epoch_difference;
} __packed;
static inline int ptff_query(unsigned int nr)
{
unsigned char *ptr;
ptr = ptff_function_mask + (nr >> 3);
return (*ptr & (0x80 >> (nr & 7))) != 0;
}
/* Query UTC information result */
struct ptff_qui {
unsigned int tm : 2;
unsigned int ts : 2;
unsigned int : 28;
unsigned int pad_0x04;
unsigned long leap_event;
short old_leap;
short new_leap;
unsigned int pad_0x14;
unsigned long prt[5];
unsigned long cst[3];
unsigned int skew;
unsigned int pad_0x5c[41];
} __packed;
/*
* ptff - Perform timing facility function
* @ptff_block: Pointer to ptff parameter block
* @len: Length of parameter block
* @func: Function code
* Returns: Condition code (0 on success)
*/
#define ptff(ptff_block, len, func) \
({ \
struct addrtype { char _[len]; }; \
unsigned int reg0 = func; \
unsigned long reg1 = (unsigned long)(ptff_block); \
int rc; \
\
asm volatile( \
" lgr 0,%[reg0]\n" \
" lgr 1,%[reg1]\n" \
" ptff\n" \
CC_IPM(rc) \
: CC_OUT(rc, rc), "+m" (*(struct addrtype *)reg1) \
: [reg0] "d" (reg0), [reg1] "d" (reg1) \
: CC_CLOBBER_LIST("0", "1")); \
CC_TRANSFORM(rc); \
})
static inline unsigned long local_tick_disable(void)
{
unsigned long old;
old = get_lowcore()->clock_comparator;
get_lowcore()->clock_comparator = clock_comparator_max;
set_clock_comparator(get_lowcore()->clock_comparator);
return old;
}
static inline void local_tick_enable(unsigned long comp)
{
get_lowcore()->clock_comparator = comp;
set_clock_comparator(get_lowcore()->clock_comparator);
}
#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
typedef unsigned long cycles_t;
static __always_inline unsigned long get_tod_clock(void)
{
union tod_clock clk;
store_tod_clock_ext(&clk);
return clk.tod;
}
static inline unsigned long get_tod_clock_fast(void)
{
unsigned long clk;
asm volatile("stckf %0" : "=Q" (clk) : : "cc");
return clk;
Annotation
- Immediate include surface: `linux/preempt.h`, `linux/time64.h`, `asm/tod_types.h`, `asm/lowcore.h`, `asm/machine.h`, `asm/asm.h`.
- Detected declarations: `struct ptff_qto`, `struct ptff_qui`, `struct addrtype`, `function set_tod_clock`, `function store_tod_clock_ext_cc`, `function store_tod_clock_ext`, `function set_clock_comparator`, `function set_tod_programmable_field`, `function ptff_query`, `function local_tick_disable`.
- Atlas domain: Architecture Layer / arch/s390.
- 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.