arch/m68k/sun3/intersil.c
Source file repositories/reference/linux-study-clean/arch/m68k/sun3/intersil.c
File Facts
- System
- Linux kernel
- Corpus path
arch/m68k/sun3/intersil.c- Extension
.c- Size
- 1708 bytes
- Lines
- 71
- Domain
- Architecture Layer
- Bucket
- arch/m68k
- 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/kernel.hlinux/rtc.hasm/errno.hasm/intersil.hasm/machdep.hsun3.h
Detected Declarations
function sun3_hwclk
Annotated Snippet
#include <linux/kernel.h>
#include <linux/rtc.h>
#include <asm/errno.h>
#include <asm/intersil.h>
#include <asm/machdep.h>
#include "sun3.h"
/* bits to set for start/run of the intersil */
#define STOP_VAL (INTERSIL_STOP | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE)
#define START_VAL (INTERSIL_RUN | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE)
/* get/set hwclock */
int sun3_hwclk(int set, struct rtc_time *t)
{
volatile struct intersil_dt *todintersil;
unsigned long flags;
todintersil = (struct intersil_dt *) &intersil_clock->counter;
local_irq_save(flags);
intersil_clock->cmd_reg = STOP_VAL;
/* set or read the clock */
if(set) {
todintersil->csec = 0;
todintersil->hour = t->tm_hour;
todintersil->minute = t->tm_min;
todintersil->second = t->tm_sec;
todintersil->month = t->tm_mon + 1;
todintersil->day = t->tm_mday;
todintersil->year = (t->tm_year - 68) % 100;
todintersil->weekday = t->tm_wday;
} else {
/* read clock */
t->tm_sec = todintersil->csec;
t->tm_hour = todintersil->hour;
t->tm_min = todintersil->minute;
t->tm_sec = todintersil->second;
t->tm_mon = todintersil->month - 1;
t->tm_mday = todintersil->day;
t->tm_year = todintersil->year + 68;
t->tm_wday = todintersil->weekday;
if (t->tm_year < 70)
t->tm_year += 100;
}
intersil_clock->cmd_reg = START_VAL;
local_irq_restore(flags);
return 0;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/rtc.h`, `asm/errno.h`, `asm/intersil.h`, `asm/machdep.h`, `sun3.h`.
- Detected declarations: `function sun3_hwclk`.
- Atlas domain: Architecture Layer / arch/m68k.
- 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.