Date: Fri, 30 Mar 2018 10:55:31 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331760 - head/sys/vm Message-ID: <201803301055.w2UAtVtK044657@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Fri Mar 30 10:55:31 2018 New Revision: 331760 URL: https://svnweb.freebsd.org/changeset/base/331760 Log: Make vm_map_max/min/pmap KBI stable. There are out of tree consumers of vm_map_min() and vm_map_max(), and I believe there are consumers of vm_map_pmap(), although the later is arguably less in the need of KBI-stable interface. For the consumers benefit, make modules using this KPI not depended on the struct vm_map layout. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14902 Modified: head/sys/vm/vm_map.c head/sys/vm/vm_map.h Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Mar 30 10:36:54 2018 (r331759) +++ head/sys/vm/vm_map.c Fri Mar 30 10:55:31 2018 (r331760) @@ -4315,6 +4315,27 @@ vm_map_lookup_done(vm_map_t map, vm_map_entry_t entry) vm_map_unlock_read(map); } +vm_offset_t +vm_map_max_KBI(const struct vm_map *map) +{ + + return (map->max_offset); +} + +vm_offset_t +vm_map_min_KBI(const struct vm_map *map) +{ + + return (map->min_offset); +} + +pmap_t +vm_map_pmap_KBI(vm_map_t map) +{ + + return (map->pmap); +} + #include "opt_ddb.h" #ifdef DDB #include <sys/kernel.h> Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Fri Mar 30 10:36:54 2018 (r331759) +++ head/sys/vm/vm_map.h Fri Mar 30 10:55:31 2018 (r331760) @@ -206,6 +206,11 @@ struct vm_map { #define MAP_BUSY_WAKEUP 0x02 #ifdef _KERNEL +#ifdef KLD_MODULE +#define vm_map_max(map) vm_map_max_KBI((map)) +#define vm_map_min(map) vm_map_min_KBI((map)) +#define vm_map_pmap(map) vm_map_pmap_KBI((map)) +#else static __inline vm_offset_t vm_map_max(const struct vm_map *map) { @@ -229,6 +234,7 @@ vm_map_modflags(vm_map_t map, vm_flags_t set, vm_flags { map->flags = (map->flags | set) & ~clear; } +#endif /* KLD_MODULE */ #endif /* _KERNEL */ /* @@ -289,6 +295,9 @@ void vm_map_wakeup(vm_map_t map); void vm_map_busy(vm_map_t map); void vm_map_unbusy(vm_map_t map); void vm_map_wait_busy(vm_map_t map); +vm_offset_t vm_map_max_KBI(const struct vm_map *map); +vm_offset_t vm_map_min_KBI(const struct vm_map *map); +pmap_t vm_map_pmap_KBI(vm_map_t map); #define vm_map_lock(map) _vm_map_lock(map, LOCK_FILE, LOCK_LINE) #define vm_map_unlock(map) _vm_map_unlock(map, LOCK_FILE, LOCK_LINE)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803301055.w2UAtVtK044657>