--- old/usr/src/uts/common/vm/seg.h	2015-11-24 09:34:41.990679969 -0500
+++ new/usr/src/uts/common/vm/seg.h	2015-11-24 09:34:41.994440481 -0500
@@ -210,36 +210,6 @@
 #define	SEG_PAGE_ANON		0x20	/* VA has an anonymous page */
 #define	SEG_PAGE_VNODE		0x40	/* VA has a vnode page backing it */
 
-#define	SEGOP_DUP(s, n)		    (*(s)->s_ops->dup)((s), (n))
-#define	SEGOP_UNMAP(s, a, l)	    (*(s)->s_ops->unmap)((s), (a), (l))
-#define	SEGOP_FREE(s)		    (*(s)->s_ops->free)((s))
-#define	SEGOP_FAULT(h, s, a, l, t, rw) \
-		(*(s)->s_ops->fault)((h), (s), (a), (l), (t), (rw))
-#define	SEGOP_FAULTA(s, a)	    (*(s)->s_ops->faulta)((s), (a))
-#define	SEGOP_SETPROT(s, a, l, p)   (*(s)->s_ops->setprot)((s), (a), (l), (p))
-#define	SEGOP_CHECKPROT(s, a, l, p) (*(s)->s_ops->checkprot)((s), (a), (l), (p))
-#define	SEGOP_KLUSTER(s, a, d)	    (*(s)->s_ops->kluster)((s), (a), (d))
-#define	SEGOP_SWAPOUT(s)	    (*(s)->s_ops->swapout)((s))
-#define	SEGOP_SYNC(s, a, l, atr, f) \
-		(*(s)->s_ops->sync)((s), (a), (l), (atr), (f))
-#define	SEGOP_INCORE(s, a, l, v)    (*(s)->s_ops->incore)((s), (a), (l), (v))
-#define	SEGOP_LOCKOP(s, a, l, atr, op, b, p) \
-		(*(s)->s_ops->lockop)((s), (a), (l), (atr), (op), (b), (p))
-#define	SEGOP_GETPROT(s, a, l, p)   (*(s)->s_ops->getprot)((s), (a), (l), (p))
-#define	SEGOP_GETOFFSET(s, a)	    (*(s)->s_ops->getoffset)((s), (a))
-#define	SEGOP_GETTYPE(s, a)	    (*(s)->s_ops->gettype)((s), (a))
-#define	SEGOP_GETVP(s, a, vpp)	    (*(s)->s_ops->getvp)((s), (a), (vpp))
-#define	SEGOP_ADVISE(s, a, l, b)    (*(s)->s_ops->advise)((s), (a), (l), (b))
-#define	SEGOP_DUMP(s)		    (*(s)->s_ops->dump)((s))
-#define	SEGOP_PAGELOCK(s, a, l, p, t, rw) \
-		(*(s)->s_ops->pagelock)((s), (a), (l), (p), (t), (rw))
-#define	SEGOP_SETPAGESIZE(s, a, l, szc) \
-		(*(s)->s_ops->setpagesize)((s), (a), (l), (szc))
-#define	SEGOP_GETMEMID(s, a, mp)    (*(s)->s_ops->getmemid)((s), (a), (mp))
-#define	SEGOP_GETPOLICY(s, a)	    (*(s)->s_ops->getpolicy)((s), (a))
-#define	SEGOP_CAPABLE(s, c)	    (*(s)->s_ops->capable)((s), (c))
-#define	SEGOP_INHERIT(s, a, l, b)   (*(s)->s_ops->inherit)((s), (a), (l), (b))
-
 #define	seg_page(seg, addr) \
 	(((uintptr_t)((addr) - (seg)->s_base)) >> PAGESHIFT)
 
@@ -278,6 +248,35 @@
 boolean_t	seg_can_change_zones(struct seg *);
 size_t		seg_swresv(struct seg *);
 
+/* segop wrappers */
+extern int segop_dup(struct seg *, struct seg *);
+extern int segop_unmap(struct seg *, caddr_t, size_t);
+extern void segop_free(struct seg *);
+extern faultcode_t segop_fault(struct hat *, struct seg *, caddr_t, size_t,
+    enum fault_type, enum seg_rw);
+extern faultcode_t segop_faulta(struct seg *, caddr_t);
+extern int segop_setprot(struct seg *, caddr_t, size_t, uint_t);
+extern int segop_checkprot(struct seg *, caddr_t, size_t, uint_t);
+extern int segop_kluster(struct seg *, caddr_t, ssize_t);
+extern size_t segop_swapout(struct seg *);
+extern int segop_sync(struct seg *, caddr_t, size_t, int, uint_t);
+extern size_t segop_incore(struct seg *, caddr_t, size_t, char *);
+extern int segop_lockop(struct seg *, caddr_t, size_t, int, int, ulong_t *,
+    size_t);
+extern int segop_getprot(struct seg *, caddr_t, size_t, uint_t *);
+extern u_offset_t segop_getoffset(struct seg *, caddr_t);
+extern int segop_gettype(struct seg *, caddr_t);
+extern int segop_getvp(struct seg *, caddr_t, struct vnode **);
+extern int segop_advise(struct seg *, caddr_t, size_t, uint_t);
+extern void segop_dump(struct seg *);
+extern int segop_pagelock(struct seg *, caddr_t, size_t, struct page ***,
+    enum lock_type, enum seg_rw);
+extern int segop_setpagesize(struct seg *, caddr_t, size_t, uint_t);
+extern int segop_getmemid(struct seg *, caddr_t, memid_t *);
+extern struct lgrp_mem_policy_info *segop_getpolicy(struct seg *, caddr_t);
+extern int segop_capable(struct seg *, segcapability_t);
+extern int segop_inherit(struct seg *, caddr_t, size_t, uint_t);
+
 #endif	/* _KERNEL */
 
 #ifdef	__cplusplus
--- old/usr/src/uts/common/vm/vm_seg.c	2015-11-24 09:34:42.109654043 -0500
+++ new/usr/src/uts/common/vm/vm_seg.c	2015-11-24 09:34:42.113543809 -0500
@@ -22,6 +22,7 @@
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  * Copyright (c) 2015, Joyent, Inc.
+ * Copyright 2015, Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  */
 
 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
@@ -1862,3 +1863,159 @@
 {
 	return (ENOTSUP);
 }
+
+/*
+ * segop wrappers
+ */
+int
+segop_dup(struct seg *seg, struct seg *new)
+{
+	return (seg->s_ops->dup(seg, new));
+}
+
+int
+segop_unmap(struct seg *seg, caddr_t addr, size_t len)
+{
+	return (seg->s_ops->unmap(seg, addr, len));
+}
+
+void
+segop_free(struct seg *seg)
+{
+	seg->s_ops->free(seg);
+}
+
+faultcode_t
+segop_fault(struct hat *hat, struct seg *seg, caddr_t addr, size_t len,
+    enum fault_type type, enum seg_rw rw)
+{
+	return (seg->s_ops->fault(hat, seg, addr, len, type, rw));
+}
+
+faultcode_t
+segop_faulta(struct seg *seg, caddr_t addr)
+{
+	return (seg->s_ops->faulta(seg, addr));
+}
+
+int
+segop_setprot(struct seg *seg, caddr_t addr, size_t len, uint_t prot)
+{
+	return (seg->s_ops->setprot(seg, addr, len, prot));
+}
+
+int
+segop_checkprot(struct seg *seg, caddr_t addr, size_t len, uint_t prot)
+{
+	return (seg->s_ops->checkprot(seg, addr, len, prot));
+}
+
+int
+segop_kluster(struct seg *seg, caddr_t addr, ssize_t d)
+{
+	return (seg->s_ops->kluster(seg, addr, d));
+}
+
+size_t
+segop_swapout(struct seg *seg)
+{
+	return (seg->s_ops->swapout(seg));
+}
+
+int
+segop_sync(struct seg *seg, caddr_t addr, size_t len, int atr, uint_t f)
+{
+	return (seg->s_ops->sync(seg, addr, len, atr, f));
+}
+
+size_t
+segop_incore(struct seg *seg, caddr_t addr, size_t len, char *v)
+{
+	return (seg->s_ops->incore(seg, addr, len, v));
+}
+
+int
+segop_lockop(struct seg *seg, caddr_t addr, size_t len, int atr, int op,
+    ulong_t *b, size_t p)
+{
+	return (seg->s_ops->lockop(seg, addr, len, atr, op, b, p));
+}
+
+int
+segop_getprot(struct seg *seg, caddr_t addr, size_t len, uint_t *p)
+{
+	return (seg->s_ops->getprot(seg, addr, len, p));
+}
+
+u_offset_t
+segop_getoffset(struct seg *seg, caddr_t addr)
+{
+	return (seg->s_ops->getoffset(seg, addr));
+}
+
+int
+segop_gettype(struct seg *seg, caddr_t addr)
+{
+	return (seg->s_ops->gettype(seg, addr));
+}
+
+int
+segop_getvp(struct seg *seg, caddr_t addr, struct vnode **vpp)
+{
+	return (seg->s_ops->getvp(seg, addr, vpp));
+}
+
+int
+segop_advise(struct seg *seg, caddr_t addr, size_t len, uint_t b)
+{
+	return (seg->s_ops->advise(seg, addr, len, b));
+}
+
+void
+segop_dump(struct seg *seg)
+{
+	seg->s_ops->dump(seg);
+}
+
+int
+segop_pagelock(struct seg *seg, caddr_t addr, size_t len, struct page ***page,
+    enum lock_type type, enum seg_rw rw)
+{
+	return (seg->s_ops->pagelock(seg, addr, len, page, type, rw));
+}
+
+int
+segop_setpagesize(struct seg *seg, caddr_t addr, size_t len, uint_t szc)
+{
+	return (seg->s_ops->setpagesize(seg, addr, len, szc));
+}
+
+int
+segop_getmemid(struct seg *seg, caddr_t addr, memid_t *mp)
+{
+	return (seg->s_ops->getmemid(seg, addr, mp));
+}
+
+struct lgrp_mem_policy_info *
+segop_getpolicy(struct seg *seg, caddr_t addr)
+{
+	if (seg->s_ops->getpolicy == NULL)
+		return (NULL);
+
+	return (seg->s_ops->getpolicy(seg, addr));
+}
+
+int
+segop_capable(struct seg *seg, segcapability_t cap)
+{
+	return (seg->s_ops->capable(seg, cap));
+}
+
+int
+segop_inherit(struct seg *seg, caddr_t addr, size_t len, uint_t op)
+{
+	if (seg->s_ops->inherit == NULL)
+		return (ENOTSUP);
+
+	return (seg->s_ops->inherit(seg, addr, len, op));
+}
