arch/alpha/kernel/core_titan.c
Source file repositories/reference/linux-study-clean/arch/alpha/kernel/core_titan.c
File Facts
- System
- Linux kernel
- Corpus path
arch/alpha/kernel/core_titan.c- Extension
.c- Size
- 20105 bytes
- Lines
- 803
- 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.
- 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_titan.hlinux/module.hlinux/types.hlinux/pci.hlinux/sched.hlinux/init.hlinux/vmalloc.hlinux/memblock.hasm/ptrace.hasm/smp.hasm/tlbflush.hasm/vga.hproto.hpci_impl.hlinux/agp_backend.hasm/agp_backend.hlinux/slab.hlinux/delay.h
Detected Declarations
struct titan_agp_aperturefunction mk_tig_addrfunction titan_read_tigfunction titan_write_tigfunction DWORDfunction titan_read_configfunction titan_write_configfunction titan_pci_tbifunction titan_query_agpfunction titan_init_one_pachip_portfunction titan_init_pachipsfunction titan_init_archfunction titan_kill_one_pachip_portfunction titan_kill_pachipsfunction titan_kill_archfunction titan_ioportmapfunction titan_ioremapfunction titan_iounmapfunction titan_is_mmiofunction titan_agp_setupfunction titan_agp_cleanupfunction titan_agp_configurefunction titan_agp_bind_memoryfunction titan_agp_unbind_memoryfunction titan_agp_translatefunction titan_agp_infoexport titan_ioportmapexport titan_ioremapexport titan_iounmapexport titan_is_mmio
Annotated Snippet
struct titan_agp_aperture {
struct pci_iommu_arena *arena;
long pg_start;
long pg_count;
};
static int
titan_agp_setup(alpha_agp_info *agp)
{
struct titan_agp_aperture *aper;
if (!alpha_agpgart_size)
return -ENOMEM;
aper = kmalloc_obj(struct titan_agp_aperture);
if (aper == NULL)
return -ENOMEM;
aper->arena = agp->hose->sg_pci;
aper->pg_count = alpha_agpgart_size / PAGE_SIZE;
aper->pg_start = iommu_reserve(aper->arena, aper->pg_count,
aper->pg_count - 1);
if (aper->pg_start < 0) {
printk(KERN_ERR "Failed to reserve AGP memory\n");
kfree(aper);
return -ENOMEM;
}
agp->aperture.bus_base =
aper->arena->dma_base + aper->pg_start * PAGE_SIZE;
agp->aperture.size = aper->pg_count * PAGE_SIZE;
agp->aperture.sysdata = aper;
return 0;
}
static void
titan_agp_cleanup(alpha_agp_info *agp)
{
struct titan_agp_aperture *aper = agp->aperture.sysdata;
int status;
status = iommu_release(aper->arena, aper->pg_start, aper->pg_count);
if (status == -EBUSY) {
printk(KERN_WARNING
"Attempted to release bound AGP memory - unbinding\n");
iommu_unbind(aper->arena, aper->pg_start, aper->pg_count);
status = iommu_release(aper->arena, aper->pg_start,
aper->pg_count);
}
if (status < 0)
printk(KERN_ERR "Failed to release AGP memory\n");
kfree(aper);
kfree(agp);
}
static int
titan_agp_configure(alpha_agp_info *agp)
{
union TPAchipPCTL pctl;
titan_pachip_port *port = agp->private;
pctl.pctl_q_whole = port->pctl.csr;
/* Side-Band Addressing? */
pctl.pctl_r_bits.apctl_v_agp_sba_en = agp->mode.bits.sba;
/* AGP Rate? */
pctl.pctl_r_bits.apctl_v_agp_rate = 0; /* 1x */
if (agp->mode.bits.rate & 2)
pctl.pctl_r_bits.apctl_v_agp_rate = 1; /* 2x */
#if 0
if (agp->mode.bits.rate & 4)
pctl.pctl_r_bits.apctl_v_agp_rate = 2; /* 4x */
#endif
/* RQ Depth? */
pctl.pctl_r_bits.apctl_v_agp_hp_rd = 2;
pctl.pctl_r_bits.apctl_v_agp_lp_rd = 7;
/*
* AGP Enable.
*/
pctl.pctl_r_bits.apctl_v_agp_en = agp->mode.bits.enable;
/* Tell the user. */
printk("Enabling AGP: %dX%s\n",
1 << pctl.pctl_r_bits.apctl_v_agp_rate,
pctl.pctl_r_bits.apctl_v_agp_sba_en ? " - SBA" : "");
Annotation
- Immediate include surface: `asm/io.h`, `asm/core_titan.h`, `linux/module.h`, `linux/types.h`, `linux/pci.h`, `linux/sched.h`, `linux/init.h`, `linux/vmalloc.h`.
- Detected declarations: `struct titan_agp_aperture`, `function mk_tig_addr`, `function titan_read_tig`, `function titan_write_tig`, `function DWORD`, `function titan_read_config`, `function titan_write_config`, `function titan_pci_tbi`, `function titan_query_agp`, `function titan_init_one_pachip_port`.
- Atlas domain: Architecture Layer / arch/alpha.
- Implementation status: integration 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.