Date: Mon, 3 Oct 2016 14:00:14 -0600 From: alan somers <asomers@gmail.com> To: Konstantin Belousov <kostikbel@gmail.com> Cc: Alan Somers <asomers@freebsd.org>, "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org> Subject: Re: Proper way to add vendor-specific syscalls? Message-ID: <CAOtMX2hCMJSUDrNw8t5rVkeH_Hs5J-Q_10vA5eYXkmGYGZYYhA@mail.gmail.com> In-Reply-To: <20161003181803.GS38409@kib.kiev.ua> References: <CAOtMX2gi0rvC85qcUb2UZRbVGB%2BS%2BeXuAzzxn50GmUV4QKKghg@mail.gmail.com> <20161003181803.GS38409@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Oct 3, 2016 at 12:18 PM, Konstantin Belousov <kostikbel@gmail.com> wrote: > On Mon, Oct 03, 2016 at 11:48:39AM -0600, Alan Somers wrote: >> What's the proper way to add a vendor-specific syscall? The comments >> in kern/syscalls.master suggest that they should be put in the range >> from 151-180, but most of that range is actually occupied. > I think that the 'vendors' there means vendors of other BSD-derived > systems and not e.g. an appliance vendors. > >> Only five >> nosys slots are available. If I add syscalls to the end of the list, >> they'll likely collide with future standard syscalls. Should I just >> added ~100 nosys syscalls to the end of the list, and put my custom >> syscalls afterwards? Is there any penalty to lengthening the list? > > Each nosys syscall increases the size of the default ABI syscalls table. > On amd64 sizeof(struct sysent) == 48, adding 100 nosys entries would > waste a page and some more. > > How many syscalls do you need ? You probably do not allow random modules > loaded and implementing syscalls, so could you use e.g. range 210-219 ? > > If you look further, you will see lot of holes like 258-271, 281-288 > etc. Current practice is to allocate new syscalls at the end of the > table, which leaves there holes unused with high chance of never being > collected. Ok, it sounds like filling holes is the best method. Thanks for the advice, kib. -Alan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2hCMJSUDrNw8t5rVkeH_Hs5J-Q_10vA5eYXkmGYGZYYhA>