Add arch-specific macro SFBUF_PHYS_DMAP(), which should translate the

physical address of the page to direct map address, in case
SFBUF_OPTIONAL_DIRECT_MAP returns true.  The case of PowerPC AIM
64bit, where the page physical address is identical to the direct map
address, is accidental.

Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Konstantin Belousov 2014-08-20 08:02:38 +00:00
parent 0ee7262a72
commit 14fb217784
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=270201
2 changed files with 2 additions and 1 deletions

View File

@ -210,5 +210,6 @@ struct pmap_physseg {
#define SFBUF
#define SFBUF_NOMD
#define SFBUF_OPTIONAL_DIRECT_MAP hw_direct_map
#define SFBUF_PHYS_DMAP(x) (x)
#endif /* _MACHINE_VMPARAM_H_ */

View File

@ -113,7 +113,7 @@ sf_buf_kva(struct sf_buf *sf)
{
#ifdef SFBUF_OPTIONAL_DIRECT_MAP
if (SFBUF_OPTIONAL_DIRECT_MAP)
return (VM_PAGE_TO_PHYS((vm_page_t)sf));
return (SFBUF_PHYS_DMAP(VM_PAGE_TO_PHYS((vm_page_t)sf)));
#endif
return (sf->kva);