arch/m68k/include/asm/sun3xflop.h
Source file repositories/reference/linux-study-clean/arch/m68k/include/asm/sun3xflop.h
File Facts
- System
- Linux kernel
- Corpus path
arch/m68k/include/asm/sun3xflop.h- Extension
.h- Size
- 5757 bytes
- Lines
- 264
- 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.
- 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/pgtable.hasm/page.hasm/irq.hasm/sun3x.h
Detected Declarations
struct sun3xflop_privatefunction sun3x_82072_fd_inbfunction sun3x_82072_fd_outbfunction sun3xflop_hardintfunction sun3xflop_request_irqfunction sun3xflop_initfunction sun3x_eject
Annotated Snippet
struct sun3xflop_private {
volatile unsigned char *status_r;
volatile unsigned char *data_r;
volatile unsigned char *fcr_r;
volatile unsigned char *fvr_r;
unsigned char fcr;
} sun3x_fdc;
/* Super paranoid... */
#undef HAVE_DISABLE_HLT
/* Routines unique to each controller type on a Sun. */
static unsigned char sun3x_82072_fd_inb(int port)
{
static int once = 0;
// udelay(5);
switch(port & 7) {
default:
pr_crit("floppy: Asked to read unknown port %d\n", port);
panic("floppy: Port bolixed.");
case 4: /* FD_STATUS */
return (*sun3x_fdc.status_r) & ~STATUS_DMA;
case 5: /* FD_DATA */
return (*sun3x_fdc.data_r);
case 7: /* FD_DIR */
/* ugly hack, I can't find a way to actually detect the disk */
if(!once) {
once = 1;
return 0x80;
}
return 0;
};
panic("sun_82072_fd_inb: How did I get here?");
}
static void sun3x_82072_fd_outb(unsigned char value, int port)
{
// udelay(5);
switch(port & 7) {
default:
pr_crit("floppy: Asked to write to unknown port %d\n", port);
panic("floppy: Port bolixed.");
case 2: /* FD_DOR */
/* Oh geese, 82072 on the Sun has no DOR register,
* so we make do with taunting the FCR.
*
* ASSUMPTIONS: There will only ever be one floppy
* drive attached to a Sun controller
* and it will be at drive zero.
*/
{
unsigned char fcr = sun3x_fdc.fcr;
if(value & 0x10) {
fcr |= (FCR_DSEL0 | FCR_MTRON);
} else
fcr &= ~(FCR_DSEL0 | FCR_MTRON);
if(fcr != sun3x_fdc.fcr) {
*(sun3x_fdc.fcr_r) = fcr;
sun3x_fdc.fcr = fcr;
}
}
break;
case 5: /* FD_DATA */
*(sun3x_fdc.data_r) = value;
break;
case 7: /* FD_DCR */
*(sun3x_fdc.status_r) = value;
break;
case 4: /* FD_STATUS */
*(sun3x_fdc.status_r) = value;
break;
}
return;
}
asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id)
{
register unsigned char st;
#undef TRACE_FLPY_INT
#define NO_FLOPPY_ASSEMBLER
#ifdef TRACE_FLPY_INT
static int calls=0;
static int bytes=0;
Annotation
- Immediate include surface: `linux/pgtable.h`, `asm/page.h`, `asm/irq.h`, `asm/sun3x.h`.
- Detected declarations: `struct sun3xflop_private`, `function sun3x_82072_fd_inb`, `function sun3x_82072_fd_outb`, `function sun3xflop_hardint`, `function sun3xflop_request_irq`, `function sun3xflop_init`, `function sun3x_eject`.
- Atlas domain: Architecture Layer / arch/m68k.
- 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.