Date: Thu, 11 Jan 2007 18:01:42 GMT From: Marko Zec <zec@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 112778 for review Message-ID: <200701111801.l0BI1gYZ025791@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=112778 Change 112778 by zec@zec_tca51 on 2007/01/11 18:00:56 Introduce a macro for resolving pointers to virtualized symbols. Introduce the SYSCTL_V_PROC macro, to be used for accessing virtualized symbols in handler functions. Affected files ... .. //depot/projects/vimage/src/sys/sys/sysctl.h#3 edit Differences ... ==== //depot/projects/vimage/src/sys/sys/sysctl.h#3 (text+ko) ==== @@ -373,10 +373,36 @@ SYSCTL_OID(parent, nbr, name, (access), \ ptr, arg, handler, fmt, descr) +#ifdef VIMAGE +#define SYSCTL_V_PROC(subs, mod, parent, nbr, name, access, sym, arg, \ + handler, fmt, descr) \ + SYSCTL_V_OID(subs, mod, parent, nbr, name, (access), \ + sym, arg, handler, fmt, descr) +#else +#define SYSCTL_V_PROC(subs, mod, parent, nbr, name, access, sym, arg, \ + handler, fmt, descr) \ + SYSCTL_OID(parent, nbr, name, (access), \ + &sym, arg, handler, fmt, descr) +#endif + #define SYSCTL_ADD_PROC(ctx, parent, nbr, name, access, ptr, arg, handler, fmt, descr) \ sysctl_add_oid(ctx, parent, nbr, name, (access), \ ptr, arg, handler, fmt, __DESCR(descr)) +#ifdef VIMAGE +#define SYSCTL_RESOLVE_V_ARG1() do { \ + void *ptr; \ + switch (subs) { \ + case V_NET: \ + ptr = curthread->td_vimage->v_vnetb->mod_data[mod]; \ + arg1 = (void *) ((int) ptr + (int) arg1); \ + break; \ + default: \ + panic("unsupported module id %d", subs); \ + } \ +} while (0) +#endif + #endif /* _KERNEL */ /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701111801.l0BI1gYZ025791>