arch/m68k/include/asm/floppy.h
Source file repositories/reference/linux-study-clean/arch/m68k/include/asm/floppy.h
File Facts
- System
- Linux kernel
- Corpus path
arch/m68k/include/asm/floppy.h- Extension
.h- Size
- 5237 bytes
- Lines
- 252
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
Dependency Surface
asm/io.hlinux/vmalloc.hasm/sun3xflop.h
Detected Declarations
function claim_dma_lockfunction release_dma_lockfunction fd_inbfunction fd_outbfunction fd_request_irqfunction fd_free_irqfunction m68k_floppy_initfunction vdma_request_dmafunction vdma_get_dma_residuefunction vdma_mem_allocfunction _fd_dma_mem_freefunction vdma_dma_setupfunction fd_disable_dmafunction floppy_hardint
Annotated Snippet
#include <asm/io.h>
#include <linux/vmalloc.h>
asmlinkage irqreturn_t floppy_hardint(int irq, void *dev_id);
/* constants... */
#undef MAX_DMA_ADDRESS
#define MAX_DMA_ADDRESS 0x00 /* nothing like that */
/*
* Again, the CMOS information doesn't work on m68k..
*/
#define FLOPPY0_TYPE (MACH_IS_Q40 ? 6 : 4)
#define FLOPPY1_TYPE 0
/* basically PC init + set use_virtual_dma */
#define FDC1 m68k_floppy_init()
#define N_FDC 1
#define N_DRIVE 8
/* vdma globals adapted from asm-i386/floppy.h */
static int virtual_dma_count=0;
static int virtual_dma_residue=0;
static char *virtual_dma_addr=NULL;
static int virtual_dma_mode=0;
static int doing_pdma=0;
#include <asm/sun3xflop.h>
extern spinlock_t dma_spin_lock;
static __inline__ unsigned long claim_dma_lock(void)
{
unsigned long flags;
spin_lock_irqsave(&dma_spin_lock, flags);
return flags;
}
static __inline__ void release_dma_lock(unsigned long flags)
{
spin_unlock_irqrestore(&dma_spin_lock, flags);
}
static __inline__ unsigned char fd_inb(int base, int reg)
{
if(MACH_IS_Q40)
return inb_p(base + reg);
else if(MACH_IS_SUN3X)
return sun3x_82072_fd_inb(base + reg);
return 0;
}
static __inline__ void fd_outb(unsigned char value, int base, int reg)
{
if(MACH_IS_Q40)
outb_p(value, base + reg);
else if(MACH_IS_SUN3X)
sun3x_82072_fd_outb(value, base + reg);
}
static int fd_request_irq(void)
{
if(MACH_IS_Q40)
return request_irq(FLOPPY_IRQ, floppy_hardint,
0, "floppy", floppy_hardint);
else if(MACH_IS_SUN3X)
return sun3xflop_request_irq();
return -ENXIO;
}
static void fd_free_irq(void)
{
if(MACH_IS_Q40)
free_irq(FLOPPY_IRQ, floppy_hardint);
}
#define fd_request_dma() vdma_request_dma(FLOPPY_DMA,"floppy")
#define fd_get_dma_residue() vdma_get_dma_residue(FLOPPY_DMA)
#define fd_dma_mem_alloc(size) vdma_mem_alloc(size)
#define fd_dma_setup(addr, size, mode, io) vdma_dma_setup(addr, size, mode, io)
#define fd_enable_irq() /* nothing... */
Annotation
- Immediate include surface: `asm/io.h`, `linux/vmalloc.h`, `asm/sun3xflop.h`.
- Detected declarations: `function claim_dma_lock`, `function release_dma_lock`, `function fd_inb`, `function fd_outb`, `function fd_request_irq`, `function fd_free_irq`, `function m68k_floppy_init`, `function vdma_request_dma`, `function vdma_get_dma_residue`, `function vdma_mem_alloc`.
- Atlas domain: Architecture Layer / arch/m68k.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.