summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2013-01-05 02:10:27 +0000
committerneel <neel@FreeBSD.org>2013-01-05 02:10:27 +0000
commit4292076e50a8bfa310514de3291d332ef4d445f4 (patch)
tree11230a9f0ac73595e6102261362b7dd5f270897b
parent38ad3ee53626ccab6f22009b0723f2fb7903ecc1 (diff)
downloadFreeBSD-src-4292076e50a8bfa310514de3291d332ef4d445f4.zip
FreeBSD-src-4292076e50a8bfa310514de3291d332ef4d445f4.tar.gz
Get rid of workarounds to avoid ins/outs instructions emitted by the guest.
They can be emulated if needed in the future. Obtained from: NetApp
-rw-r--r--sys/x86/include/bus.h60
1 files changed, 18 insertions, 42 deletions
diff --git a/sys/x86/include/bus.h b/sys/x86/include/bus.h
index 4efc172..52c4251 100644
--- a/sys/x86/include/bus.h
+++ b/sys/x86/include/bus.h
@@ -294,13 +294,9 @@ bus_space_read_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, u_int8_t *addr, size_t count)
{
- if (tag == X86_BUS_SPACE_IO) {
- while (count > 0) {
- *addr = inb(bsh + offset);
- count--;
- addr++;
- }
- } else {
+ if (tag == X86_BUS_SPACE_IO)
+ insb(bsh + offset, addr, count);
+ else {
#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
@@ -319,13 +315,9 @@ bus_space_read_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, u_int16_t *addr, size_t count)
{
- if (tag == X86_BUS_SPACE_IO) {
- while (count > 0) {
- *addr = inw(bsh + offset);
- count--;
- addr++;
- }
- } else {
+ if (tag == X86_BUS_SPACE_IO)
+ insw(bsh + offset, addr, count);
+ else {
#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
@@ -344,13 +336,9 @@ bus_space_read_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, u_int32_t *addr, size_t count)
{
- if (tag == X86_BUS_SPACE_IO) {
- while (count > 0) {
- *addr = inl(bsh + offset);
- count--;
- addr++;
- }
- } else {
+ if (tag == X86_BUS_SPACE_IO)
+ insl(bsh + offset, addr, count);
+ else {
#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
@@ -585,13 +573,9 @@ bus_space_write_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, const u_int8_t *addr, size_t count)
{
- if (tag == X86_BUS_SPACE_IO) {
- while (count > 0) {
- outb(bsh + offset, *addr);
- addr++;
- count--;
- }
- } else {
+ if (tag == X86_BUS_SPACE_IO)
+ outsb(bsh + offset, addr, count);
+ else {
#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
@@ -610,13 +594,9 @@ bus_space_write_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, const u_int16_t *addr, size_t count)
{
- if (tag == X86_BUS_SPACE_IO) {
- while (count > 0) {
- outw(bsh + offset, *addr);
- addr++;
- count--;
- }
- } else {
+ if (tag == X86_BUS_SPACE_IO)
+ outsw(bsh + offset, addr, count);
+ else {
#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
@@ -635,13 +615,9 @@ bus_space_write_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh,
bus_size_t offset, const u_int32_t *addr, size_t count)
{
- if (tag == X86_BUS_SPACE_IO) {
- while (count > 0) {
- outl(bsh + offset, *addr);
- addr++;
- count--;
- }
- } else {
+ if (tag == X86_BUS_SPACE_IO)
+ outsl(bsh + offset, addr, count);
+ else {
#ifdef __GNUCLIKE_ASM
__asm __volatile(" \n\
cld \n\
OpenPOWER on IntegriCloud