forked from Imagelibrary/rtems
2011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org>
* shared/comm/gdb_glue.c, shared/comm/i386-stub.c, shared/comm/i386_io.h, shared/comm/uart.c, shared/irq/idt.c, shared/pci/pcibios.c: Use "__asm__" instead of "asm" for improved c99-compliance.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||
|
||||
* shared/comm/gdb_glue.c, shared/comm/i386-stub.c,
|
||||
shared/comm/i386_io.h, shared/comm/uart.c, shared/irq/idt.c,
|
||||
shared/pci/pcibios.c:
|
||||
Use "__asm__" instead of "asm" for improved c99-compliance.
|
||||
|
||||
2011-02-02 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||
|
||||
* configure.ac: Require autoconf-2.68, automake-1.11.1.
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <stdio.h>
|
||||
#include <uart.h>
|
||||
|
||||
#define BREAKPOINT() asm(" int $3");
|
||||
#define BREAKPOINT() __asm__ (" int $3");
|
||||
|
||||
extern int BSPConsolePort;
|
||||
void i386_stub_glue_init(int);
|
||||
|
||||
@@ -160,33 +160,33 @@ extern void
|
||||
/* Restore the program's registers (including the stack pointer, which
|
||||
means we get the right stack and don't have to worry about popping our
|
||||
return address and any stack frames and so on) and return. */
|
||||
asm (".text");
|
||||
asm (".globl return_to_prog");
|
||||
asm ("return_to_prog:");
|
||||
asm (" movw registers+44, %ss");
|
||||
asm (" movl registers+16, %esp");
|
||||
asm (" movl registers+4, %ecx");
|
||||
asm (" movl registers+8, %edx");
|
||||
asm (" movl registers+12, %ebx");
|
||||
asm (" movl registers+20, %ebp");
|
||||
asm (" movl registers+24, %esi");
|
||||
asm (" movl registers+28, %edi");
|
||||
asm (" movw registers+48, %ds");
|
||||
asm (" movw registers+52, %es");
|
||||
asm (" movw registers+56, %fs");
|
||||
asm (" movw registers+60, %gs");
|
||||
asm (" movl registers+36, %eax");
|
||||
asm (" pushl %eax"); /* saved eflags */
|
||||
asm (" movl registers+40, %eax");
|
||||
asm (" pushl %eax"); /* saved cs */
|
||||
asm (" movl registers+32, %eax");
|
||||
asm (" pushl %eax"); /* saved eip */
|
||||
asm (" movl registers, %eax");
|
||||
__asm__ (".text");
|
||||
__asm__ (".globl return_to_prog");
|
||||
__asm__ ("return_to_prog:");
|
||||
__asm__ (" movw registers+44, %ss");
|
||||
__asm__ (" movl registers+16, %esp");
|
||||
__asm__ (" movl registers+4, %ecx");
|
||||
__asm__ (" movl registers+8, %edx");
|
||||
__asm__ (" movl registers+12, %ebx");
|
||||
__asm__ (" movl registers+20, %ebp");
|
||||
__asm__ (" movl registers+24, %esi");
|
||||
__asm__ (" movl registers+28, %edi");
|
||||
__asm__ (" movw registers+48, %ds");
|
||||
__asm__ (" movw registers+52, %es");
|
||||
__asm__ (" movw registers+56, %fs");
|
||||
__asm__ (" movw registers+60, %gs");
|
||||
__asm__ (" movl registers+36, %eax");
|
||||
__asm__ (" pushl %eax"); /* saved eflags */
|
||||
__asm__ (" movl registers+40, %eax");
|
||||
__asm__ (" pushl %eax"); /* saved cs */
|
||||
__asm__ (" movl registers+32, %eax");
|
||||
__asm__ (" pushl %eax"); /* saved eip */
|
||||
__asm__ (" movl registers, %eax");
|
||||
/* use iret to restore pc and flags together so
|
||||
that trace flag works right. */
|
||||
asm (" iret");
|
||||
__asm__ (" iret");
|
||||
|
||||
#define BREAKPOINT() asm(" int $3");
|
||||
#define BREAKPOINT() __asm__ (" int $3");
|
||||
|
||||
/* Put the error code here just in case the user cares. */
|
||||
int gdb_i386errcode;
|
||||
@@ -197,74 +197,74 @@ int gdb_i386vector = -1;
|
||||
/* GDB stores segment registers in 32-bit words (that's just the way
|
||||
m-i386v.h is written). So zero the appropriate areas in registers. */
|
||||
#define SAVE_REGISTERS1() \
|
||||
asm ("movl %eax, registers"); \
|
||||
asm ("movl %ecx, registers+4"); \
|
||||
asm ("movl %edx, registers+8"); \
|
||||
asm ("movl %ebx, registers+12"); \
|
||||
asm ("movl %ebp, registers+20"); \
|
||||
asm ("movl %esi, registers+24"); \
|
||||
asm ("movl %edi, registers+28"); \
|
||||
asm ("movw $0, %ax"); \
|
||||
asm ("movw %ds, registers+48"); \
|
||||
asm ("movw %ax, registers+50"); \
|
||||
asm ("movw %es, registers+52"); \
|
||||
asm ("movw %ax, registers+54"); \
|
||||
asm ("movw %fs, registers+56"); \
|
||||
asm ("movw %ax, registers+58"); \
|
||||
asm ("movw %gs, registers+60"); \
|
||||
asm ("movw %ax, registers+62");
|
||||
__asm__ ("movl %eax, registers"); \
|
||||
__asm__ ("movl %ecx, registers+4"); \
|
||||
__asm__ ("movl %edx, registers+8"); \
|
||||
__asm__ ("movl %ebx, registers+12"); \
|
||||
__asm__ ("movl %ebp, registers+20"); \
|
||||
__asm__ ("movl %esi, registers+24"); \
|
||||
__asm__ ("movl %edi, registers+28"); \
|
||||
__asm__ ("movw $0, %ax"); \
|
||||
__asm__ ("movw %ds, registers+48"); \
|
||||
__asm__ ("movw %ax, registers+50"); \
|
||||
__asm__ ("movw %es, registers+52"); \
|
||||
__asm__ ("movw %ax, registers+54"); \
|
||||
__asm__ ("movw %fs, registers+56"); \
|
||||
__asm__ ("movw %ax, registers+58"); \
|
||||
__asm__ ("movw %gs, registers+60"); \
|
||||
__asm__ ("movw %ax, registers+62");
|
||||
#define SAVE_ERRCODE() \
|
||||
asm ("popl %ebx"); \
|
||||
asm ("movl %ebx, gdb_i386errcode");
|
||||
__asm__ ("popl %ebx"); \
|
||||
__asm__ ("movl %ebx, gdb_i386errcode");
|
||||
#define SAVE_REGISTERS2() \
|
||||
asm ("popl %ebx"); /* old eip */ \
|
||||
asm ("movl %ebx, registers+32"); \
|
||||
asm ("popl %ebx"); /* old cs */ \
|
||||
asm ("movl %ebx, registers+40"); \
|
||||
asm ("movw %ax, registers+42"); \
|
||||
asm ("popl %ebx"); /* old eflags */ \
|
||||
asm ("movl %ebx, registers+36"); \
|
||||
__asm__ ("popl %ebx"); /* old eip */ \
|
||||
__asm__ ("movl %ebx, registers+32"); \
|
||||
__asm__ ("popl %ebx"); /* old cs */ \
|
||||
__asm__ ("movl %ebx, registers+40"); \
|
||||
__asm__ ("movw %ax, registers+42"); \
|
||||
__asm__ ("popl %ebx"); /* old eflags */ \
|
||||
__asm__ ("movl %ebx, registers+36"); \
|
||||
/* Now that we've done the pops, we can save the stack pointer."); */ \
|
||||
asm ("movw %ss, registers+44"); \
|
||||
asm ("movw %ax, registers+46"); \
|
||||
asm ("movl %esp, registers+16");
|
||||
__asm__ ("movw %ss, registers+44"); \
|
||||
__asm__ ("movw %ax, registers+46"); \
|
||||
__asm__ ("movl %esp, registers+16");
|
||||
|
||||
/* See if mem_fault_routine is set, if so just IRET to that address. */
|
||||
#define CHECK_FAULT() \
|
||||
asm ("cmpl $0, mem_fault_routine"); \
|
||||
asm ("jne mem_fault");
|
||||
__asm__ ("cmpl $0, mem_fault_routine"); \
|
||||
__asm__ ("jne mem_fault");
|
||||
|
||||
asm (".text");
|
||||
asm ("mem_fault:");
|
||||
__asm__ (".text");
|
||||
__asm__ ("mem_fault:");
|
||||
/* OK to clobber temp registers; we're just going to end up in set_mem_err. */
|
||||
/* Pop error code from the stack and save it. */
|
||||
asm (" popl %eax");
|
||||
asm (" movl %eax, gdb_i386errcode");
|
||||
__asm__ (" popl %eax");
|
||||
__asm__ (" movl %eax, gdb_i386errcode");
|
||||
|
||||
asm (" popl %eax"); /* eip */
|
||||
__asm__ (" popl %eax"); /* eip */
|
||||
/* We don't want to return there, we want to return to the function
|
||||
pointed to by mem_fault_routine instead. */
|
||||
asm (" movl mem_fault_routine, %eax");
|
||||
asm (" popl %ecx"); /* cs (low 16 bits; junk in hi 16 bits). */
|
||||
asm (" popl %edx"); /* eflags */
|
||||
__asm__ (" movl mem_fault_routine, %eax");
|
||||
__asm__ (" popl %ecx"); /* cs (low 16 bits; junk in hi 16 bits). */
|
||||
__asm__ (" popl %edx"); /* eflags */
|
||||
|
||||
/* Remove this stack frame; when we do the iret, we will be going to
|
||||
the start of a function, so we want the stack to look just like it
|
||||
would after a "call" instruction. */
|
||||
asm (" leave");
|
||||
__asm__ (" leave");
|
||||
|
||||
/* Push the stuff that iret wants. */
|
||||
asm (" pushl %edx"); /* eflags */
|
||||
asm (" pushl %ecx"); /* cs */
|
||||
asm (" pushl %eax"); /* eip */
|
||||
__asm__ (" pushl %edx"); /* eflags */
|
||||
__asm__ (" pushl %ecx"); /* cs */
|
||||
__asm__ (" pushl %eax"); /* eip */
|
||||
|
||||
/* Zero mem_fault_routine. */
|
||||
asm (" movl $0, %eax");
|
||||
asm (" movl %eax, mem_fault_routine");
|
||||
__asm__ (" movl $0, %eax");
|
||||
__asm__ (" movl %eax, mem_fault_routine");
|
||||
|
||||
asm ("iret");
|
||||
__asm__ ("iret");
|
||||
|
||||
#define CALL_HOOK() asm("call _remcomHandler");
|
||||
#define CALL_HOOK() __asm__ ("call _remcomHandler");
|
||||
|
||||
/* This function is called when a i386 exception occurs. It saves
|
||||
* all the cpu regs in the registers array, munges the stack a bit,
|
||||
@@ -277,163 +277,163 @@ asm ("iret");
|
||||
*
|
||||
*/
|
||||
extern void _catchException3 (void);
|
||||
asm (".text");
|
||||
asm (".globl _catchException3");
|
||||
asm ("_catchException3:");
|
||||
__asm__ (".text");
|
||||
__asm__ (".globl _catchException3");
|
||||
__asm__ ("_catchException3:");
|
||||
SAVE_REGISTERS1 ();
|
||||
SAVE_REGISTERS2 ();
|
||||
asm ("pushl $3");
|
||||
__asm__ ("pushl $3");
|
||||
CALL_HOOK ();
|
||||
|
||||
/* Same thing for exception 1. */
|
||||
extern void _catchException1 (void);
|
||||
asm (".text");
|
||||
asm (".globl _catchException1");
|
||||
asm ("_catchException1:");
|
||||
__asm__ (".text");
|
||||
__asm__ (".globl _catchException1");
|
||||
__asm__ ("_catchException1:");
|
||||
SAVE_REGISTERS1 ();
|
||||
SAVE_REGISTERS2 ();
|
||||
asm ("pushl $1");
|
||||
__asm__ ("pushl $1");
|
||||
CALL_HOOK ();
|
||||
|
||||
/* Same thing for exception 0. */
|
||||
extern void _catchException0 (void);
|
||||
asm (".text");
|
||||
asm (".globl _catchException0");
|
||||
asm ("_catchException0:");
|
||||
__asm__ (".text");
|
||||
__asm__ (".globl _catchException0");
|
||||
__asm__ ("_catchException0:");
|
||||
SAVE_REGISTERS1 ();
|
||||
SAVE_REGISTERS2 ();
|
||||
asm ("pushl $0");
|
||||
__asm__ ("pushl $0");
|
||||
CALL_HOOK ();
|
||||
|
||||
/* Same thing for exception 4. */
|
||||
extern void _catchException4 (void);
|
||||
asm (".text");
|
||||
asm (".globl _catchException4");
|
||||
asm ("_catchException4:");
|
||||
__asm__ (".text");
|
||||
__asm__ (".globl _catchException4");
|
||||
__asm__ ("_catchException4:");
|
||||
SAVE_REGISTERS1 ();
|
||||
SAVE_REGISTERS2 ();
|
||||
asm ("pushl $4");
|
||||
__asm__ ("pushl $4");
|
||||
CALL_HOOK ();
|
||||
|
||||
/* Same thing for exception 5. */
|
||||
extern void _catchException5 (void);
|
||||
asm (".text");
|
||||
asm (".globl _catchException5");
|
||||
asm ("_catchException5:");
|
||||
__asm__ (".text");
|
||||
__asm__ (".globl _catchException5");
|
||||
__asm__ ("_catchException5:");
|
||||
SAVE_REGISTERS1 ();
|
||||
SAVE_REGISTERS2 ();
|
||||
asm ("pushl $5");
|
||||
__asm__ ("pushl $5");
|
||||
CALL_HOOK ();
|
||||
|
||||
/* Same thing for exception 6. */
|
||||
extern void _catchException6 (void);
|
||||
asm (".text");
|
||||
asm (".globl _catchException6");
|
||||
asm ("_catchException6:");
|
||||
__asm__ (".text");
|
||||
__asm__ (".globl _catchException6");
|
||||
__asm__ ("_catchException6:");
|
||||
SAVE_REGISTERS1 ();
|
||||
SAVE_REGISTERS2 ();
|
||||
asm ("pushl $6");
|
||||
__asm__ ("pushl $6");
|
||||
CALL_HOOK ();
|
||||
|
||||
/* Same thing for exception 7. */
|
||||
extern void _catchException7 (void);
|
||||
asm (".text");
|
||||
asm (".globl _catchException7");
|
||||
asm ("_catchException7:");
|
||||
__asm__ (".text");
|
||||
__asm__ (".globl _catchException7");
|
||||
__asm__ ("_catchException7:");
|
||||
SAVE_REGISTERS1 ();
|
||||
SAVE_REGISTERS2 ();
|
||||
asm ("pushl $7");
|
||||
__asm__ ("pushl $7");
|
||||
CALL_HOOK ();
|
||||
|
||||
/* Same thing for exception 8. */
|
||||
extern void _catchException8 (void);
|
||||
asm (".text");
|
||||
asm (".globl _catchException8");
|
||||
asm ("_catchException8:");
|
||||
__asm__ (".text");
|
||||
__asm__ (".globl _catchException8");
|
||||
__asm__ ("_catchException8:");
|
||||
SAVE_REGISTERS1 ();
|
||||
SAVE_ERRCODE ();
|
||||
SAVE_REGISTERS2 ();
|
||||
asm ("pushl $8");
|
||||
__asm__ ("pushl $8");
|
||||
CALL_HOOK ();
|
||||
|
||||
/* Same thing for exception 9. */
|
||||
extern void _catchException9 (void);
|
||||
asm (".text");
|
||||
asm (".globl _catchException9");
|
||||
asm ("_catchException9:");
|
||||
__asm__ (".text");
|
||||
__asm__ (".globl _catchException9");
|
||||
__asm__ ("_catchException9:");
|
||||
SAVE_REGISTERS1 ();
|
||||
SAVE_REGISTERS2 ();
|
||||
asm ("pushl $9");
|
||||
__asm__ ("pushl $9");
|
||||
CALL_HOOK ();
|
||||
|
||||
/* Same thing for exception 10. */
|
||||
extern void _catchException10 (void);
|
||||
asm (".text");
|
||||
asm (".globl _catchException10");
|
||||
asm ("_catchException10:");
|
||||
__asm__ (".text");
|
||||
__asm__ (".globl _catchException10");
|
||||
__asm__ ("_catchException10:");
|
||||
SAVE_REGISTERS1 ();
|
||||
SAVE_ERRCODE ();
|
||||
SAVE_REGISTERS2 ();
|
||||
asm ("pushl $10");
|
||||
__asm__ ("pushl $10");
|
||||
CALL_HOOK ();
|
||||
|
||||
/* Same thing for exception 12. */
|
||||
extern void _catchException12 (void);
|
||||
asm (".text");
|
||||
asm (".globl _catchException12");
|
||||
asm ("_catchException12:");
|
||||
__asm__ (".text");
|
||||
__asm__ (".globl _catchException12");
|
||||
__asm__ ("_catchException12:");
|
||||
SAVE_REGISTERS1 ();
|
||||
SAVE_ERRCODE ();
|
||||
SAVE_REGISTERS2 ();
|
||||
asm ("pushl $12");
|
||||
__asm__ ("pushl $12");
|
||||
CALL_HOOK ();
|
||||
|
||||
/* Same thing for exception 16. */
|
||||
extern void _catchException16 (void);
|
||||
asm (".text");
|
||||
asm (".globl _catchException16");
|
||||
asm ("_catchException16:");
|
||||
__asm__ (".text");
|
||||
__asm__ (".globl _catchException16");
|
||||
__asm__ ("_catchException16:");
|
||||
SAVE_REGISTERS1 ();
|
||||
SAVE_REGISTERS2 ();
|
||||
asm ("pushl $16");
|
||||
__asm__ ("pushl $16");
|
||||
CALL_HOOK ();
|
||||
|
||||
/* For 13, 11, and 14 we have to deal with the CHECK_FAULT stuff. */
|
||||
|
||||
/* Same thing for exception 13. */
|
||||
extern void _catchException13 (void);
|
||||
asm (".text");
|
||||
asm (".globl _catchException13");
|
||||
asm ("_catchException13:");
|
||||
__asm__ (".text");
|
||||
__asm__ (".globl _catchException13");
|
||||
__asm__ ("_catchException13:");
|
||||
CHECK_FAULT ();
|
||||
SAVE_REGISTERS1 ();
|
||||
SAVE_ERRCODE ();
|
||||
SAVE_REGISTERS2 ();
|
||||
asm ("pushl $13");
|
||||
__asm__ ("pushl $13");
|
||||
CALL_HOOK ();
|
||||
|
||||
/* Same thing for exception 11. */
|
||||
extern void _catchException11 (void);
|
||||
asm (".text");
|
||||
asm (".globl _catchException11");
|
||||
asm ("_catchException11:");
|
||||
__asm__ (".text");
|
||||
__asm__ (".globl _catchException11");
|
||||
__asm__ ("_catchException11:");
|
||||
CHECK_FAULT ();
|
||||
SAVE_REGISTERS1 ();
|
||||
SAVE_ERRCODE ();
|
||||
SAVE_REGISTERS2 ();
|
||||
asm ("pushl $11");
|
||||
__asm__ ("pushl $11");
|
||||
CALL_HOOK ();
|
||||
|
||||
/* Same thing for exception 14. */
|
||||
extern void _catchException14 (void);
|
||||
asm (".text");
|
||||
asm (".globl _catchException14");
|
||||
asm ("_catchException14:");
|
||||
__asm__ (".text");
|
||||
__asm__ (".globl _catchException14");
|
||||
__asm__ ("_catchException14:");
|
||||
CHECK_FAULT ();
|
||||
SAVE_REGISTERS1 ();
|
||||
SAVE_ERRCODE ();
|
||||
SAVE_REGISTERS2 ();
|
||||
asm ("pushl $14");
|
||||
__asm__ ("pushl $14");
|
||||
CALL_HOOK ();
|
||||
|
||||
/*
|
||||
@@ -441,12 +441,12 @@ CALL_HOOK ();
|
||||
* stack pointer into an area reserved for debugger use.
|
||||
*/
|
||||
extern void remcomHandler (void);
|
||||
asm ("_remcomHandler:");
|
||||
asm (" popl %eax"); /* pop off return address */
|
||||
asm (" popl %eax"); /* get the exception number */
|
||||
asm (" movl stackPtr, %esp"); /* move to remcom stack area */
|
||||
asm (" pushl %eax"); /* push exception onto stack */
|
||||
asm (" call handle_exception"); /* this never returns */
|
||||
__asm__ ("_remcomHandler:");
|
||||
__asm__ (" popl %eax"); /* pop off return address */
|
||||
__asm__ (" popl %eax"); /* get the exception number */
|
||||
__asm__ (" movl stackPtr, %esp"); /* move to remcom stack area */
|
||||
__asm__ (" pushl %eax"); /* push exception onto stack */
|
||||
__asm__ (" call handle_exception"); /* this never returns */
|
||||
|
||||
void
|
||||
_returnFromException (void)
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
({ \
|
||||
register int _inb_result; \
|
||||
\
|
||||
asm volatile ("xorl %%eax,%%eax; inb %%dx,%%al" : \
|
||||
__asm__ volatile ("xorl %%eax,%%eax; inb %%dx,%%al" : \
|
||||
"=a" (_inb_result) : "d" (port)); \
|
||||
_inb_result; \
|
||||
})
|
||||
@@ -28,16 +28,16 @@
|
||||
({ \
|
||||
register int _inbw_result; \
|
||||
\
|
||||
asm volatile ("xorl %%eax,%%eax; inw %%dx,%%ax" : \
|
||||
__asm__ volatile ("xorl %%eax,%%eax; inw %%dx,%%ax" : \
|
||||
"=a" (_inbw_result) : "d" (port)); \
|
||||
_inbw_result; \
|
||||
})
|
||||
|
||||
#define rtems_outb(port, data) \
|
||||
asm volatile ("outb %%al,%%dx" : : "a" (data), "d" (port))
|
||||
__asm__ volatile ("outb %%al,%%dx" : : "a" (data), "d" (port))
|
||||
|
||||
#define rtems_outw(port, data) \
|
||||
asm volatile ("outw %%ax,%%dx" : : "a" (data), "d" (port))
|
||||
__asm__ volatile ("outw %%ax,%%dx" : : "a" (data), "d" (port))
|
||||
|
||||
#define outp(port, val) rtems_outb(port,val)
|
||||
#define inp(port) rtems_inb(port)
|
||||
|
||||
@@ -841,75 +841,75 @@ int BSP_uart_dbgisr_com_regsav[4] __attribute__ ((unused));
|
||||
* handler
|
||||
*/
|
||||
|
||||
asm (".p2align 4");
|
||||
asm (".text");
|
||||
asm (".globl BSP_uart_dbgisr_com1");
|
||||
asm ("BSP_uart_dbgisr_com1:");
|
||||
asm (" movl %eax, BSP_uart_dbgisr_com_regsav"); /* Save eax */
|
||||
asm (" movl %ebx, BSP_uart_dbgisr_com_regsav + 4"); /* Save ebx */
|
||||
asm (" movl %edx, BSP_uart_dbgisr_com_regsav + 8"); /* Save edx */
|
||||
__asm__ (".p2align 4");
|
||||
__asm__ (".text");
|
||||
__asm__ (".globl BSP_uart_dbgisr_com1");
|
||||
__asm__ ("BSP_uart_dbgisr_com1:");
|
||||
__asm__ (" movl %eax, BSP_uart_dbgisr_com_regsav"); /* Save eax */
|
||||
__asm__ (" movl %ebx, BSP_uart_dbgisr_com_regsav + 4"); /* Save ebx */
|
||||
__asm__ (" movl %edx, BSP_uart_dbgisr_com_regsav + 8"); /* Save edx */
|
||||
|
||||
asm (" movl $0, %ebx"); /* Clear flag */
|
||||
__asm__ (" movl $0, %ebx"); /* Clear flag */
|
||||
|
||||
/*
|
||||
* We know that only receive related interrupts
|
||||
* are available, eat chars
|
||||
*/
|
||||
asm ("uart_dbgisr_com1_1:");
|
||||
asm (" movw $0x3FD, %dx");
|
||||
asm (" inb %dx, %al"); /* Read LSR */
|
||||
asm (" andb $1, %al");
|
||||
asm (" cmpb $0, %al");
|
||||
asm (" je uart_dbgisr_com1_2");
|
||||
asm (" movw $0x3F8, %dx");
|
||||
asm (" inb %dx, %al"); /* Get input character */
|
||||
asm (" cmpb $3, %al");
|
||||
asm (" jne uart_dbgisr_com1_1");
|
||||
__asm__ ("uart_dbgisr_com1_1:");
|
||||
__asm__ (" movw $0x3FD, %dx");
|
||||
__asm__ (" inb %dx, %al"); /* Read LSR */
|
||||
__asm__ (" andb $1, %al");
|
||||
__asm__ (" cmpb $0, %al");
|
||||
__asm__ (" je uart_dbgisr_com1_2");
|
||||
__asm__ (" movw $0x3F8, %dx");
|
||||
__asm__ (" inb %dx, %al"); /* Get input character */
|
||||
__asm__ (" cmpb $3, %al");
|
||||
__asm__ (" jne uart_dbgisr_com1_1");
|
||||
|
||||
/* ^C received, set flag */
|
||||
asm (" movl $1, %ebx");
|
||||
asm (" jmp uart_dbgisr_com1_1");
|
||||
__asm__ (" movl $1, %ebx");
|
||||
__asm__ (" jmp uart_dbgisr_com1_1");
|
||||
|
||||
/* All chars read */
|
||||
asm ("uart_dbgisr_com1_2:");
|
||||
__asm__ ("uart_dbgisr_com1_2:");
|
||||
|
||||
/* If flag is set we have to tweak TF */
|
||||
asm (" cmpl $0, %ebx");
|
||||
asm (" je uart_dbgisr_com1_3");
|
||||
__asm__ (" cmpl $0, %ebx");
|
||||
__asm__ (" je uart_dbgisr_com1_3");
|
||||
|
||||
/* Flag is set */
|
||||
asm (" movl BSP_uart_dbgisr_com_regsav+4, %ebx"); /* Restore ebx */
|
||||
asm (" movl BSP_uart_dbgisr_com_regsav+8, %edx"); /* Restore edx */
|
||||
__asm__ (" movl BSP_uart_dbgisr_com_regsav+4, %ebx"); /* Restore ebx */
|
||||
__asm__ (" movl BSP_uart_dbgisr_com_regsav+8, %edx"); /* Restore edx */
|
||||
|
||||
/* Set TF bit */
|
||||
asm (" popl %eax"); /* Pop eip */
|
||||
asm (" movl %eax, BSP_uart_dbgisr_com_regsav + 4"); /* Save it */
|
||||
asm (" popl %eax"); /* Pop cs */
|
||||
asm (" movl %eax, BSP_uart_dbgisr_com_regsav + 8"); /* Save it */
|
||||
asm (" popl %eax"); /* Pop flags */
|
||||
asm (" orl $0x100, %eax"); /* Modify it */
|
||||
asm (" pushl %eax"); /* Push it back */
|
||||
asm (" movl BSP_uart_dbgisr_com_regsav+8, %eax"); /* Put back cs */
|
||||
asm (" pushl %eax");
|
||||
asm (" movl BSP_uart_dbgisr_com_regsav+4, %eax"); /* Put back eip */
|
||||
asm (" pushl %eax");
|
||||
__asm__ (" popl %eax"); /* Pop eip */
|
||||
__asm__ (" movl %eax, BSP_uart_dbgisr_com_regsav + 4"); /* Save it */
|
||||
__asm__ (" popl %eax"); /* Pop cs */
|
||||
__asm__ (" movl %eax, BSP_uart_dbgisr_com_regsav + 8"); /* Save it */
|
||||
__asm__ (" popl %eax"); /* Pop flags */
|
||||
__asm__ (" orl $0x100, %eax"); /* Modify it */
|
||||
__asm__ (" pushl %eax"); /* Push it back */
|
||||
__asm__ (" movl BSP_uart_dbgisr_com_regsav+8, %eax"); /* Put back cs */
|
||||
__asm__ (" pushl %eax");
|
||||
__asm__ (" movl BSP_uart_dbgisr_com_regsav+4, %eax"); /* Put back eip */
|
||||
__asm__ (" pushl %eax");
|
||||
|
||||
/* Acknowledge IRQ */
|
||||
asm (" movb $0x20, %al");
|
||||
asm (" outb %al, $0x20");
|
||||
asm (" movl BSP_uart_dbgisr_com_regsav, %eax"); /* Restore eax */
|
||||
asm (" iret"); /* Done */
|
||||
__asm__ (" movb $0x20, %al");
|
||||
__asm__ (" outb %al, $0x20");
|
||||
__asm__ (" movl BSP_uart_dbgisr_com_regsav, %eax"); /* Restore eax */
|
||||
__asm__ (" iret"); /* Done */
|
||||
|
||||
/* Flag is not set */
|
||||
asm("uart_dbgisr_com1_3:");
|
||||
asm (" movl BSP_uart_dbgisr_com_regsav+4, %ebx"); /* Restore ebx */
|
||||
asm (" movl BSP_uart_dbgisr_com_regsav+8, %edx"); /* Restore edx */
|
||||
__asm__ ("uart_dbgisr_com1_3:");
|
||||
__asm__ (" movl BSP_uart_dbgisr_com_regsav+4, %ebx"); /* Restore ebx */
|
||||
__asm__ (" movl BSP_uart_dbgisr_com_regsav+8, %edx"); /* Restore edx */
|
||||
|
||||
/* Acknowledge irq */
|
||||
asm (" movb $0x20, %al");
|
||||
asm (" outb %al, $0x20");
|
||||
asm (" movl BSP_uart_dbgisr_com_regsav, %eax"); /* Restore eax */
|
||||
asm (" iret"); /* Done */
|
||||
__asm__ (" movb $0x20, %al");
|
||||
__asm__ (" outb %al, $0x20");
|
||||
__asm__ (" movl BSP_uart_dbgisr_com_regsav, %eax"); /* Restore eax */
|
||||
__asm__ (" iret"); /* Done */
|
||||
|
||||
/*
|
||||
* Interrupt service routine for COM2 - all,
|
||||
@@ -918,72 +918,72 @@ asm (" iret"); /* Done */
|
||||
* Note: it has to be installed as raw interrupt
|
||||
* handler
|
||||
*/
|
||||
asm (".p2align 4");
|
||||
asm (".text");
|
||||
asm (".globl BSP_uart_dbgisr_com2");
|
||||
asm ("BSP_uart_dbgisr_com2:");
|
||||
asm (" movl %eax, BSP_uart_dbgisr_com_regsav"); /* Save eax */
|
||||
asm (" movl %ebx, BSP_uart_dbgisr_com_regsav + 4"); /* Save ebx */
|
||||
asm (" movl %edx, BSP_uart_dbgisr_com_regsav + 8"); /* Save edx */
|
||||
__asm__ (".p2align 4");
|
||||
__asm__ (".text");
|
||||
__asm__ (".globl BSP_uart_dbgisr_com2");
|
||||
__asm__ ("BSP_uart_dbgisr_com2:");
|
||||
__asm__ (" movl %eax, BSP_uart_dbgisr_com_regsav"); /* Save eax */
|
||||
__asm__ (" movl %ebx, BSP_uart_dbgisr_com_regsav + 4"); /* Save ebx */
|
||||
__asm__ (" movl %edx, BSP_uart_dbgisr_com_regsav + 8"); /* Save edx */
|
||||
|
||||
asm (" movl $0, %ebx"); /* Clear flag */
|
||||
__asm__ (" movl $0, %ebx"); /* Clear flag */
|
||||
|
||||
/*
|
||||
* We know that only receive related interrupts
|
||||
* are available, eat chars
|
||||
*/
|
||||
asm ("uart_dbgisr_com2_1:");
|
||||
asm (" movw $0x2FD, %dx");
|
||||
asm (" inb %dx, %al"); /* Read LSR */
|
||||
asm (" andb $1, %al");
|
||||
asm (" cmpb $0, %al");
|
||||
asm (" je uart_dbgisr_com2_2");
|
||||
asm (" movw $0x2F8, %dx");
|
||||
asm (" inb %dx, %al"); /* Get input character */
|
||||
asm (" cmpb $3, %al");
|
||||
asm (" jne uart_dbgisr_com2_1");
|
||||
__asm__ ("uart_dbgisr_com2_1:");
|
||||
__asm__ (" movw $0x2FD, %dx");
|
||||
__asm__ (" inb %dx, %al"); /* Read LSR */
|
||||
__asm__ (" andb $1, %al");
|
||||
__asm__ (" cmpb $0, %al");
|
||||
__asm__ (" je uart_dbgisr_com2_2");
|
||||
__asm__ (" movw $0x2F8, %dx");
|
||||
__asm__ (" inb %dx, %al"); /* Get input character */
|
||||
__asm__ (" cmpb $3, %al");
|
||||
__asm__ (" jne uart_dbgisr_com2_1");
|
||||
|
||||
/* ^C received, set flag */
|
||||
asm (" movl $1, %ebx");
|
||||
asm (" jmp uart_dbgisr_com2_1");
|
||||
__asm__ (" movl $1, %ebx");
|
||||
__asm__ (" jmp uart_dbgisr_com2_1");
|
||||
|
||||
/* All chars read */
|
||||
asm ("uart_dbgisr_com2_2:");
|
||||
__asm__ ("uart_dbgisr_com2_2:");
|
||||
|
||||
/* If flag is set we have to tweak TF */
|
||||
asm (" cmpl $0, %ebx");
|
||||
asm (" je uart_dbgisr_com2_3");
|
||||
__asm__ (" cmpl $0, %ebx");
|
||||
__asm__ (" je uart_dbgisr_com2_3");
|
||||
|
||||
/* Flag is set */
|
||||
asm (" movl BSP_uart_dbgisr_com_regsav+4, %ebx"); /* Restore ebx */
|
||||
asm (" movl BSP_uart_dbgisr_com_regsav+8, %edx"); /* Restore edx */
|
||||
__asm__ (" movl BSP_uart_dbgisr_com_regsav+4, %ebx"); /* Restore ebx */
|
||||
__asm__ (" movl BSP_uart_dbgisr_com_regsav+8, %edx"); /* Restore edx */
|
||||
|
||||
/* Set TF bit */
|
||||
asm (" popl %eax"); /* Pop eip */
|
||||
asm (" movl %eax, BSP_uart_dbgisr_com_regsav + 4"); /* Save it */
|
||||
asm (" popl %eax"); /* Pop cs */
|
||||
asm (" movl %eax, BSP_uart_dbgisr_com_regsav + 8"); /* Save it */
|
||||
asm (" popl %eax"); /* Pop flags */
|
||||
asm (" orl $0x100, %eax"); /* Modify it */
|
||||
asm (" pushl %eax"); /* Push it back */
|
||||
asm (" movl BSP_uart_dbgisr_com_regsav+8, %eax"); /* Put back cs */
|
||||
asm (" pushl %eax");
|
||||
asm (" movl BSP_uart_dbgisr_com_regsav+4, %eax"); /* Put back eip */
|
||||
asm (" pushl %eax");
|
||||
__asm__ (" popl %eax"); /* Pop eip */
|
||||
__asm__ (" movl %eax, BSP_uart_dbgisr_com_regsav + 4"); /* Save it */
|
||||
__asm__ (" popl %eax"); /* Pop cs */
|
||||
__asm__ (" movl %eax, BSP_uart_dbgisr_com_regsav + 8"); /* Save it */
|
||||
__asm__ (" popl %eax"); /* Pop flags */
|
||||
__asm__ (" orl $0x100, %eax"); /* Modify it */
|
||||
__asm__ (" pushl %eax"); /* Push it back */
|
||||
__asm__ (" movl BSP_uart_dbgisr_com_regsav+8, %eax"); /* Put back cs */
|
||||
__asm__ (" pushl %eax");
|
||||
__asm__ (" movl BSP_uart_dbgisr_com_regsav+4, %eax"); /* Put back eip */
|
||||
__asm__ (" pushl %eax");
|
||||
|
||||
/* Acknowledge IRQ */
|
||||
asm (" movb $0x20, %al");
|
||||
asm (" outb %al, $0x20");
|
||||
asm (" movl BSP_uart_dbgisr_com_regsav, %eax"); /* Restore eax */
|
||||
asm (" iret"); /* Done */
|
||||
__asm__ (" movb $0x20, %al");
|
||||
__asm__ (" outb %al, $0x20");
|
||||
__asm__ (" movl BSP_uart_dbgisr_com_regsav, %eax"); /* Restore eax */
|
||||
__asm__ (" iret"); /* Done */
|
||||
|
||||
/* Flag is not set */
|
||||
asm("uart_dbgisr_com2_3:");
|
||||
asm (" movl BSP_uart_dbgisr_com_regsav+4, %ebx"); /* Restore ebx */
|
||||
asm (" movl BSP_uart_dbgisr_com_regsav+8, %edx"); /* Restore edx */
|
||||
__asm__ ("uart_dbgisr_com2_3:");
|
||||
__asm__ (" movl BSP_uart_dbgisr_com_regsav+4, %ebx"); /* Restore ebx */
|
||||
__asm__ (" movl BSP_uart_dbgisr_com_regsav+8, %edx"); /* Restore edx */
|
||||
|
||||
/* Acknowledge irq */
|
||||
asm (" movb $0x20, %al");
|
||||
asm (" outb %al, $0x20");
|
||||
asm (" movl BSP_uart_dbgisr_com_regsav, %eax"); /* Restore eax */
|
||||
asm (" iret"); /* Done */
|
||||
__asm__ (" movb $0x20, %al");
|
||||
__asm__ (" outb %al, $0x20");
|
||||
__asm__ (" movl BSP_uart_dbgisr_com_regsav, %eax"); /* Restore eax */
|
||||
__asm__ (" iret"); /* Done */
|
||||
|
||||
@@ -275,7 +275,7 @@ int i386_set_gdt_entry (unsigned short segment_selector, unsigned base,
|
||||
* Now, reload all segment registers so the limit takes effect.
|
||||
*/
|
||||
|
||||
asm volatile( "movw %%ds,%0 ; movw %0,%%ds\n\t"
|
||||
__asm__ volatile( "movw %%ds,%0 ; movw %0,%%ds\n\t"
|
||||
"movw %%es,%0 ; movw %0,%%es\n\t"
|
||||
"movw %%fs,%0 ; movw %0,%%fs\n\t"
|
||||
"movw %%gs,%0 ; movw %0,%%gs\n\t"
|
||||
|
||||
@@ -23,8 +23,8 @@ static int pcibInitialized = 0;
|
||||
static unsigned int pcibEntry;
|
||||
|
||||
/*
|
||||
* Array to pass data between c and asm parts, at the time of
|
||||
* writing I am not yet that familiar with extended asm feature
|
||||
* Array to pass data between c and __asm__ parts, at the time of
|
||||
* writing I am not yet that familiar with extended __asm__ feature
|
||||
* of gcc. This code is not on performance path, so we can care
|
||||
* relatively little about performance here
|
||||
*/
|
||||
@@ -80,17 +80,17 @@ pci_initialize(void)
|
||||
|
||||
pcibExchg[0] = *(unsigned int *)ucp;
|
||||
|
||||
asm (" pusha"); /* Push all registers */
|
||||
asm (" movl pcibExchg, %edi"); /* Move entry point to esi */
|
||||
asm (" movl $0x49435024, %eax"); /* Move signature to eax */
|
||||
asm (" xorl %ebx, %ebx"); /* Zero ebx */
|
||||
asm (" pushl %cs");
|
||||
asm (" call *%edi"); /* Call entry */
|
||||
asm (" movl %eax, pcibExchg");
|
||||
asm (" movl %ebx, pcibExchg+4");
|
||||
asm (" movl %ecx, pcibExchg+8");
|
||||
asm (" movl %edx, pcibExchg+12");
|
||||
asm (" popa");
|
||||
__asm__ (" pusha"); /* Push all registers */
|
||||
__asm__ (" movl pcibExchg, %edi"); /* Move entry point to esi */
|
||||
__asm__ (" movl $0x49435024, %eax"); /* Move signature to eax */
|
||||
__asm__ (" xorl %ebx, %ebx"); /* Zero ebx */
|
||||
__asm__ (" pushl %cs");
|
||||
__asm__ (" call *%edi"); /* Call entry */
|
||||
__asm__ (" movl %eax, pcibExchg");
|
||||
__asm__ (" movl %ebx, pcibExchg+4");
|
||||
__asm__ (" movl %ecx, pcibExchg+8");
|
||||
__asm__ (" movl %edx, pcibExchg+12");
|
||||
__asm__ (" popa");
|
||||
|
||||
if ((pcibExchg[0] & 0xff) != 0) {
|
||||
/* Not found */
|
||||
@@ -103,17 +103,17 @@ pci_initialize(void)
|
||||
/* Let us check whether PCI bios is present */
|
||||
pcibExchg[0] = pcibEntry;
|
||||
|
||||
asm(" pusha");
|
||||
asm(" movl pcibExchg, %edi");
|
||||
asm(" movb $0xb1, %ah");
|
||||
asm(" movb $0x01, %al");
|
||||
asm(" pushl %cs");
|
||||
asm(" call *%edi");
|
||||
asm(" movl %eax, pcibExchg");
|
||||
asm(" movl %ebx, pcibExchg+4");
|
||||
asm(" movl %ecx, pcibExchg+8");
|
||||
asm(" movl %edx, pcibExchg+12");
|
||||
asm(" popa");
|
||||
__asm__ (" pusha");
|
||||
__asm__ (" movl pcibExchg, %edi");
|
||||
__asm__ (" movb $0xb1, %ah");
|
||||
__asm__ (" movb $0x01, %al");
|
||||
__asm__ (" pushl %cs");
|
||||
__asm__ (" call *%edi");
|
||||
__asm__ (" movl %eax, pcibExchg");
|
||||
__asm__ (" movl %ebx, pcibExchg+4");
|
||||
__asm__ (" movl %ecx, pcibExchg+8");
|
||||
__asm__ (" movl %edx, pcibExchg+12");
|
||||
__asm__ (" popa");
|
||||
|
||||
if ((pcibExchg[0] & 0xff00) != 0) {
|
||||
/* Not found */
|
||||
@@ -147,18 +147,18 @@ pcib_find_by_devid(int vendorId, int devId, int idx, int *sig)
|
||||
pcibExchg[2] = devId;
|
||||
pcibExchg[3] = idx;
|
||||
|
||||
asm(" pusha");
|
||||
asm(" movl pcibExchg, %edi");
|
||||
asm(" movb $0xb1, %ah");
|
||||
asm(" movb $0x02, %al");
|
||||
asm(" movl pcibExchg+4, %edx");
|
||||
asm(" movl pcibExchg+8, %ecx");
|
||||
asm(" movl pcibExchg+12, %esi");
|
||||
asm(" pushl %cs");
|
||||
asm(" call *%edi");
|
||||
asm(" movl %eax, pcibExchg");
|
||||
asm(" movl %ebx, pcibExchg+4");
|
||||
asm(" popa");
|
||||
__asm__ (" pusha");
|
||||
__asm__ (" movl pcibExchg, %edi");
|
||||
__asm__ (" movb $0xb1, %ah");
|
||||
__asm__ (" movb $0x02, %al");
|
||||
__asm__ (" movl pcibExchg+4, %edx");
|
||||
__asm__ (" movl pcibExchg+8, %ecx");
|
||||
__asm__ (" movl pcibExchg+12, %esi");
|
||||
__asm__ (" pushl %cs");
|
||||
__asm__ (" call *%edi");
|
||||
__asm__ (" movl %eax, pcibExchg");
|
||||
__asm__ (" movl %ebx, pcibExchg+4");
|
||||
__asm__ (" popa");
|
||||
|
||||
*sig = pcibExchg[1] & 0xffff;
|
||||
|
||||
@@ -201,17 +201,17 @@ pcib_find_by_class(int classCode, int idx, int *sig)
|
||||
pcibExchg[1] = classCode;
|
||||
pcibExchg[2] = idx;
|
||||
|
||||
asm(" pusha");
|
||||
asm(" movl pcibExchg, %edi");
|
||||
asm(" movb $0xb1, %ah");
|
||||
asm(" movb $0x03, %al");
|
||||
asm(" movl pcibExchg+4, %ecx");
|
||||
asm(" movl pcibExchg+8, %esi");
|
||||
asm(" pushl %cs");
|
||||
asm(" call *%edi");
|
||||
asm(" movl %eax, pcibExchg");
|
||||
asm(" movl %ebx, pcibExchg+4");
|
||||
asm(" popa");
|
||||
__asm__ (" pusha");
|
||||
__asm__ (" movl pcibExchg, %edi");
|
||||
__asm__ (" movb $0xb1, %ah");
|
||||
__asm__ (" movb $0x03, %al");
|
||||
__asm__ (" movl pcibExchg+4, %ecx");
|
||||
__asm__ (" movl pcibExchg+8, %esi");
|
||||
__asm__ (" pushl %cs");
|
||||
__asm__ (" call *%edi");
|
||||
__asm__ (" movl %eax, pcibExchg");
|
||||
__asm__ (" movl %ebx, pcibExchg+4");
|
||||
__asm__ (" popa");
|
||||
|
||||
if ((pcibExchg[0] & 0xff00) != 0) {
|
||||
return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
|
||||
@@ -300,17 +300,17 @@ pcib_special_cycle(int busNo, int data)
|
||||
pcibExchg[1] = busNo << 8;
|
||||
pcibExchg[2] = data;
|
||||
|
||||
asm(" pusha");
|
||||
asm(" movl pcibExchg, %edi");
|
||||
asm(" movb $0xb1, %ah");
|
||||
asm(" movb $0x06, %al");
|
||||
asm(" movl pcibExchg+4, %ebx");
|
||||
asm(" movl pcibExchg+8, %edx");
|
||||
asm(" pushl %cs");
|
||||
asm(" call *%edi");
|
||||
asm(" movl %eax, pcibExchg");
|
||||
asm(" movl %ebx, pcibExchg+4");
|
||||
asm(" popa");
|
||||
__asm__ (" pusha");
|
||||
__asm__ (" movl pcibExchg, %edi");
|
||||
__asm__ (" movb $0xb1, %ah");
|
||||
__asm__ (" movb $0x06, %al");
|
||||
__asm__ (" movl pcibExchg+4, %ebx");
|
||||
__asm__ (" movl pcibExchg+8, %edx");
|
||||
__asm__ (" pushl %cs");
|
||||
__asm__ (" call *%edi");
|
||||
__asm__ (" movl %eax, pcibExchg");
|
||||
__asm__ (" movl %ebx, pcibExchg+4");
|
||||
__asm__ (" popa");
|
||||
|
||||
return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
|
||||
}
|
||||
@@ -330,17 +330,17 @@ pcib_conf_read8(int sig, int off, uint8_t *data)
|
||||
pcibExchg[1] = sig;
|
||||
pcibExchg[2] = off;
|
||||
|
||||
asm(" pusha");
|
||||
asm(" movl pcibExchg, %esi");
|
||||
asm(" movb $0xb1, %ah");
|
||||
asm(" movb $0x08, %al");
|
||||
asm(" movl pcibExchg+4, %ebx");
|
||||
asm(" movl pcibExchg+8, %edi");
|
||||
asm(" pushl %cs");
|
||||
asm(" call *%esi");
|
||||
asm(" movl %eax, pcibExchg");
|
||||
asm(" movl %ecx, pcibExchg+4");
|
||||
asm(" popa");
|
||||
__asm__ (" pusha");
|
||||
__asm__ (" movl pcibExchg, %esi");
|
||||
__asm__ (" movb $0xb1, %ah");
|
||||
__asm__ (" movb $0x08, %al");
|
||||
__asm__ (" movl pcibExchg+4, %ebx");
|
||||
__asm__ (" movl pcibExchg+8, %edi");
|
||||
__asm__ (" pushl %cs");
|
||||
__asm__ (" call *%esi");
|
||||
__asm__ (" movl %eax, pcibExchg");
|
||||
__asm__ (" movl %ecx, pcibExchg+4");
|
||||
__asm__ (" popa");
|
||||
|
||||
if ((pcibExchg[0] & 0xff00) != 0) {
|
||||
return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
|
||||
@@ -366,17 +366,17 @@ pcib_conf_read16(int sig, int off, uint16_t *data)
|
||||
pcibExchg[1] = sig;
|
||||
pcibExchg[2] = off;
|
||||
|
||||
asm(" pusha");
|
||||
asm(" movl pcibExchg, %esi");
|
||||
asm(" movb $0xb1, %ah");
|
||||
asm(" movb $0x09, %al");
|
||||
asm(" movl pcibExchg+4, %ebx");
|
||||
asm(" movl pcibExchg+8, %edi");
|
||||
asm(" pushl %cs");
|
||||
asm(" call *%esi");
|
||||
asm(" movl %eax, pcibExchg");
|
||||
asm(" movl %ecx, pcibExchg+4");
|
||||
asm(" popa");
|
||||
__asm__ (" pusha");
|
||||
__asm__ (" movl pcibExchg, %esi");
|
||||
__asm__ (" movb $0xb1, %ah");
|
||||
__asm__ (" movb $0x09, %al");
|
||||
__asm__ (" movl pcibExchg+4, %ebx");
|
||||
__asm__ (" movl pcibExchg+8, %edi");
|
||||
__asm__ (" pushl %cs");
|
||||
__asm__ (" call *%esi");
|
||||
__asm__ (" movl %eax, pcibExchg");
|
||||
__asm__ (" movl %ecx, pcibExchg+4");
|
||||
__asm__ (" popa");
|
||||
|
||||
if ((pcibExchg[0] & 0xff00) != 0) {
|
||||
return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
|
||||
@@ -402,17 +402,17 @@ pcib_conf_read32(int sig, int off, uint32_t *data)
|
||||
pcibExchg[1] = sig;
|
||||
pcibExchg[2] = off;
|
||||
|
||||
asm(" pusha");
|
||||
asm(" movl pcibExchg, %esi");
|
||||
asm(" movb $0xb1, %ah");
|
||||
asm(" movb $0x0a, %al");
|
||||
asm(" movl pcibExchg+4, %ebx");
|
||||
asm(" movl pcibExchg+8, %edi");
|
||||
asm(" pushl %cs");
|
||||
asm(" call *%esi");
|
||||
asm(" movl %eax, pcibExchg");
|
||||
asm(" movl %ecx, pcibExchg+4");
|
||||
asm(" popa");
|
||||
__asm__ (" pusha");
|
||||
__asm__ (" movl pcibExchg, %esi");
|
||||
__asm__ (" movb $0xb1, %ah");
|
||||
__asm__ (" movb $0x0a, %al");
|
||||
__asm__ (" movl pcibExchg+4, %ebx");
|
||||
__asm__ (" movl pcibExchg+8, %edi");
|
||||
__asm__ (" pushl %cs");
|
||||
__asm__ (" call *%esi");
|
||||
__asm__ (" movl %eax, pcibExchg");
|
||||
__asm__ (" movl %ecx, pcibExchg+4");
|
||||
__asm__ (" popa");
|
||||
|
||||
if ((pcibExchg[0] & 0xff00) != 0) {
|
||||
return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
|
||||
@@ -439,17 +439,17 @@ pcib_conf_write8(int sig, int off, uint8_t data)
|
||||
pcibExchg[2] = off;
|
||||
pcibExchg[3] = data & 0xff;
|
||||
|
||||
asm(" pusha");
|
||||
asm(" movl pcibExchg, %esi");
|
||||
asm(" movb $0xb1, %ah");
|
||||
asm(" movb $0x0b, %al");
|
||||
asm(" movl pcibExchg+4, %ebx");
|
||||
asm(" movl pcibExchg+8, %edi");
|
||||
asm(" movl pcibExchg+12, %ecx");
|
||||
asm(" pushl %cs");
|
||||
asm(" call *%esi");
|
||||
asm(" movl %eax, pcibExchg");
|
||||
asm(" popa");
|
||||
__asm__ (" pusha");
|
||||
__asm__ (" movl pcibExchg, %esi");
|
||||
__asm__ (" movb $0xb1, %ah");
|
||||
__asm__ (" movb $0x0b, %al");
|
||||
__asm__ (" movl pcibExchg+4, %ebx");
|
||||
__asm__ (" movl pcibExchg+8, %edi");
|
||||
__asm__ (" movl pcibExchg+12, %ecx");
|
||||
__asm__ (" pushl %cs");
|
||||
__asm__ (" call *%esi");
|
||||
__asm__ (" movl %eax, pcibExchg");
|
||||
__asm__ (" popa");
|
||||
|
||||
return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
|
||||
}
|
||||
@@ -469,17 +469,17 @@ pcib_conf_write16(int sig, int off, uint16_t data)
|
||||
pcibExchg[2] = off;
|
||||
pcibExchg[3] = data & 0xffff;
|
||||
|
||||
asm(" pusha");
|
||||
asm(" movl pcibExchg, %esi");
|
||||
asm(" movb $0xb1, %ah");
|
||||
asm(" movb $0x0c, %al");
|
||||
asm(" movl pcibExchg+4, %ebx");
|
||||
asm(" movl pcibExchg+8, %edi");
|
||||
asm(" movl pcibExchg+12, %ecx");
|
||||
asm(" pushl %cs");
|
||||
asm(" call *%esi");
|
||||
asm(" movl %eax, pcibExchg");
|
||||
asm(" popa");
|
||||
__asm__ (" pusha");
|
||||
__asm__ (" movl pcibExchg, %esi");
|
||||
__asm__ (" movb $0xb1, %ah");
|
||||
__asm__ (" movb $0x0c, %al");
|
||||
__asm__ (" movl pcibExchg+4, %ebx");
|
||||
__asm__ (" movl pcibExchg+8, %edi");
|
||||
__asm__ (" movl pcibExchg+12, %ecx");
|
||||
__asm__ (" pushl %cs");
|
||||
__asm__ (" call *%esi");
|
||||
__asm__ (" movl %eax, pcibExchg");
|
||||
__asm__ (" popa");
|
||||
|
||||
return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
|
||||
}
|
||||
@@ -501,17 +501,17 @@ pcib_conf_write32(int sig, int off, uint32_t data)
|
||||
pcibExchg[2] = off;
|
||||
pcibExchg[3] = data;
|
||||
|
||||
asm(" pusha");
|
||||
asm(" movl pcibExchg, %esi");
|
||||
asm(" movb $0xb1, %ah");
|
||||
asm(" movb $0x0d, %al");
|
||||
asm(" movl pcibExchg+4, %ebx");
|
||||
asm(" movl pcibExchg+8, %edi");
|
||||
asm(" movl pcibExchg+12, %ecx");
|
||||
asm(" pushl %cs");
|
||||
asm(" call *%esi");
|
||||
asm(" movl %eax, pcibExchg");
|
||||
asm(" popa");
|
||||
__asm__ (" pusha");
|
||||
__asm__ (" movl pcibExchg, %esi");
|
||||
__asm__ (" movb $0xb1, %ah");
|
||||
__asm__ (" movb $0x0d, %al");
|
||||
__asm__ (" movl pcibExchg+4, %ebx");
|
||||
__asm__ (" movl pcibExchg+8, %edi");
|
||||
__asm__ (" movl pcibExchg+12, %ecx");
|
||||
__asm__ (" pushl %cs");
|
||||
__asm__ (" call *%esi");
|
||||
__asm__ (" movl %eax, pcibExchg");
|
||||
__asm__ (" popa");
|
||||
|
||||
return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user