arch/sparc/include/asm/floppy_64.h
Source file repositories/reference/linux-study-clean/arch/sparc/include/asm/floppy_64.h
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/include/asm/floppy_64.h- Extension
.h- Size
- 19299 bytes
- Lines
- 777
- Domain
- Architecture Layer
- Bucket
- arch/sparc
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/of.hlinux/of_platform.hlinux/dma-mapping.hlinux/string.hasm/auxio.hasm/ebus_dma.hasm/ns87303.h
Detected Declarations
struct sun_flpy_controllerstruct sun_floppy_opsstruct sun_pci_dma_opfunction sun_82077_fd_inbfunction sun_82077_fd_outbfunction sun_fd_disable_dmafunction sun_fd_set_dma_modefunction sun_fd_set_dma_addrfunction sun_fd_set_dma_countfunction sun_fd_enable_dmafunction sparc_floppy_irqfunction sun_fd_request_irqfunction sun_fd_free_irqfunction sun_fd_ejectfunction sun_pci_fd_inbfunction sun_pci_fd_outbfunction sun_pci_fd_broken_outbfunction DS1function sun_pci_fd_lde_broken_outbfunction DS1function sun_pci_fd_enable_dmafunction sun_pci_fd_disable_dmafunction sun_pci_fd_set_dma_modefunction sun_pci_fd_set_dma_countfunction sun_pci_fd_set_dma_addrfunction sun_pci_get_dma_residuefunction sun_pci_fd_request_irqfunction sun_pci_fd_free_irqfunction sun_pci_fd_ejectfunction sun_pci_fd_dma_callbackfunction sun_pci_fd_out_bytefunction sun_pci_fd_senseifunction sun_pci_fd_resetfunction sun_pci_fd_test_drivefunction ebus_fdthree_pfunction sun_floppy_initfunction for_each_node_by_namefunction for_each_node_by_name
Annotated Snippet
struct sun_flpy_controller {
volatile unsigned char status1_82077; /* Auxiliary Status reg. 1 */
volatile unsigned char status2_82077; /* Auxiliary Status reg. 2 */
volatile unsigned char dor_82077; /* Digital Output reg. */
volatile unsigned char tapectl_82077; /* Tape Control reg */
volatile unsigned char status_82077; /* Main Status Register. */
#define drs_82077 status_82077 /* Digital Rate Select reg. */
volatile unsigned char data_82077; /* Data fifo. */
volatile unsigned char ___unused;
volatile unsigned char dir_82077; /* Digital Input reg. */
#define dcr_82077 dir_82077 /* Config Control reg. */
};
/* You'll only ever find one controller on an Ultra anyways. */
static struct sun_flpy_controller *sun_fdc = (struct sun_flpy_controller *)-1;
unsigned long fdc_status;
static struct platform_device *floppy_op = NULL;
struct sun_floppy_ops {
unsigned char (*fd_inb) (unsigned long port, unsigned int reg);
void (*fd_outb) (unsigned char value, unsigned long base,
unsigned int reg);
void (*fd_enable_dma) (void);
void (*fd_disable_dma) (void);
void (*fd_set_dma_mode) (int);
void (*fd_set_dma_addr) (char *);
void (*fd_set_dma_count) (int);
unsigned int (*get_dma_residue) (void);
int (*fd_request_irq) (void);
void (*fd_free_irq) (void);
int (*fd_eject) (int);
};
static struct sun_floppy_ops sun_fdops;
#define fd_inb(base, reg) sun_fdops.fd_inb(base, reg)
#define fd_outb(value, base, reg) sun_fdops.fd_outb(value, base, reg)
#define fd_enable_dma() sun_fdops.fd_enable_dma()
#define fd_disable_dma() sun_fdops.fd_disable_dma()
#define fd_request_dma() (0) /* nothing... */
#define fd_free_dma() /* nothing... */
#define fd_clear_dma_ff() /* nothing... */
#define fd_set_dma_mode(mode) sun_fdops.fd_set_dma_mode(mode)
#define fd_set_dma_addr(addr) sun_fdops.fd_set_dma_addr(addr)
#define fd_set_dma_count(count) sun_fdops.fd_set_dma_count(count)
#define get_dma_residue(x) sun_fdops.get_dma_residue()
#define fd_request_irq() sun_fdops.fd_request_irq()
#define fd_free_irq() sun_fdops.fd_free_irq()
#define fd_eject(drive) sun_fdops.fd_eject(drive)
/* Super paranoid... */
#undef HAVE_DISABLE_HLT
static int sun_floppy_types[2] = { 0, 0 };
/* Here is where we catch the floppy driver trying to initialize,
* therefore this is where we call the PROM device tree probing
* routine etc. on the Sparc.
*/
#define FLOPPY0_TYPE sun_floppy_init()
#define FLOPPY1_TYPE sun_floppy_types[1]
#define FDC1 ((unsigned long)sun_fdc)
#define N_FDC 1
#define N_DRIVE 8
static unsigned char sun_82077_fd_inb(unsigned long base, unsigned int reg)
{
udelay(5);
switch (reg) {
default:
printk("floppy: Asked to read unknown port %x\n", reg);
panic("floppy: Port bolixed.");
case FD_STATUS:
return sbus_readb(&sun_fdc->status_82077) & ~STATUS_DMA;
case FD_DATA:
return sbus_readb(&sun_fdc->data_82077);
case FD_DIR:
/* XXX: Is DCL on 0x80 in sun4m? */
return sbus_readb(&sun_fdc->dir_82077);
}
panic("sun_82072_fd_inb: How did I get here?");
}
static void sun_82077_fd_outb(unsigned char value, unsigned long base,
unsigned int reg)
{
udelay(5);
switch (reg) {
Annotation
- Immediate include surface: `linux/of.h`, `linux/of_platform.h`, `linux/dma-mapping.h`, `linux/string.h`, `asm/auxio.h`, `asm/ebus_dma.h`, `asm/ns87303.h`.
- Detected declarations: `struct sun_flpy_controller`, `struct sun_floppy_ops`, `struct sun_pci_dma_op`, `function sun_82077_fd_inb`, `function sun_82077_fd_outb`, `function sun_fd_disable_dma`, `function sun_fd_set_dma_mode`, `function sun_fd_set_dma_addr`, `function sun_fd_set_dma_count`, `function sun_fd_enable_dma`.
- Atlas domain: Architecture Layer / arch/sparc.
- 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.