arch/powerpc/include/asm/floppy.h
Source file repositories/reference/linux-study-clean/arch/powerpc/include/asm/floppy.h
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/include/asm/floppy.h- Extension
.h- Size
- 5108 bytes
- Lines
- 213
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/machdep.hlinux/pci.hasm/ppc-pci.h
Detected Declarations
struct fd_dma_opsfunction floppy_hardintfunction vdma_disable_dmafunction vdma_nopfunction fd_request_irqfunction vdma_dma_setupfunction hard_dma_setupfunction fd_request_dma
Annotated Snippet
struct fd_dma_ops {
void (*_disable_dma)(unsigned int dmanr);
void (*_free_dma)(unsigned int dmanr);
int (*_get_dma_residue)(unsigned int dummy);
int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
};
static int virtual_dma_count;
static int virtual_dma_residue;
static char *virtual_dma_addr;
static int virtual_dma_mode;
static int doing_vdma;
static struct fd_dma_ops *fd_ops;
static irqreturn_t floppy_hardint(int irq, void *dev_id)
{
unsigned char st;
int lcount;
char *lptr;
if (!doing_vdma)
return floppy_interrupt(irq, dev_id);
st = 1;
for (lcount=virtual_dma_count, lptr=virtual_dma_addr;
lcount; lcount--, lptr++) {
st = inb(virtual_dma_port + FD_STATUS);
st &= STATUS_DMA | STATUS_READY;
if (st != (STATUS_DMA | STATUS_READY))
break;
if (virtual_dma_mode)
outb_p(*lptr, virtual_dma_port + FD_DATA);
else
*lptr = inb_p(virtual_dma_port + FD_DATA);
}
virtual_dma_count = lcount;
virtual_dma_addr = lptr;
st = inb(virtual_dma_port + FD_STATUS);
if (st == STATUS_DMA)
return IRQ_HANDLED;
if (!(st & STATUS_DMA)) {
virtual_dma_residue += virtual_dma_count;
virtual_dma_count=0;
doing_vdma = 0;
floppy_interrupt(irq, dev_id);
return IRQ_HANDLED;
}
return IRQ_HANDLED;
}
static void vdma_disable_dma(unsigned int dummy)
{
doing_vdma = 0;
virtual_dma_residue += virtual_dma_count;
virtual_dma_count=0;
}
static void vdma_nop(unsigned int dummy)
{
}
static int vdma_get_dma_residue(unsigned int dummy)
{
return virtual_dma_count + virtual_dma_residue;
}
static int fd_request_irq(void)
{
if (can_use_virtual_dma)
return request_irq(FLOPPY_IRQ, floppy_hardint,
0, "floppy", NULL);
else
return request_irq(FLOPPY_IRQ, floppy_interrupt,
0, "floppy", NULL);
}
static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io)
{
doing_vdma = 1;
virtual_dma_port = io;
virtual_dma_mode = (mode == DMA_MODE_WRITE);
virtual_dma_addr = addr;
virtual_dma_count = size;
virtual_dma_residue = 0;
return 0;
}
Annotation
- Immediate include surface: `asm/machdep.h`, `linux/pci.h`, `asm/ppc-pci.h`.
- Detected declarations: `struct fd_dma_ops`, `function floppy_hardint`, `function vdma_disable_dma`, `function vdma_nop`, `function fd_request_irq`, `function vdma_dma_setup`, `function hard_dma_setup`, `function fd_request_dma`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: source implementation candidate.
- 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.