Print this page
no need for bad-op segment op functions
The segment drivers have a number of bad-op functions that simply panic.
Keeping the function pointer NULL will accomplish the same thing in most
cases.  In other cases, keeping the function pointer NULL will result in
proper error code being returned.

*** 74,115 **** static int segspt_unmap(struct seg *seg, caddr_t raddr, size_t ssize); static void segspt_free(struct seg *seg); static void segspt_free_pages(struct seg *seg, caddr_t addr, size_t len); static lgrp_mem_policy_info_t *segspt_getpolicy(struct seg *seg, caddr_t addr); - static void - segspt_badop() - { - panic("segspt_badop called"); - /*NOTREACHED*/ - } - - #define SEGSPT_BADOP(t) (t(*)())segspt_badop - struct seg_ops segspt_ops = { - .dup = SEGSPT_BADOP(int), .unmap = segspt_unmap, .free = segspt_free, - .fault = SEGSPT_BADOP(int), - .faulta = SEGSPT_BADOP(faultcode_t), - .setprot = SEGSPT_BADOP(int), - .checkprot = SEGSPT_BADOP(int), - .kluster = SEGSPT_BADOP(int), - .sync = SEGSPT_BADOP(int), - .incore = SEGSPT_BADOP(size_t), - .lockop = SEGSPT_BADOP(int), - .getprot = SEGSPT_BADOP(int), - .getoffset = SEGSPT_BADOP(u_offset_t), - .gettype = SEGSPT_BADOP(int), - .getvp = SEGSPT_BADOP(int), - .advise = SEGSPT_BADOP(int), - .dump = SEGSPT_BADOP(void), - .pagelock = SEGSPT_BADOP(int), - .setpagesize = SEGSPT_BADOP(int), - .getmemid = SEGSPT_BADOP(int), .getpolicy = segspt_getpolicy, - .capable = SEGSPT_BADOP(int), .inherit = seg_inherit_notsup, }; static int segspt_shmdup(struct seg *seg, struct seg *newseg); static int segspt_shmunmap(struct seg *seg, caddr_t raddr, size_t ssize); --- 74,87 ----