Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/include/sf_buf.h
Show All 20 Lines | |||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifdef __arm__ | |||||
#include <arm/sf_buf.h> | |||||
#else /* !__arm__ */ | |||||
#ifndef _MACHINE_SF_BUF_H_ | #ifndef _MACHINE_SF_BUF_H_ | ||||
#define _MACHINE_SF_BUF_H_ | #define _MACHINE_SF_BUF_H_ | ||||
/* | /* | ||||
* On this machine, the only purpose for which sf_buf is used is to implement | * On this machine, the only purpose for which sf_buf is used is to implement | ||||
* an opaque pointer required by the machine-independent parts of the kernel. | * an opaque pointer required by the machine-independent parts of the kernel. | ||||
* That pointer references the vm_page that is "mapped" by the sf_buf. The | * That pointer references the vm_page that is "mapped" by the sf_buf. The | ||||
* actual mapping is provided by the direct virtual-to-physical mapping. | * actual mapping is provided by the direct virtual-to-physical mapping. | ||||
*/ | */ | ||||
static inline vm_offset_t | static inline vm_offset_t | ||||
sf_buf_kva(struct sf_buf *sf) | sf_buf_kva(struct sf_buf *sf) | ||||
{ | { | ||||
return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf))); | return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf))); | ||||
} | } | ||||
static inline vm_page_t | static inline vm_page_t | ||||
sf_buf_page(struct sf_buf *sf) | sf_buf_page(struct sf_buf *sf) | ||||
{ | { | ||||
return ((vm_page_t)sf); | return ((vm_page_t)sf); | ||||
} | } | ||||
#endif /* !_MACHINE_SF_BUF_H_ */ | #endif /* !_MACHINE_SF_BUF_H_ */ | ||||
#endif /* !__arm__ */ |