Skip to content

Commit

Permalink
Remove DFPROC from original dma code
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaerr committed Sep 21, 2023
1 parent ac2edac commit ac5807c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
23 changes: 11 additions & 12 deletions elks/arch/i86/drivers/block/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <linuxmt/kernel.h>
#include <linuxmt/errno.h>
#include <linuxmt/debug.h>
#include <linuxmt/fd.h> /* for DFPROC */
#include <arch/dma.h>
#include <arch/system.h>

Expand Down Expand Up @@ -66,7 +65,7 @@ static struct dma_chan dma_chan_busy[MAX_DMA_CHANNELS] = {
__ret; \
} )

int DFPROC request_dma(unsigned char dma, const char *device)
int request_dma(unsigned char dma, const char *device)
{
if (dma >= MAX_DMA_CHANNELS)
return -EINVAL;
Expand All @@ -80,7 +79,7 @@ int DFPROC request_dma(unsigned char dma, const char *device)
return 0;
} /* request_dma */

void DFPROC free_dma(unsigned char dma)
void free_dma(unsigned char dma)
{
if (dma >= MAX_DMA_CHANNELS)
debug("Trying to free DMA%u\n", dma);
Expand All @@ -90,7 +89,7 @@ void DFPROC free_dma(unsigned char dma)

/* enable/disable a specific DMA channel */

void DFPROC enable_dma(unsigned char dma)
void enable_dma(unsigned char dma)
{
if (dma >= MAX_DMA_CHANNELS)
debug("Trying to enable DMA%u\n", dma);
Expand All @@ -100,7 +99,7 @@ void DFPROC enable_dma(unsigned char dma)
dma_outb(dma & 3, DMA2_MASK_REG);
}

void DFPROC disable_dma(unsigned char dma)
void disable_dma(unsigned char dma)
{
if (dma >= MAX_DMA_CHANNELS)
debug("Trying to disable DMA%u\n", dma);
Expand All @@ -118,7 +117,7 @@ void DFPROC disable_dma(unsigned char dma)
* --- only be used while interrupts are disabled! ---
*/

void DFPROC clear_dma_ff(unsigned char dma)
void clear_dma_ff(unsigned char dma)
{
if (dma >= MAX_DMA_CHANNELS)
debug("Trying to disable DMA%u\n", dma);
Expand All @@ -130,7 +129,7 @@ void DFPROC clear_dma_ff(unsigned char dma)

/* set mode (above) for a specific DMA channel */

void DFPROC set_dma_mode(unsigned char dma, unsigned char mode)
void set_dma_mode(unsigned char dma, unsigned char mode)
{
if (dma >= MAX_DMA_CHANNELS)
debug("Trying to disable DMA%u\n", dma);
Expand All @@ -146,7 +145,7 @@ void DFPROC set_dma_mode(unsigned char dma, unsigned char mode)
* boundary may have been crossed.
*/

void DFPROC set_dma_page(unsigned char dma, unsigned char page)
void set_dma_page(unsigned char dma, unsigned char page)
{
switch (dma) {
case 0:
Expand Down Expand Up @@ -177,7 +176,7 @@ void DFPROC set_dma_page(unsigned char dma, unsigned char page)
* Assumes dma flipflop is clear.
*/

void DFPROC set_dma_addr(unsigned char dma, unsigned long addr)
void set_dma_addr(unsigned char dma, unsigned long addr)
{
set_dma_page(dma, (long)addr >> 16);
if (dma <= 3) {
Expand All @@ -198,7 +197,7 @@ void DFPROC set_dma_addr(unsigned char dma, unsigned long addr)
* NOTE 2: "count" represents _bytes_ and must be even for channels 5-7.
*/

void DFPROC set_dma_count(unsigned char dma, unsigned int count)
void set_dma_count(unsigned char dma, unsigned int count)
{
count--;
if (dma <= 3) {
Expand All @@ -220,7 +219,7 @@ void DFPROC set_dma_count(unsigned char dma, unsigned int count)
* Assumes DMA flip-flop is clear.
*/

int DFPROC get_dma_residue(unsigned char dma)
int get_dma_residue(unsigned char dma)
{
unsigned int io_port = (dma <= 3) ? (dma << 1) + 1 + IO_DMA1_BASE
: ((dma & 3) << 2) + 2 + IO_DMA2_BASE;
Expand All @@ -233,7 +232,7 @@ int DFPROC get_dma_residue(unsigned char dma)
return (dma <= 3) ? count : (count << 1);
}

int DFPROC get_dma_list(char *buf)
int get_dma_list(char *buf)
{
int i, len = 0;

Expand Down
20 changes: 10 additions & 10 deletions elks/include/arch/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@
#define DMA_MODE_CASCADE 0xC0 /* pass thru DREQ->HRQ, DACK<-HLDA only */

/* These are in dma.c */
extern void DFPROC enable_dma(unsigned char);
extern void DFPROC disable_dma(unsigned char);
extern void DFPROC clear_dma_ff(unsigned char);
extern void DFPROC set_dma_mode(unsigned char,unsigned char);
extern void DFPROC set_dma_page(unsigned char,unsigned char);
extern void DFPROC set_dma_addr(unsigned char,unsigned long);
extern void DFPROC set_dma_count(unsigned char,unsigned int);
extern int DFPROC get_dma_residue(unsigned char);
extern int DFPROC request_dma(unsigned char,const char *);
extern void DFPROC free_dma(unsigned char);
extern void enable_dma(unsigned char);
extern void disable_dma(unsigned char);
extern void clear_dma_ff(unsigned char);
extern void set_dma_mode(unsigned char,unsigned char);
extern void set_dma_page(unsigned char,unsigned char);
extern void set_dma_addr(unsigned char,unsigned long);
extern void set_dma_count(unsigned char,unsigned int);
extern int get_dma_residue(unsigned char);
extern int request_dma(unsigned char,const char *);
extern void free_dma(unsigned char);

#endif

0 comments on commit ac5807c

Please sign in to comment.