From owner-freebsd-hackers Sun Dec 29 15:46:42 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id PAA18112 for hackers-outgoing; Sun, 29 Dec 1996 15:46:42 -0800 (PST) Received: from sierra.zyzzyva.com (ppp0.zyzzyva.com [198.183.2.50]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id PAA18094 for ; Sun, 29 Dec 1996 15:46:30 -0800 (PST) Received: from sierra.zyzzyva.com (LOCALHOST [127.0.0.1]) by sierra.zyzzyva.com (8.8.4/8.8.2) with ESMTP id RAA23734 for ; Sun, 29 Dec 1996 17:48:28 -0600 (CST) Message-Id: <199612292348.RAA23734@sierra.zyzzyva.com> To: hackers@freebsd.org Subject: LKM and MOD_DEV changes in 2.2 X-uri: http://www.zyzzyva.com/ Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 29 Dec 1996 17:48:27 -0600 From: Randy Terbush Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I'm taking a stab at porting Darren Reed's ipfilter to 2.2 and have run into a snag with some changed macros in the LKM stuff. Could someone a bit more familiar with LKM explain the differences? ------------------------------------------------------------------------ >From 2.1.6.1: /usr/include/sys/lkm.h #define MOD_DEV(name,devtype,devslot,devp) \ static struct lkm_dev _module = { \ LM_DEV, \ LKM_VERSION, \ name, \ devslot, \ devtype, \ (void *)devp \ }; ------------------------------------------------------------------------ >From 2.2: #define MOD_DEV(name,devtype,devslot,devp) \ MOD_DECL(name); \ static struct lkm_dev name ## _module = { \ LM_DEV, \ LKM_VERSION, \ #name ## "_mod", \ devslot, \ devtype, \ (void *)devp \ } #define MOD_DECL(name) \ static int name ## _load __P((struct lkm_table *lkmtp, int cmd)); \ static int name ## _unload __P((struct lkm_table *lkmtp, int cmd)); \ int name ## _mod __P((struct lkm_table *lkmtp, int cmd, int ver)) \ ------------------------------------------------------------------------ It's use in ipfilter: line 122: MOD_DEV(IPL_VERSION, LM_DT_CHAR, -1, &ipldevsw); Compiler's response: gcc -I. -I../.. -DIPFILTER_LKM -DIPFILTER_LOG -D`uname -m` -D__`uname -m`__ -DINET -DKERNEL -D_KERNEL -I/usr/include -I/sys -I/sys/sys -I/sys/arch -DIPL_NAME=\"/dev/ipl\" -c ../../mln_ipl.c -o ml_ipl.o ../../mln_ipl.c:122: parse error before string constant ../../mln_ipl.c:122: parse error before string constant ../../mln_ipl.c:125: conflicting types for `cdevsw' /usr/include/sys/conf.h:122: previous declaration of `cdevsw' ../../mln_ipl.c: In function `xxxinit': ../../mln_ipl.c:241: `_module' undeclared (first use this function) ../../mln_ipl.c:241: (Each undeclared identifier is reported only once ../../mln_ipl.c:241: for each function it appears in.) *** Error code 1