forked from Imagelibrary/rtems
Renamed delay() to avoid conflicts since it is a common name that
was in particular used by the ttcp test.
This commit is contained in:
@@ -143,6 +143,8 @@ extern int rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config);
|
||||
#define Clear_tm27_intr()
|
||||
#define Lower_tm27_intr()
|
||||
|
||||
/* does anyone need this? if so, report it so we can rename this macro */
|
||||
#if 0
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Simple spin delay in microsecond units for device drivers.
|
||||
| This is very dependent on the clock speed of the target.
|
||||
@@ -152,6 +154,7 @@ extern int rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config);
|
||||
rtems_unsigned32 _cnt = _microseconds; \
|
||||
asm volatile ("0: nop; mov %0,%0; loop 0b" : "=c"(_cnt) : "0"(_cnt)); \
|
||||
}
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Convert microseconds to ticks and ticks to microseconds.
|
||||
|
||||
@@ -109,16 +109,16 @@ _start16:
|
||||
outb %al, $0x60
|
||||
call empty_8042
|
||||
|
||||
call delay
|
||||
call delay
|
||||
call delay
|
||||
call pc386_delay
|
||||
call pc386_delay
|
||||
call pc386_delay
|
||||
|
||||
movl %cs:HDRSTART + HDROFF, %eax #
|
||||
pushl %eax # jump to start of 32 bit code
|
||||
ret #
|
||||
|
||||
/*----------------------------------------------------------------------------+
|
||||
| delay
|
||||
| pc386_delay
|
||||
+------------------------------------------------------------------------------
|
||||
| Delay is needed after doing I/O.
|
||||
|
|
||||
@@ -131,10 +131,10 @@ _start16:
|
||||
| NOTE: Saving the content of the EAX register just in case. - Rosimildo.
|
||||
+----------------------------------------------------------------------------*/
|
||||
.p2align 4
|
||||
.globl _delay
|
||||
.globl delay
|
||||
delay:
|
||||
_delay:
|
||||
.globl _pc386_delay
|
||||
.globl pc386_delay
|
||||
pc386_delay:
|
||||
_pc386_delay:
|
||||
pushl %eax
|
||||
#if defined(USE_OUTB_FOR_DELAY)
|
||||
outb %al, $0x80 # about 1uS delay on most machines
|
||||
@@ -142,9 +142,9 @@ _delay:
|
||||
#else
|
||||
|
||||
movl $0x200, %eax
|
||||
delay1:
|
||||
pc386_delay1:
|
||||
dec %eax
|
||||
jnz delay1
|
||||
jnz pc386_delay1
|
||||
#endif
|
||||
popl %eax
|
||||
ret
|
||||
@@ -162,11 +162,11 @@ delay1:
|
||||
.globl empty_8042
|
||||
empty_8042:
|
||||
_empty_8042:
|
||||
call delay
|
||||
call pc386_delay
|
||||
inb $0x64, %al # 8042 status port
|
||||
testb $0x01, %al # output buffer?
|
||||
jz no_output
|
||||
call delay
|
||||
call pc386_delay
|
||||
in $0x60, %al # read it
|
||||
jmp empty_8042
|
||||
no_output:
|
||||
|
||||
@@ -50,7 +50,7 @@ BEGIN_CODE
|
||||
EXTERN (clockOff)
|
||||
|
||||
/*----------------------------------------------------------------------------+
|
||||
| delay
|
||||
| pc386_delay
|
||||
+------------------------------------------------------------------------------
|
||||
| Delay is needed after doing I/O.
|
||||
|
|
||||
@@ -64,17 +64,17 @@ BEGIN_CODE
|
||||
#define DELAY_USE_OUTB
|
||||
|
||||
.p2align 4
|
||||
.globl _delay
|
||||
.globl delay
|
||||
delay:
|
||||
_delay:
|
||||
.globl _pc386_delay
|
||||
.globl pc386_delay
|
||||
pc386_delay:
|
||||
_pc386_delay:
|
||||
#ifdef DELAY_USE_OUTB
|
||||
outb al, $0x80 # about 1uS delay on most machines
|
||||
#else
|
||||
movl $0x200, eax
|
||||
delay1:
|
||||
pc386_delay1:
|
||||
dec eax
|
||||
jnz delay1
|
||||
jnz pc386_delay1
|
||||
#endif
|
||||
ret
|
||||
|
||||
@@ -123,36 +123,36 @@ next_step:
|
||||
|
||||
movb $0x11, al /* initialization sequence */
|
||||
outb al, $0x20 /* send it to 8259A-1 */
|
||||
call SYM(delay)
|
||||
call SYM(pc386_delay)
|
||||
outb al, $0xA0 /* and to 8259A-2 */
|
||||
call SYM(delay)
|
||||
call SYM(pc386_delay)
|
||||
|
||||
movb $0x20, al /* start of hardware int's (0x20) */
|
||||
outb al, $0x21
|
||||
call SYM(delay)
|
||||
call SYM(pc386_delay)
|
||||
movb $0x28, al /* start of hardware int's 2 (0x28) */
|
||||
outb al, $0xA1
|
||||
call SYM(delay)
|
||||
call SYM(pc386_delay)
|
||||
|
||||
movb $0x04, al /* 8259-1 is master */
|
||||
outb al, $0x21
|
||||
call SYM(delay)
|
||||
call SYM(pc386_delay)
|
||||
movb $0x02, al /* 8259-2 is slave */
|
||||
outb al, $0xA1
|
||||
call SYM(delay)
|
||||
call SYM(pc386_delay)
|
||||
|
||||
movb $0x01, al /* 8086 mode for both */
|
||||
outb al, $0x21
|
||||
call SYM(delay)
|
||||
call SYM(pc386_delay)
|
||||
outb al, $0xA1
|
||||
call SYM(delay)
|
||||
call SYM(pc386_delay)
|
||||
|
||||
movb $0xFF, al /* mask off all interrupts for now */
|
||||
outb al, $0xA1
|
||||
call SYM(delay)
|
||||
call SYM(pc386_delay)
|
||||
movb $0xFB, al /* mask all irq's but irq2 which */
|
||||
outb al, $0x21 /* is cascaded */
|
||||
call SYM(delay)
|
||||
call SYM(pc386_delay)
|
||||
|
||||
movw $0xFFFB, SYM(i8259s_cache) /* set up same values in cache */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user