arch/mips/include/asm/mach-jazz/floppy.h

Source file repositories/reference/linux-study-clean/arch/mips/include/asm/mach-jazz/floppy.h

File Facts

System
Linux kernel
Corpus path
arch/mips/include/asm/mach-jazz/floppy.h
Extension
.h
Size
2594 bytes
Lines
134
Domain
Architecture Layer
Bucket
arch/mips
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.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef __ASM_MACH_JAZZ_FLOPPY_H
#define __ASM_MACH_JAZZ_FLOPPY_H

#include <linux/delay.h>
#include <linux/linkage.h>
#include <linux/types.h>
#include <linux/mm.h>
#include <asm/addrspace.h>
#include <asm/jazz.h>
#include <asm/jazzdma.h>

static inline unsigned char fd_inb(unsigned int base, unsigned int reg)
{
	unsigned char c;

	c = *(volatile unsigned char *) (base + reg);
	udelay(1);

	return c;
}

static inline void fd_outb(unsigned char value, unsigned int base, unsigned int reg)
{
	*(volatile unsigned char *) (base + reg) = value;
}

/*
 * How to access the floppy DMA functions.
 */
static inline void fd_enable_dma(void)
{
	vdma_enable(JAZZ_FLOPPY_DMA);
}

static inline void fd_disable_dma(void)
{
	vdma_disable(JAZZ_FLOPPY_DMA);
}

static inline int fd_request_dma(void)
{
	return 0;
}

static inline void fd_free_dma(void)
{
}

static inline void fd_clear_dma_ff(void)
{
}

static inline void fd_set_dma_mode(char mode)
{
	vdma_set_mode(JAZZ_FLOPPY_DMA, mode);
}

static inline void fd_set_dma_addr(char *a)
{
	vdma_set_addr(JAZZ_FLOPPY_DMA, vdma_phys2log(CPHYSADDR((unsigned long)a)));
}

static inline void fd_set_dma_count(unsigned int count)
{
	vdma_set_count(JAZZ_FLOPPY_DMA, count);
}

static inline int fd_get_dma_residue(void)
{
	return vdma_get_residue(JAZZ_FLOPPY_DMA);
}

static inline void fd_enable_irq(void)
{
}

static inline void fd_disable_irq(void)
{
}

static inline int fd_request_irq(void)
{
	return request_irq(FLOPPY_IRQ, floppy_interrupt,
			   0, "floppy", NULL);
}

static inline void fd_free_irq(void)
{
	free_irq(FLOPPY_IRQ, NULL);
}

Annotation

Implementation Notes