FreeBSD compat layer: fixed bus_space_barrier for x86_64

This commit is contained in:
Jérôme Duval
2013-11-06 13:47:27 +01:00
parent 24394a9d11
commit 4089e1c1ca
@@ -14,7 +14,7 @@
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
* *
* 1. Redistributions of source code must retain the above copyright * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer as * notice, this list of conditions and the following disclaimer as
* the first lines of this file unmodified. * the first lines of this file unmodified.
@@ -23,7 +23,7 @@
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products * 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@@ -231,7 +231,11 @@ bus_space_barrier(bus_space_tag_t tag, bus_space_handle_t handle,
bus_size_t offset, bus_size_t len, int flags) bus_size_t offset, bus_size_t len, int flags)
{ {
if (flags & BUS_SPACE_BARRIER_READ) if (flags & BUS_SPACE_BARRIER_READ)
#ifdef __x86_64__
__asm__ __volatile__ ("lock; addl $0,0(%%rsp)" : : : "memory");
#else
__asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory"); __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory");
#endif
else else
__asm__ __volatile__ ("" : : : "memory"); __asm__ __volatile__ ("" : : : "memory");
} }