Skip to content

Commit

Permalink
Reduce size of dma routines
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaerr committed Sep 15, 2023
1 parent def03a7 commit a355733
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions elks/arch/i86/drivers/block/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linuxmt/types.h>
#include <linuxmt/kernel.h>
#include <linuxmt/errno.h>
#include <linuxmt/debug.h>
#include <arch/dma.h>
#include <arch/system.h>

Expand Down Expand Up @@ -81,7 +82,7 @@ int request_dma(unsigned char dma, const char *device)
void free_dma(unsigned char dma)
{
if (dma >= MAX_DMA_CHANNELS)
printk("Trying to free DMA%u\n", dma);
debug("Trying to free DMA%u\n", dma);
else if (!xchg(&dma_chan_busy[dma].lock, 0)) {
printk("Trying to free free DMA%u\n", dma);
} } /* free_dma */
Expand All @@ -91,7 +92,7 @@ void free_dma(unsigned char dma)
void enable_dma(unsigned char dma)
{
if (dma >= MAX_DMA_CHANNELS)
printk("Trying to enable DMA%u\n", dma);
debug("Trying to enable DMA%u\n", dma);
else if (dma <= 3)
dma_outb(dma, DMA1_MASK_REG);
else
Expand All @@ -101,7 +102,7 @@ void enable_dma(unsigned char dma)
void disable_dma(unsigned char dma)
{
if (dma >= MAX_DMA_CHANNELS)
printk("Trying to disable DMA%u\n", dma);
debug("Trying to disable DMA%u\n", dma);
else if (dma <= 3)
dma_outb(dma | 4, DMA1_MASK_REG);
else
Expand All @@ -119,7 +120,7 @@ void disable_dma(unsigned char dma)
void clear_dma_ff(unsigned char dma)
{
if (dma >= MAX_DMA_CHANNELS)
printk("Trying to disable DMA%u\n", dma);
debug("Trying to disable DMA%u\n", dma);
else if (dma <= 3)
dma_outb(0, DMA1_CLEAR_FF_REG);
else
Expand All @@ -131,7 +132,7 @@ void clear_dma_ff(unsigned char dma)
void set_dma_mode(unsigned char dma, unsigned char mode)
{
if (dma >= MAX_DMA_CHANNELS)
printk("Trying to disable DMA%u\n", dma);
debug("Trying to disable DMA%u\n", dma);
else if (dma <= 3)
dma_outb(mode | dma, DMA1_MODE_REG);
else
Expand Down Expand Up @@ -237,10 +238,9 @@ int get_dma_list(char *buf)

for (i = 0; i < MAX_DMA_CHANNELS; i++)
if (dma_chan_busy[i].lock)
len += sprintf(buf + len, "%2d: %s\n",
i, dma_chan_busy[i].device_id);
len += sprintf(buf + len, "%2d: %s\n", i, dma_chan_busy[i].device_id);
return len;
} /* get_dma_list */
}
#endif

#endif

0 comments on commit a355733

Please sign in to comment.