arch/alpha/kernel/core_marvel.c
Source file repositories/reference/linux-study-clean/arch/alpha/kernel/core_marvel.c
File Facts
- System
- Linux kernel
- Corpus path
arch/alpha/kernel/core_marvel.c- Extension
.c- Size
- 24491 bytes
- Lines
- 1097
- Domain
- Architecture Layer
- Bucket
- arch/alpha
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/io.hasm/core_marvel.hlinux/types.hlinux/pci.hlinux/sched.hlinux/init.hlinux/vmalloc.hlinux/mc146818rtc.hlinux/rtc.hlinux/string.hlinux/module.hlinux/memblock.hasm/ptrace.hasm/smp.hasm/gct.hasm/tlbflush.hasm/vga.hproto.hpci_impl.hlinux/agp_backend.hasm/agp_backend.hlinux/slab.hlinux/delay.h
Detected Declarations
struct marvel_rtc_access_infostruct marvel_agp_aperturefunction __attribute__function __attribute__function mk_resource_namefunction marvel_next_io7function marvel_find_io7function alloc_io7function io7_clear_errorsfunction io7_init_hosefunction marvel_init_io7function marvel_io7_presentfunction marvel_find_console_vga_hosefunction marvel_specify_io7function marvel_init_archfunction marvel_kill_archfunction mk_conf_addrfunction marvel_read_configfunction marvel_write_configfunction marvel_pci_tbifunction __marvel_access_rtcfunction __marvel_rtc_iofunction marvel_ioremapfunction marvel_iounmapfunction marvel_is_mmiofunction marvel_ioread8function marvel_iowrite8function marvel_agp_setupfunction marvel_agp_cleanupfunction marvel_agp_configurefunction marvel_agp_bind_memoryfunction marvel_agp_unbind_memoryfunction marvel_agp_translatefunction marvel_agp_infoexport marvel_ioremapexport marvel_iounmapexport marvel_is_mmioexport marvel_ioportmapexport marvel_ioread8export marvel_iowrite8
Annotated Snippet
struct marvel_rtc_access_info {
unsigned long function;
unsigned long index;
unsigned long data;
};
static void
__marvel_access_rtc(void *info)
{
struct marvel_rtc_access_info *rtc_access = info;
register unsigned long __r0 __asm__("$0");
register unsigned long __r16 __asm__("$16") = rtc_access->function;
register unsigned long __r17 __asm__("$17") = rtc_access->index;
register unsigned long __r18 __asm__("$18") = rtc_access->data;
__asm__ __volatile__(
"call_pal %4 # cserve rtc"
: "=r"(__r16), "=r"(__r17), "=r"(__r18), "=r"(__r0)
: "i"(PAL_cserve), "0"(__r16), "1"(__r17), "2"(__r18)
: "$1", "$22", "$23", "$24", "$25");
rtc_access->data = __r0;
}
static u8
__marvel_rtc_io(u8 b, unsigned long addr, int write)
{
static u8 index = 0;
struct marvel_rtc_access_info rtc_access;
u8 ret = 0;
switch(addr) {
case 0x70: /* RTC_PORT(0) */
if (write) index = b;
ret = index;
break;
case 0x71: /* RTC_PORT(1) */
rtc_access.index = index;
rtc_access.data = bcd2bin(b);
rtc_access.function = 0x48 + !write; /* GET/PUT_TOY */
__marvel_access_rtc(&rtc_access);
ret = bin2bcd(rtc_access.data);
break;
default:
printk(KERN_WARNING "Illegal RTC port %lx\n", addr);
break;
}
return ret;
}
/*
* IO map support.
*/
void __iomem *
marvel_ioremap(unsigned long addr, unsigned long size)
{
struct pci_controller *hose;
unsigned long baddr, last;
struct vm_struct *area;
unsigned long vaddr;
unsigned long *ptes;
unsigned long pfn;
/*
* Adjust the address.
*/
FIXUP_MEMADDR_VGA(addr);
/*
* Find the hose.
*/
for (hose = hose_head; hose; hose = hose->next) {
if ((addr >> 32) == (hose->mem_space->start >> 32))
break;
}
if (!hose)
return NULL;
/*
* We have the hose - calculate the bus limits.
*/
baddr = addr - hose->mem_space->start;
Annotation
- Immediate include surface: `asm/io.h`, `asm/core_marvel.h`, `linux/types.h`, `linux/pci.h`, `linux/sched.h`, `linux/init.h`, `linux/vmalloc.h`, `linux/mc146818rtc.h`.
- Detected declarations: `struct marvel_rtc_access_info`, `struct marvel_agp_aperture`, `function __attribute__`, `function __attribute__`, `function mk_resource_name`, `function marvel_next_io7`, `function marvel_find_io7`, `function alloc_io7`, `function io7_clear_errors`, `function io7_init_hose`.
- Atlas domain: Architecture Layer / arch/alpha.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.