source: rtems-libbsd/freebsd-to-rtems.py @ 1e8830f0

4.1155-freebsd-126-freebsd-12freebsd-9.3
Last change on this file since 1e8830f0 was 1e8830f0, checked in by Joel Sherrill <joel.sherrill@…>, on 03/08/12 at 17:21:45

More comments. Attempt to support forward/revert selection from command line

  • Property mode set to 100755
File size: 39.5 KB
Line 
1#! /usr/bin/python
2#
3#  Copyright (c) 2009-2011 embedded brains GmbH.  All rights reserved.
4#
5#   embedded brains GmbH
6#   Obere Lagerstr. 30
7#   82178 Puchheim
8#   Germany
9#   <info@embedded-brains.de>
10#
11#  Redistribution and use in source and binary forms, with or without
12#  modification, are permitted provided that the following conditions
13#  are met:
14#  1. Redistributions of source code must retain the above copyright
15#     notice, this list of conditions and the following disclaimer.
16#  2. Redistributions in binary form must reproduce the above copyright
17#     notice, this list of conditions and the following disclaimer in the
18#     documentation and/or other materials provided with the distribution.
19#
20#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24#  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
32# FreeBSD: http://svn.freebsd.org/base/releng/8.2/sys (revision 222485)
33
34import shutil
35import os
36import re
37import sys
38import getopt
39
40RTEMS_DIR = "not_set"
41FreeBSD_DIR = "not_set"
42isVerbose = False
43isForward = True
44isDryRun = True
45isEarlyExit = False
46
47def usage():
48  print "freebsd-to-rtems.py [args]"
49  print "  -?|-h|--help     print this and exit"
50  print "  -d|--dry-run     run program but no modifications"
51  print "  -e|--early-exit  evaluate arguments, print results, and exit"
52  print "  -R|--reverse     default FreeBSD -> RTEMS, reverse that"
53  print "  -r|--rtems       RTEMS directory"
54  print "  -f|--freebsd     FreeBSD directory"
55  print "  -v|--verbose     enable verbose output mode"
56
57# Parse the arguments
58def parseArguments():
59  global RTEMS_DIR, FreeBSD_DIR, isVerbose, isForward, isEarlyExit
60  try:
61    opts, args = getopt.getopt(sys.argv[1:], "?hdeRr:f:v",
62                 ["help",
63                  "help",
64                  "dry-run"
65                  "early-exit"
66                  "reverse"
67                  "rtems="
68                  "freebsd="
69                  "verbose"
70                 ]
71                )
72  except getopt.GetoptError, err:
73    # print help information and exit:
74    print str(err) # will print something like "option -a not recognized"
75    usage()
76    sys.exit(2)
77  for o, a in opts:
78    if o == "-v":
79      isVerbose = True
80    elif o in ("-h", "--help", "-?"):
81      usage()
82      sys.exit()
83    elif o in ("-d", "--dry-run"):
84      isForward = False
85    elif o in ("-e", "--early-exit"):
86      isEarlyExit = True
87    elif o in ("-R", "--reverse"):
88      isForward = False
89    elif o in ("-r", "--rtems"):
90      RTEMS_DIR = a
91    elif o in ("-r", "--rtems"):
92      RTEMS_DIR = a
93    elif o in ("-f", "--freebsd"):
94      FreeBSD_DIR = a
95    else:
96       assert False, "unhandled option"
97
98parseArguments()
99print "Verbose:           " + ("no", "yes")[isVerbose]
100print "Dry Run:           " + ("no", "yes")[isDryRun]
101print "RTEMS Directory:   " + RTEMS_DIR
102print "FreeBSD Directory: " + FreeBSD_DIR
103print "Direction:         " + ("reverse", "forward")[isForward]
104
105# Check directory argument was set and exist
106def wasDirectorySet(desc, path):
107    if path == "not_set":
108        print desc + " Directory was not specified on command line"
109        sys.exit(2)
110
111    if os.path.isdir( path ) != True:
112        print desc + " Directory (" + path + ") does not exist"
113        sys.exit(2)
114
115# Were RTEMS and FreeBSD directories specified
116wasDirectorySet( "RTEMS", RTEMS_DIR )
117wasDirectorySet( "FreeBSD", FreeBSD_DIR )
118 
119if os.path.isdir( FreeBSD_DIR ) != True:
120    print "FreeBSD Directory (" + FreeBSD_DIR + ") does not exist"
121    sys.exit(2)
122 
123if FreeBSD_DIR == RTEMS_DIR:
124    print "FreeBSD and RTEMS Directories are the same"
125    sys.exit(2)
126
127# Are we generating or reverting?
128if isForward == True:
129    print "Generating into", RTEMS_DIR
130else:
131    print "Reverting from", RTEMS_DIR
132
133if isEarlyExit == True:
134    print "Early exit at user request"
135    sys.exit(0)
136 
137# Prefix added to FreeBSD files as they are copied into the RTEMS
138# build tree.
139PREFIX = 'freebsd'
140
141def mapContribPath(path):
142        m = re.match('(.*)(' + PREFIX + '/)(contrib/\\w+/)(.*)', path)
143        if m:
144                path = m.group(1) + m.group(3) + m.group(2) + m.group(4)
145        return path
146
147# generate an empty file as a place holder
148def installEmptyFile(src):
149        dst = RTEMS_DIR + '/' + PREFIX + '/' + src.replace('rtems/', '')
150        if isVerbose == True:
151                print "Install empty - " + dst
152        if isDryRun == True:
153                return
154        try:
155                os.makedirs(os.path.dirname(dst))
156        except OSError:
157                pass
158        out = open(dst, 'w')
159        out.write('/* EMPTY */\n')
160        out.close()
161
162# fix include paths inside a C or .h file
163def fixIncludes(data):
164        data = re.sub('#([ \t]*)include <', '#\\1include <' + PREFIX + '/', data)
165        data = re.sub('#include <' + PREFIX + '/rtems', '#include <rtems', data)
166        data = re.sub('#include <' + PREFIX + '/bsp', '#include <bsp', data)
167        data = re.sub('#include "([^"]*)"', '#include <' + PREFIX + '/local/\\1>', data)
168        data = re.sub('_H_', '_HH_', data)
169        return data
170
171# revert fixing the include paths inside a C or .h file
172def revertFixIncludes(data):
173        data = re.sub('_HH_', '_H_', data)
174        data = re.sub('#include <' + PREFIX + '/local/([^>]*)>', '#include "\\1"', data)
175        data = re.sub('#([ \t]*)include <' + PREFIX + '/', '#\\1include <', data)
176        return data
177
178# Copy a header file from FreeBSD to the RTEMS BSD tree
179def installHeaderFile(org):
180        src = FreeBSD_DIR + '/' + org
181        dst = RTEMS_DIR + '/' + PREFIX + '/' + org # + org.replace('rtems/', '')
182        dst = mapContribPath(dst)
183        if isVerbose == True:
184                print "Install Header - " + src + " => " + dst
185        if isDryRun == True:
186                return
187        try:
188                os.makedirs(os.path.dirname(dst))
189        except OSError:
190                pass
191        data = open(src).read()
192        out = open(dst, 'w')
193        if src.find('rtems') == -1:
194                data = fixIncludes(data)
195        out.write(data)
196        out.close()
197
198# Copy a source file from FreeBSD to the RTEMS BSD tree
199def installSourceFile(org):
200        src = FreeBSD_DIR + '/' + org
201        dst = RTEMS_DIR + '/' + PREFIX + '/' + org
202        dst = mapContribPath(dst)
203        if isVerbose == True:
204                print "Install Source - " + src + " => " + dst
205        if isDryRun == True:
206                return
207        try:
208                os.makedirs(os.path.dirname(dst))
209        except OSError:
210                pass
211        data = open(src).read()
212        out = open(dst, 'w')
213        if src.find('rtems') == -1:
214                data = fixIncludes(data)
215                out.write('#include <' + PREFIX + '/machine/rtems-bsd-config.h>\n\n')
216        out.write(data)
217        out.close()
218
219# Revert a header file from the RTEMS BSD tree to the FreeBSD tree
220def revertHeaderFile(org):
221        src = RTEMS_DIR + '/' + PREFIX + '/' + org.replace('rtems/', '')
222        src = mapContribPath(src)
223        dst = FreeBSD_DIR + '/' + org
224        if isVerbose == True:
225                print "Revert Header - " + src + " => " + dst
226        if isDryRun == True:
227                return
228        try:
229                os.makedirs(os.path.dirname(dst))
230        except OSError:
231                pass
232        data = open(src).read()
233        out = open(dst, 'w')
234        if org.find('rtems') == -1:
235                data = revertFixIncludes(data)
236        out.write(data)
237        out.close()
238
239# Revert a source file from the RTEMS BSD tree to the FreeBSD tree
240def revertSourceFile(org):
241        src = RTEMS_DIR + '/' + PREFIX + '/' + org
242        src = mapContribPath(src)
243        dst = FreeBSD_DIR + '/' + org
244        if isVerbose == True:
245                print "Revert Source - " + src + " => " + dst
246        if isDryRun == True:
247                return
248        try:
249                os.makedirs(os.path.dirname(dst))
250        except OSError:
251                pass
252        data = open(src).read()
253        out = open(dst, 'w')
254        if org.find('rtems') == -1:
255                data = re.sub('#include <' + PREFIX + '/machine/rtems-bsd-config.h>\n\n', '', data)
256                data = revertFixIncludes(data)
257        out.write(data)
258        out.close()
259
260# Remove the output directory
261def deleteOutputDirectory():
262        if isVerbose == True:
263                print "Delete Directory - " + RTEMS_DIR
264        if isDryRun == True:
265                return
266        try:
267                shutil.rmtree(RTEMS_DIR)
268        except OSError:
269            pass
270
271# Module Manager - Collection of Modules
272class ModuleManager:
273        def __init__(self):
274                self.modules = []
275                self.emptyFiles = []
276
277        def addModule(self, module):
278                self.modules.append(module)
279
280        def addEmptyFiles(self, emptyFiles):
281                self.emptyFiles.extend(emptyFiles)
282
283        def copyFiles(self):
284                for f in self.emptyFiles:
285                        installEmptyFile(f)
286                for m in self.modules:
287                        for f in m.headerFiles:
288                                installHeaderFile(f)
289                        for f in m.sourceFiles:
290                                installSourceFile(f)
291
292        def revertFiles(self):
293                for m in self.modules:
294                        for f in m.headerFiles:
295                                revertHeaderFile(f)
296                        for f in m.sourceFiles:
297                                revertSourceFile(f)
298
299        def createMakefile(self):
300                if isVerbose == True:
301                        print "Create Makefile"
302                if isDryRun == True:
303                        return
304                data = 'include config.inc\n' \
305                        '\n' \
306                        'include $(RTEMS_MAKEFILE_PATH)/Makefile.inc\n' \
307                        'include $(RTEMS_CUSTOM)\n' \
308                        'include $(PROJECT_ROOT)/make/leaf.cfg\n' \
309                        '\n' \
310                        'CFLAGS += -ffreestanding \n' \
311                        'CFLAGS += -I . \n' \
312                        'CFLAGS += -I rtemsbsd \n' \
313                        'CFLAGS += -I contrib/altq \n' \
314                        'CFLAGS += -I contrib/pf \n' \
315                        'CFLAGS += -B $(INSTALL_BASE) \n' \
316                        'CFLAGS += -w \n' \
317                        'CFLAGS += -std=gnu99\n' \
318                        '\n'
319                data += 'C_FILES ='
320                for m in self.modules:
321                        for f in m.sourceFiles:
322                                f = PREFIX + '/' + f
323                                f = mapContribPath(f)
324                                data += ' \\\n\t' + f
325                for f in rtems_sourceFiles:
326                        f = 'rtemsbsd/src/' + f
327                        data += ' \\\n\t' + f
328
329                data += '\nC_O_FILES = $(C_FILES:%.c=%.o)\n' \
330                        'C_DEP_FILES = $(C_FILES:%.c=%.dep)\n' \
331                        '\n' \
332                        'LIB = libbsd.a\n' \
333                        '\n' \
334                        'all: lib_usb\n' \
335                        '\n' \
336                        '$(LIB): $(C_O_FILES)\n' \
337                        '\t$(AR) rcu $@ $^\n' \
338                        '\n' \
339                        'lib_usb:\n' \
340                        '\tmake $(LIB)\n' \
341                        '\n' \
342                        'install: $(LIB)\n' \
343            '\tinstall -d $(INSTALL_BASE)/include\n' \
344            '\tinstall -c -m 644 $(LIB) $(INSTALL_BASE)\n' \
345            '\tcd rtemsbsd; for i in `find . -name \'*.h\'` ; do \\\n' \
346            '\t  install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done\n' \
347            '\tfor i in `find contrib freebsd -name \'*.h\'` ; do \\\n' \
348            '\t  install -c -m 644 -D "$$i" "$(INSTALL_BASE)/include/$$i" ; done\n' \
349                        '\n' \
350                        'clean:\n' \
351                        '\trm -f -r $(PROJECT_INCLUDE)/rtems/freebsd\n' \
352                        '\trm -f $(LIB) $(C_O_FILES) $(C_DEP_FILES)\n' \
353                        '\n' \
354                        '-include $(C_DEP_FILES)\n'
355                out = open(RTEMS_DIR + '/Makefile', 'w')
356                out.write(data)
357                out.close()
358
359# Module - logical group of related files we can perform actions on
360class Module:
361        def __init__(self, name):
362                self.name = name
363                self.headerFiles = []
364                self.sourceFiles = []
365                self.dependencies = []
366
367        def addHeaderFiles(self, files):
368                self.headerFiles.extend(files)
369
370        def addSourceFiles(self, files):
371                self.sourceFiles.extend(files)
372
373        def addDependency(self, dep):
374                self.dependencies.append(dep)
375
376# Create Module Manager and supporting Modules
377#  - initialize each module with set of files associated
378mm = ModuleManager()
379
380rtems_headerFiles = [
381        'rtems/machine/in_cksum.h',  # logically a net file
382        'rtems/machine/atomic.h',
383        'rtems/machine/_bus.h',
384        'rtems/machine/bus.h',
385        'rtems/machine/bus_dma.h',
386        'rtems/machine/rtems-bsd-config.h',
387        'rtems/machine/clock.h',
388        'rtems/machine/cpufunc.h',
389        'rtems/machine/endian.h',
390        'rtems/machine/_limits.h',
391        'rtems/machine/_align.h',
392        'rtems/machine/mutex.h',
393        'rtems/machine/param.h',
394        'rtems/machine/pcpu.h',
395        #'rtems/machine/pmap.h',
396        'rtems/machine/proc.h',
397        'rtems/machine/resource.h',
398        'rtems/machine/runq.h',
399        'rtems/machine/signal.h',
400        'rtems/machine/stdarg.h',
401        'rtems/machine/_stdint.h',
402        'rtems/machine/_types.h',
403        'rtems/machine/ucontext.h',
404        'rtems/machine/rtems-bsd-symbols.h',
405        'rtems/machine/rtems-bsd-cache.h',
406        'rtems/machine/rtems-bsd-sysinit.h',
407        'rtems/machine/rtems-bsd-select.h',
408        #'rtems/machine/vm.h',
409        'bsd.h',
410        ]
411rtems_sourceFiles = [
412        'rtems-bsd-cam.c',
413        'rtems-bsd-nexus.c',
414        'rtems-bsd-autoconf.c',
415        'rtems-bsd-delay.c',
416        'rtems-bsd-mutex.c',
417        'rtems-bsd-thread.c',
418        'rtems-bsd-condvar.c',
419        'rtems-bsd-lock.c',
420        'rtems-bsd-sx.c',
421        'rtems-bsd-rmlock.c',
422        'rtems-bsd-rwlock.c',
423        'rtems-bsd-generic.c',
424        'rtems-bsd-panic.c',
425        'rtems-bsd-synch.c',
426        'rtems-bsd-signal.c',
427        'rtems-bsd-callout.c',
428        'rtems-bsd-init.c',
429        'rtems-bsd-init-with-irq.c',
430        'rtems-bsd-assert.c',
431        'rtems-bsd-prot.c',
432        'rtems-bsd-resource.c',
433        'rtems-bsd-jail.c',
434        'rtems-bsd-shell.c',
435        'rtems-bsd-syscalls.c',
436        #rtems-bsd-socket.c',
437        #rtems-bsd-mbuf.c',
438        'rtems-bsd-malloc.c',
439        'rtems-bsd-support.c',
440        'rtems-bsd-bus-dma.c',
441        'rtems-bsd-sysctl.c',
442        'rtems-bsd-sysctlbyname.c',
443        'rtems-bsd-sysctlnametomib.c',
444        'rtems-bsd-uma.c',
445        ]
446# RTEMS files handled separately from modules
447# rtems = Module('rtems')
448# rtems.addHeaderFiles( rtems_headerFiles )
449# rtems.addSourceFiles( rtems_sourceFiles )
450
451local = Module('local')
452local.addHeaderFiles(
453        [
454                'local/bus_if.h',
455                'local/device_if.h',
456                #'local/linker_if.h',
457                'local/opt_bus.h',
458                'local/opt_cam.h',
459                'local/opt_compat.h',
460                'local/opt_ddb.h',
461                'local/opt_hwpmc_hooks.h',
462                'local/opt_init_path.h',
463                'local/opt_ktrace.h',
464                'local/opt_printf.h',
465                'local/opt_scsi.h',
466                'local/opt_usb.h',
467                'local/opt_inet.h',
468                'local/opt_inet6.h',
469                'local/opt_altq.h',
470                'local/opt_atalk.h',
471                'local/opt_bootp.h',
472                'local/opt_bpf.h',
473                'local/opt_bus.h',
474                'local/opt_cam.h',
475                'local/opt_carp.h',
476                'local/opt_compat.h',
477                'local/opt_config.h',
478                'local/opt_cpu.h',
479                'local/opt_ddb.h',
480                'local/opt_device_polling.h',
481                'local/opt_ef.h',
482                'local/opt_enc.h',
483                'local/opt_hwpmc_hooks.h',
484                'local/opt_inet6.h',
485                'local/opt_inet.h',
486                'local/opt_init_path.h',
487                'local/opt_ipdivert.h',
488                'local/opt_ipdn.h',
489                'local/opt_ipfw.h',
490                'local/opt_ipsec.h',
491                'local/opt_ipstealth.h',
492                'local/opt_ipx.h',
493                'local/opt_kdb.h',
494                'local/opt_kdtrace.h',
495                'local/opt_ktrace.h',
496                'local/opt_mbuf_profiling.h',
497                'local/opt_mbuf_stress_test.h',
498                'local/opt_mpath.h',
499                'local/opt_mrouting.h',
500                'local/opt_natm.h',
501                'local/opt_netgraph.h',
502                'local/opt_param.h',
503                'local/opt_posix.h',
504                'local/opt_pf.h',
505                'local/opt_printf.h',
506                'local/opt_route.h',
507                'local/opt_scsi.h',
508                'local/opt_sctp.h',
509                'local/opt_tcpdebug.h',
510                'local/opt_tdma.h',
511                'local/opt_usb.h',
512                'local/opt_vlan.h',
513                'local/opt_wlan.h',
514                'local/opt_zero.h',
515                'local/pmap.h',
516                'local/usbdevs_data.h',
517                'local/usbdevs.h',
518                'local/usb_if.h',
519                'local/vnode_if.h',
520                'local/vnode_if_newproto.h',
521                'local/vnode_if_typedef.h',
522                'local/cryptodev_if.h',
523                'local/miibus_if.h',
524                'local/miidevs.h',
525        ]
526)
527local.addSourceFiles(
528        [
529                'local/usb_if.c',
530                'local/bus_if.c',
531                #'local/linker_if.c',
532                'local/device_if.c',
533                'local/cryptodev_if.c',
534                'local/miibus_if.c',
535        ]
536)
537
538devUsb = Module('dev_usb')
539devUsb.addHeaderFiles(
540        [
541                'dev/usb/ufm_ioctl.h',
542                'dev/usb/usb_busdma.h',
543                'dev/usb/usb_bus.h',
544                'dev/usb/usb_cdc.h',
545                'dev/usb/usb_controller.h',
546                'dev/usb/usb_core.h',
547                'dev/usb/usb_debug.h',
548                'dev/usb/usb_dev.h',
549                'dev/usb/usb_device.h',
550                'dev/usb/usbdi.h',
551                'dev/usb/usbdi_util.h',
552                'dev/usb/usb_dynamic.h',
553                'dev/usb/usb_endian.h',
554                'dev/usb/usb_freebsd.h',
555                'dev/usb/usb_generic.h',
556                'dev/usb/usb.h',
557                'dev/usb/usbhid.h',
558                'dev/usb/usb_hub.h',
559                'dev/usb/usb_ioctl.h',
560                'dev/usb/usb_mbuf.h',
561                'dev/usb/usb_msctest.h',
562                'dev/usb/usb_process.h',
563                'dev/usb/usb_request.h',
564                'dev/usb/usb_transfer.h',
565                'dev/usb/usb_util.h',
566        ]
567)
568devUsb.addSourceFiles(
569        [
570                'dev/usb/usb_busdma.c',
571                'dev/usb/usb_core.c',
572                'dev/usb/usb_debug.c',
573                'dev/usb/usb_dev.c',
574                'dev/usb/usb_device.c',
575                'dev/usb/usb_dynamic.c',
576                'dev/usb/usb_error.c',
577                'dev/usb/usb_generic.c',
578                'dev/usb/usb_handle_request.c',
579                'dev/usb/usb_hid.c',
580                'dev/usb/usb_hub.c',
581                'dev/usb/usb_lookup.c',
582                'dev/usb/usb_mbuf.c',
583                'dev/usb/usb_msctest.c',
584                'dev/usb/usb_parse.c',
585                'dev/usb/usb_process.c',
586                'dev/usb/usb_request.c',
587                'dev/usb/usb_transfer.c',
588                'dev/usb/usb_util.c',
589        ]
590)
591
592devUsbAddOn = Module('dev_usb_add_on')
593devUsbAddOn.addHeaderFiles(
594        [
595                'dev/usb/usb_pci.h',
596                'dev/usb/usb_compat_linux.h',
597        ]
598)
599devUsbAddOn.addSourceFiles(
600        [
601                'dev/usb/usb_compat_linux.c',
602        ]
603)
604
605devUsbBluetooth = Module('dev_usb_bluetooth')
606devUsbBluetooth.addDependency(devUsb)
607devUsbBluetooth.addHeaderFiles(
608        [
609                'dev/usb/bluetooth/ng_ubt_var.h',
610        ]
611)
612devUsbBluetooth.addSourceFiles(
613        [
614                'dev/usb/bluetooth/ng_ubt.c',
615                'dev/usb/bluetooth/ubtbcmfw.c',
616        ]
617)
618
619devUsbController = Module('dev_usb_controller')
620devUsbController.addDependency(devUsb)
621devUsbController.addHeaderFiles(
622        [
623                'dev/usb/controller/ohci.h',
624                'dev/usb/controller/ohcireg.h',
625                'dev/usb/controller/ehci.h',
626                'dev/usb/controller/ehcireg.h',
627        ]
628)
629devUsbController.addSourceFiles(
630        [
631                'dev/usb/controller/ohci.c',
632                'dev/usb/controller/ehci.c',
633                'dev/usb/controller/usb_controller.c',
634                'dev/usb/controller/ohci_lpc3250.c',
635        ]
636)
637
638devUsbControllerAddOn = Module('dev_usb_controller_add_on')
639devUsbControllerAddOn.addDependency(devUsb)
640devUsbControllerAddOn.addHeaderFiles(
641        [
642                'dev/usb/controller/at91dci.h',
643                'dev/usb/controller/atmegadci.h',
644                'dev/usb/controller/musb_otg.h',
645                'dev/usb/controller/uss820dci.h',
646        ]
647)
648devUsbControllerAddOn.addSourceFiles(
649        [
650                'dev/usb/controller/at91dci_atmelarm.c',
651                'dev/usb/controller/at91dci.c',
652                'dev/usb/controller/atmegadci_atmelarm.c',
653                'dev/usb/controller/atmegadci.c',
654                'dev/usb/controller/ehci_ixp4xx.c',
655                'dev/usb/controller/ehci_pci.c',
656                'dev/usb/controller/musb_otg.c',
657                'dev/usb/controller/ehci_mbus.c',
658                'dev/usb/controller/musb_otg_atmelarm.c',
659                'dev/usb/controller/ohci_atmelarm.c',
660                'dev/usb/controller/ohci_pci.c',
661                'dev/usb/controller/uhci_pci.c',
662                'dev/usb/controller/uss820dci_atmelarm.c',
663                'dev/usb/controller/uss820dci.c',
664        ]
665)
666
667devUsbInput = Module('dev_usb_input')
668devUsbInput.addDependency(devUsb)
669devUsbInput.addHeaderFiles(
670        [
671                'dev/usb/input/usb_rdesc.h',
672        ]
673)
674devUsbInput.addSourceFiles(
675        [
676                'dev/usb/input/uhid.c',
677                'dev/usb/input/ukbd.c',
678        ]
679)
680
681devUsbInputMouse = Module('dev_usb_mouse')
682devUsbInputMouse.addDependency(devUsb)
683devUsbInputMouse.addHeaderFiles(
684        [
685                'sys/tty.h',
686                'sys/mouse.h',
687                'sys/ttyqueue.h',
688                'sys/ttydefaults.h',
689                'sys/ttydisc.h',
690                'sys/ttydevsw.h',
691                'sys/ttyhook.h',
692        ]
693)
694devUsbInputMouse.addSourceFiles(
695        [
696                'dev/usb/input/ums.c',
697        ]
698)
699
700devUsbMisc = Module('dev_usb_misc')
701devUsbMisc.addDependency(devUsb)
702devUsbMisc.addHeaderFiles(
703        [
704                'dev/usb/misc/udbp.h',
705        ]
706)
707devUsbMisc.addSourceFiles(
708        [
709                'dev/usb/misc/udbp.c',
710                'dev/usb/misc/ufm.c',
711        ]
712)
713
714devUsbNet = Module('dev_usb_net')
715devUsbNet.addDependency(devUsb)
716devUsbNet.addHeaderFiles(
717        [
718                'dev/mii/mii.h',
719                'dev/mii/miivar.h',
720                'net/bpf.h',
721                'net/ethernet.h',
722                'net/if_arp.h',
723                'net/if_dl.h',
724                'net/if.h',
725                'net/if_media.h',
726                'net/if_types.h',
727                'net/if_var.h',
728                'net/vnet.h',
729                'dev/usb/net/if_cdcereg.h',
730                'dev/usb/net/usb_ethernet.h',
731        ]
732)
733devUsbNet.addSourceFiles(
734        [
735                'dev/usb/net/if_cdce.c',
736                'dev/usb/net/usb_ethernet.c',
737        ]
738)
739
740devUsbQuirk = Module('dev_usb_quirk')
741devUsbQuirk.addDependency(devUsb)
742devUsbQuirk.addHeaderFiles(
743        [
744                'dev/usb/quirk/usb_quirk.h',
745        ]
746)
747devUsbQuirk.addSourceFiles(
748        [
749                'dev/usb/quirk/usb_quirk.c',
750        ]
751)
752
753devUsbSerial = Module('dev_usb_serial')
754devUsbSerial.addDependency(devUsb)
755devUsbSerial.addHeaderFiles(
756        [
757                'dev/usb/serial/uftdi_reg.h',
758                'dev/usb/serial/usb_serial.h',
759        ]
760)
761devUsbSerial.addSourceFiles(
762        [
763                'dev/usb/serial/u3g.c',
764                'dev/usb/serial/uark.c',
765                'dev/usb/serial/ubsa.c',
766                'dev/usb/serial/ubser.c',
767                'dev/usb/serial/uchcom.c',
768                'dev/usb/serial/ucycom.c',
769                'dev/usb/serial/ufoma.c',
770                'dev/usb/serial/uftdi.c',
771                'dev/usb/serial/ugensa.c',
772                'dev/usb/serial/uipaq.c',
773                'dev/usb/serial/ulpt.c',
774                'dev/usb/serial/umct.c',
775                'dev/usb/serial/umodem.c',
776                'dev/usb/serial/umoscom.c',
777                'dev/usb/serial/uplcom.c',
778                'dev/usb/serial/usb_serial.c',
779                'dev/usb/serial/uslcom.c',
780                'dev/usb/serial/uvisor.c',
781                'dev/usb/serial/uvscom.c',
782        ]
783)
784
785devUsbStorage = Module('dev_usb_storage')
786devUsbStorage.addDependency(devUsb)
787devUsbStorage.addSourceFiles(
788        [
789                'dev/usb/storage/umass.c',
790        ]
791)
792
793devUsbStorageAddOn = Module('dev_usb_storage_add_on')
794devUsbStorageAddOn.addDependency(devUsb)
795devUsbStorageAddOn.addHeaderFiles(
796        [
797                'dev/usb/storage/rio500_usb.h',
798        ]
799)
800devUsbStorageAddOn.addSourceFiles(
801        [
802                'dev/usb/storage/urio.c',
803                'dev/usb/storage/ustorage_fs.c',
804        ]
805)
806
807devUsbTemplate = Module('dev_usb_template')
808devUsbTemplate.addDependency(devUsb)
809devUsbTemplate.addHeaderFiles(
810        [
811                'dev/usb/template/usb_template.h',
812        ]
813)
814devUsbTemplate.addSourceFiles(
815        [
816                'dev/usb/template/usb_template.c',
817                'dev/usb/template/usb_template_cdce.c',
818                'dev/usb/template/usb_template_msc.c',
819                'dev/usb/template/usb_template_mtp.c',
820        ]
821)
822
823devUsbWlan = Module('dev_usb_wlan')
824devUsbWlan.addDependency(devUsb)
825devUsbWlan.addHeaderFiles(
826        [
827                'dev/usb/wlan/if_rumfw.h',
828                'dev/usb/wlan/if_rumreg.h',
829                'dev/usb/wlan/if_rumvar.h',
830                'dev/usb/wlan/if_uathreg.h',
831                'dev/usb/wlan/if_uathvar.h',
832                'dev/usb/wlan/if_upgtvar.h',
833                'dev/usb/wlan/if_uralreg.h',
834                'dev/usb/wlan/if_uralvar.h',
835                'dev/usb/wlan/if_zydfw.h',
836                'dev/usb/wlan/if_zydreg.h',
837        ]
838)
839devUsbWlan.addSourceFiles(
840        [
841                'dev/usb/wlan/if_rum.c',
842                'dev/usb/wlan/if_uath.c',
843                'dev/usb/wlan/if_upgt.c',
844                'dev/usb/wlan/if_ural.c',
845                'dev/usb/wlan/if_zyd.c',
846        ]
847)
848
849devPci = Module('dev_pci')
850devPci.addHeaderFiles(
851        [
852                'dev/pci/pcireg.h',
853                'dev/pci/pcivar.h',
854        ]
855)
856
857devUsbBase = Module('dev_usb_base')
858devUsbBase.addHeaderFiles(
859        [
860                'bsm/audit.h',
861                'bsm/audit_kevents.h',
862                'sys/acl.h',
863                'sys/bufobj.h',
864                'sys/_bus_dma.h',
865                'sys/bus_dma.h',
866                'sys/bus.h',
867                'sys/callout.h',
868                'sys/cdefs.h',
869                'sys/condvar.h',
870                'sys/conf.h',
871                #'sys/cpuset.h',
872                'sys/ctype.h',
873                'sys/endian.h',
874                'sys/errno.h',
875                'sys/event.h',
876                'sys/eventhandler.h',
877                'sys/fcntl.h',
878                'sys/filedesc.h',
879                'sys/file.h',
880                'sys/filio.h',
881                'sys/ioccom.h',
882                'sys/_iovec.h',
883                'sys/kernel.h',
884                'sys/kobj.h',
885                'sys/kthread.h',
886                'sys/ktr.h',
887                'sys/libkern.h',
888                'sys/linker_set.h',
889                'sys/_lock.h',
890                'sys/lock.h',
891                'sys/_lockmgr.h',
892                'sys/lockmgr.h',
893                'sys/lock_profile.h',
894                'sys/lockstat.h',
895                'sys/mac.h',
896                'sys/malloc.h',
897                'sys/mbuf.h',
898                'sys/module.h',
899                'sys/mount.h',
900                'sys/_mutex.h',
901                'sys/mutex.h',
902                'sys/_null.h',
903                'sys/osd.h',
904                'sys/param.h',
905                'sys/pcpu.h',
906                'sys/poll.h',
907                'sys/priority.h',
908                'sys/priv.h',
909                'sys/proc.h',
910                'sys/queue.h',
911                'sys/refcount.h',
912                'sys/resource.h',
913                'sys/resourcevar.h',
914                'sys/rtprio.h',
915                'sys/runq.h',
916                'sys/_rwlock.h',
917                'sys/rwlock.h',
918                'sys/_semaphore.h',
919                'sys/selinfo.h',
920                'sys/sigio.h',
921                'sys/signal.h',
922                'sys/signalvar.h',
923                'sys/_sigset.h',
924                #'sys/sleepqueue.h',
925                'sys/socket.h',
926                'sys/stddef.h',
927                'sys/stdint.h',
928                'sys/_sx.h',
929                'sys/sx.h',
930                'sys/sysctl.h',
931                'sys/systm.h',
932                'sys/ttycom.h',
933                'sys/_types.h',
934                'sys/types.h',
935                'sys/ucontext.h',
936                'sys/ucred.h',
937                'sys/uio.h',
938                'sys/unistd.h',
939                #'sys/vmmeter.h',
940                #'sys/vnode.h',
941                'sys/rman.h',
942                'sys/reboot.h',
943                'sys/bitstring.h',
944                'sys/linker.h',
945                'vm/uma.h',
946                'vm/uma_int.h',
947                'vm/uma_dbg.h',
948                #'vm/vm.h',
949                #'vm/vm_page.h',
950                'fs/devfs/devfs_int.h',
951        ]
952)
953devUsbBase.addSourceFiles(
954        [
955                'kern/init_main.c',
956                #'kern/kern_linker.c',
957                #'kern/kern_mib.c',
958                'kern/kern_mbuf.c',
959                'kern/kern_module.c',
960                'kern/kern_sysctl.c',
961                'kern/subr_bus.c',
962                'kern/subr_kobj.c',
963                #'kern/subr_sleepqueue.c',
964                'kern/uipc_mbuf.c',
965                'kern/uipc_mbuf2.c',
966                'kern/uipc_socket.c',
967                #'kern/uipc_domain.c',
968                #'kern/uipc_syscalls.c',
969                #'vm/uma_core.c',
970        ]
971)
972
973cam = Module('cam')
974cam.addHeaderFiles(
975        [
976                'sys/ata.h',
977                'cam/cam.h',
978                'cam/cam_ccb.h',
979                'cam/cam_sim.h',
980                'cam/cam_xpt_sim.h',
981                'cam/scsi/scsi_all.h',
982                'cam/scsi/scsi_da.h',
983                'cam/ata/ata_all.h',
984                'cam/cam_periph.h',
985                'cam/cam_debug.h',
986                'cam/cam_xpt.h',
987        ]
988)
989cam.addSourceFiles(
990        [
991                'cam/cam.c',
992                'cam/scsi/scsi_all.c',
993        ]
994)
995
996devNet = Module('dev_net')
997devNet.addHeaderFiles(
998        [
999                'dev/mii/mii.h',
1000                'dev/mii/miivar.h',
1001                'dev/mii/icsphyreg.h',
1002                'net/bpf.h',
1003                'net/ethernet.h',
1004                'net/if_arp.h',
1005                'net/if_dl.h',
1006                'net/if.h',
1007                'net/if_media.h',
1008                'net/if_types.h',
1009                'net/if_var.h',
1010                'net/vnet.h',
1011        ]
1012)
1013devNet.addSourceFiles(
1014        [
1015                'dev/mii/mii.c',
1016                'dev/mii/mii_physubr.c',
1017                'dev/mii/icsphy.c',
1018        ]
1019)
1020
1021netDeps = Module('netDeps')
1022# logically machine/in_cksum.h is part of this group but RTEMS provides its own
1023netDeps.addHeaderFiles(
1024        [
1025                'security/mac/mac_framework.h',
1026                'sys/cpu.h',
1027                'sys/interrupt.h',
1028                'sys/fnv_hash.h',
1029                'sys/tree.h',
1030                'sys/taskqueue.h',
1031                'sys/buf_ring.h',
1032                'sys/rwlock.h',
1033                'sys/_rmlock.h',
1034                'sys/sockio.h',
1035                'sys/sdt.h',
1036                'sys/_task.h',
1037                'sys/sbuf.h',
1038                'sys/smp.h',
1039                'sys/syslog.h',
1040                'sys/jail.h',
1041                'sys/protosw.h',
1042                'sys/random.h',
1043                'sys/rmlock.h',
1044                'sys/hash.h',
1045                #'sys/select.h',
1046                'sys/sf_buf.h',
1047                'sys/socketvar.h',
1048                'sys/sockbuf.h',
1049                #'sys/sysproto.h',
1050                'sys/sockstate.h',
1051                'sys/sockopt.h',
1052                'sys/domain.h',
1053                'sys/time.h',
1054        ]
1055)
1056
1057net = Module('net')
1058net.addHeaderFiles(
1059        [
1060                'net/bpf_buffer.h',
1061                'net/bpfdesc.h',
1062                'net/bpf.h',
1063                'net/bpf_jitter.h',
1064                'net/bpf_zerocopy.h',
1065                'net/bridgestp.h',
1066                'net/ethernet.h',
1067                'net/fddi.h',
1068                'net/firewire.h',
1069                'net/flowtable.h',
1070                'net/ieee8023ad_lacp.h',
1071                'net/if_arc.h',
1072                'net/if_arp.h',
1073                'net/if_atm.h',
1074                'net/if_bridgevar.h',
1075                'net/if_clone.h',
1076                'net/if_dl.h',
1077                'net/if_enc.h',
1078                'net/if_gif.h',
1079                'net/if_gre.h',
1080                'net/if.h',
1081                'net/if_lagg.h',
1082                'net/if_llatbl.h',
1083                'net/if_llc.h',
1084                'net/if_media.h',
1085                'net/if_mib.h',
1086                'net/if_sppp.h',
1087                'net/if_stf.h',
1088                'net/if_tap.h',
1089                'net/if_tapvar.h',
1090                'net/if_tun.h',
1091                'net/if_types.h',
1092                'net/if_var.h',
1093                'net/if_vlan_var.h',
1094                'net/iso88025.h',
1095                'net/netisr.h',
1096                'net/pfil.h',
1097                'net/pfkeyv2.h',
1098                'net/ppp_defs.h',
1099                'net/radix.h',
1100                'net/radix_mpath.h',
1101                'net/raw_cb.h',
1102                'net/route.h',
1103                'net/slcompress.h',
1104                'net/vnet.h',
1105                'net/zlib.h',
1106        ]
1107)
1108net.addSourceFiles(
1109        [
1110                'net/bridgestp.c',
1111                'net/ieee8023ad_lacp.c',
1112                'net/if_atmsubr.c',
1113                'net/if.c',
1114                'net/if_clone.c',
1115                'net/if_dead.c',
1116                'net/if_disc.c',
1117                'net/if_edsc.c',
1118                'net/if_ef.c',
1119                'net/if_enc.c',
1120                'net/if_epair.c',
1121                'net/if_faith.c',
1122                'net/if_fddisubr.c',
1123                'net/if_fwsubr.c',
1124                'net/if_gif.c',
1125                'net/if_gre.c',
1126                'net/if_iso88025subr.c',
1127                'net/if_lagg.c',
1128                'net/if_llatbl.c',
1129                'net/if_loop.c',
1130                'net/if_media.c',
1131                'net/if_mib.c',
1132                'net/if_spppfr.c',
1133                'net/if_spppsubr.c',
1134                'net/if_stf.c',
1135                'net/if_tap.c',
1136                'net/if_tun.c',
1137                'net/if_vlan.c',
1138                'net/pfil.c',
1139                'net/radix.c',
1140                'net/radix_mpath.c',
1141                'net/raw_cb.c',
1142                'net/raw_usrreq.c',
1143                'net/route.c',
1144                'net/rtsock.c',
1145                'net/slcompress.c',
1146                'net/zlib.c',
1147                'net/bpf_buffer.c',
1148                'net/bpf.c',
1149                'net/bpf_filter.c',
1150                'net/bpf_jitter.c',
1151                'net/if_arcsubr.c',
1152                'net/if_bridge.c',
1153                'net/if_ethersubr.c',
1154                'net/netisr.c',
1155        ]
1156)
1157
1158netinet = Module('netinet')
1159netinet.addHeaderFiles(
1160        [
1161                'netinet/icmp6.h',
1162                'netinet/icmp_var.h',
1163                'netinet/if_atm.h',
1164                'netinet/if_ether.h',
1165                'netinet/igmp.h',
1166                'netinet/igmp_var.h',
1167                'netinet/in_gif.h',
1168                'netinet/in.h',
1169                'netinet/in_pcb.h',
1170                'netinet/in_systm.h',
1171                'netinet/in_var.h',
1172                'netinet/ip6.h',
1173                'netinet/ip_carp.h',
1174                'netinet/ip_divert.h',
1175                'netinet/ip_dummynet.h',
1176                'netinet/ip_ecn.h',
1177                'netinet/ip_encap.h',
1178                'netinet/ip_fw.h',
1179                'netinet/ip_gre.h',
1180                'netinet/ip.h',
1181                'netinet/ip_icmp.h',
1182                'netinet/ip_ipsec.h',
1183                'netinet/ip_mroute.h',
1184                'netinet/ip_options.h',
1185                'netinet/ip_var.h',
1186                'netinet/ipfw/ip_dn_private.h',
1187                'netinet/ipfw/ip_fw_private.h',
1188                'netinet/ipfw/dn_sched.h',
1189                'netinet/ipfw/dn_heap.h',
1190                'netinet/pim.h',
1191                'netinet/pim_var.h',
1192                'netinet/sctp_asconf.h',
1193                'netinet/sctp_auth.h',
1194                'netinet/sctp_bsd_addr.h',
1195                'netinet/sctp_cc_functions.h',
1196                'netinet/sctp_constants.h',
1197                'netinet/sctp_crc32.h',
1198                'netinet/sctp.h',
1199                'netinet/sctp_header.h',
1200                'netinet/sctp_indata.h',
1201                'netinet/sctp_input.h',
1202                'netinet/sctp_lock_bsd.h',
1203                'netinet/sctp_os_bsd.h',
1204                'netinet/sctp_os.h',
1205                'netinet/sctp_output.h',
1206                'netinet/sctp_pcb.h',
1207                'netinet/sctp_peeloff.h',
1208                'netinet/sctp_structs.h',
1209                'netinet/sctp_sysctl.h',
1210                'netinet/sctp_timer.h',
1211                'netinet/sctp_uio.h',
1212                'netinet/sctputil.h',
1213                'netinet/sctp_var.h',
1214                'netinet/tcp_debug.h',
1215                'netinet/tcp_fsm.h',
1216                'netinet/tcp.h',
1217                'netinet/tcp_hostcache.h',
1218                'netinet/tcpip.h',
1219                'netinet/tcp_lro.h',
1220                'netinet/tcp_offload.h',
1221                'netinet/tcp_seq.h',
1222                'netinet/tcp_syncache.h',
1223                'netinet/tcp_timer.h',
1224                'netinet/tcp_var.h',
1225                'netinet/toedev.h',
1226                'netinet/udp.h',
1227                'netinet/udp_var.h',
1228                'netinet/libalias/alias_local.h',
1229                'netinet/libalias/alias.h',
1230                'netinet/libalias/alias_mod.h',
1231                'netinet/libalias/alias_sctp.h',
1232        ]
1233)
1234netinet.addSourceFiles(
1235        [
1236                'netinet/accf_data.c',
1237                'netinet/accf_dns.c',
1238                'netinet/accf_http.c',
1239                'netinet/if_atm.c',
1240                'netinet/if_ether.c',
1241                'netinet/igmp.c',
1242                'netinet/in.c',
1243                'netinet/in_cksum.c',
1244                'netinet/in_gif.c',
1245                'netinet/in_mcast.c',
1246                'netinet/in_pcb.c',
1247                'netinet/in_proto.c',
1248                'netinet/in_rmx.c',
1249                'netinet/ip_carp.c',
1250                'netinet/ip_divert.c',
1251                'netinet/ip_ecn.c',
1252                'netinet/ip_encap.c',
1253                'netinet/ip_fastfwd.c',
1254                'netinet/ip_gre.c',
1255                'netinet/ip_icmp.c',
1256                'netinet/ip_id.c',
1257                'netinet/ip_input.c',
1258                'netinet/ip_ipsec.c',
1259                'netinet/ip_mroute.c',
1260                'netinet/ip_options.c',
1261                'netinet/ip_output.c',
1262                'netinet/raw_ip.c',
1263                'netinet/sctp_asconf.c',
1264                'netinet/sctp_auth.c',
1265                'netinet/sctp_bsd_addr.c',
1266                'netinet/sctp_cc_functions.c',
1267                'netinet/sctp_crc32.c',
1268                'netinet/sctp_indata.c',
1269                'netinet/sctp_input.c',
1270                'netinet/sctp_output.c',
1271                'netinet/sctp_pcb.c',
1272                'netinet/sctp_peeloff.c',
1273                'netinet/sctp_sysctl.c',
1274                'netinet/sctp_timer.c',
1275                'netinet/sctp_usrreq.c',
1276                'netinet/sctputil.c',
1277                'netinet/tcp_debug.c',
1278                #'netinet/tcp_hostcache.c',
1279                'netinet/tcp_input.c',
1280                'netinet/tcp_lro.c',
1281                'netinet/tcp_offload.c',
1282                'netinet/tcp_output.c',
1283                'netinet/tcp_reass.c',
1284                'netinet/tcp_sack.c',
1285                'netinet/tcp_subr.c',
1286                'netinet/tcp_syncache.c',
1287                'netinet/tcp_timer.c',
1288                'netinet/tcp_timewait.c',
1289                'netinet/tcp_usrreq.c',
1290                'netinet/udp_usrreq.c',
1291                'netinet/ipfw/dn_sched_fifo.c',
1292                'netinet/ipfw/dn_sched_rr.c',
1293                'netinet/ipfw/ip_fw_log.c',
1294                'netinet/ipfw/dn_sched_qfq.c',
1295                'netinet/ipfw/dn_sched_prio.c',
1296                #'netinet/ipfw/ip_fw_dynamic.c',
1297                'netinet/ipfw/ip_dn_glue.c',
1298                'netinet/ipfw/ip_fw2.c',
1299                'netinet/ipfw/dn_heap.c',
1300                'netinet/ipfw/ip_dummynet.c',
1301                'netinet/ipfw/ip_fw_sockopt.c',
1302                'netinet/ipfw/dn_sched_wf2q.c',
1303                'netinet/ipfw/ip_fw_nat.c',
1304                'netinet/ipfw/ip_fw_pfil.c',
1305                'netinet/ipfw/ip_dn_io.c',
1306                'netinet/ipfw/ip_fw_table.c',
1307                'netinet/libalias/alias_dummy.c',
1308                'netinet/libalias/alias_pptp.c',
1309                'netinet/libalias/alias_smedia.c',
1310                'netinet/libalias/alias_mod.c',
1311                'netinet/libalias/alias_cuseeme.c',
1312                'netinet/libalias/alias_nbt.c',
1313                'netinet/libalias/alias_irc.c',
1314                'netinet/libalias/alias_util.c',
1315                'netinet/libalias/alias_db.c',
1316                'netinet/libalias/alias_ftp.c',
1317                'netinet/libalias/alias_proxy.c',
1318                'netinet/libalias/alias.c',
1319                'netinet/libalias/alias_skinny.c',
1320                'netinet/libalias/alias_sctp.c',
1321        ]
1322)
1323
1324netinet6 = Module('netinet6')
1325netinet6.addHeaderFiles(
1326        [
1327                'netinet6/icmp6.h',
1328                'netinet6/in6_gif.h',
1329                'netinet6/in6.h',
1330                'netinet6/in6_ifattach.h',
1331                'netinet6/in6_pcb.h',
1332                'netinet6/in6_var.h',
1333                'netinet6/ip6_ecn.h',
1334                'netinet6/ip6.h',
1335                'netinet6/ip6_ipsec.h',
1336                'netinet6/ip6_mroute.h',
1337                'netinet6/ip6protosw.h',
1338                'netinet6/ip6_var.h',
1339                'netinet6/mld6.h',
1340                'netinet6/mld6_var.h',
1341                'netinet6/nd6.h',
1342                'netinet6/pim6.h',
1343                'netinet6/pim6_var.h',
1344                'netinet6/raw_ip6.h',
1345                'netinet6/scope6_var.h',
1346                'netinet6/sctp6_var.h',
1347                'netinet6/tcp6_var.h',
1348                'netinet6/udp6_var.h',
1349        ]
1350)
1351netinet6.addSourceFiles(
1352        [
1353                'netinet6/dest6.c',
1354                'netinet6/frag6.c',
1355                'netinet6/icmp6.c',
1356                'netinet6/in6.c',
1357                'netinet6/in6_cksum.c',
1358                'netinet6/in6_gif.c',
1359                'netinet6/in6_ifattach.c',
1360                'netinet6/in6_mcast.c',
1361                'netinet6/in6_pcb.c',
1362                'netinet6/in6_proto.c',
1363                'netinet6/in6_rmx.c',
1364                'netinet6/in6_src.c',
1365                'netinet6/ip6_forward.c',
1366                'netinet6/ip6_id.c',
1367                'netinet6/ip6_input.c',
1368                'netinet6/ip6_ipsec.c',
1369                'netinet6/ip6_mroute.c',
1370                'netinet6/ip6_output.c',
1371                'netinet6/mld6.c',
1372                'netinet6/nd6.c',
1373                'netinet6/nd6_nbr.c',
1374                'netinet6/nd6_rtr.c',
1375                'netinet6/raw_ip6.c',
1376                'netinet6/route6.c',
1377                'netinet6/scope6.c',
1378                'netinet6/sctp6_usrreq.c',
1379                'netinet6/udp6_usrreq.c',
1380        ]
1381)
1382
1383netipsec = Module('netipsec')
1384netipsec.addHeaderFiles(
1385        [
1386                'netipsec/ah.h',
1387                'netipsec/ah_var.h',
1388                'netipsec/esp.h',
1389                'netipsec/esp_var.h',
1390                'netipsec/ipcomp.h',
1391                'netipsec/ipcomp_var.h',
1392                'netipsec/ipip_var.h',
1393                'netipsec/ipsec6.h',
1394                'netipsec/ipsec.c',
1395                'netipsec/ipsec.h',
1396                'netipsec/keydb.h',
1397                'netipsec/key_debug.h',
1398                'netipsec/key.h',
1399                'netipsec/keysock.h',
1400                'netipsec/key_var.h',
1401                'netipsec/xform.h',
1402        ]
1403)
1404netipsec.addSourceFiles(
1405        [
1406                'netipsec/ipsec_input.c',
1407                'netipsec/ipsec_mbuf.c',
1408                'netipsec/ipsec_output.c',
1409                'netipsec/key.c',
1410                'netipsec/key_debug.c',
1411                'netipsec/keysock.c',
1412                'netipsec/xform_ah.c',
1413                'netipsec/xform_esp.c',
1414                'netipsec/xform_ipcomp.c',
1415                'netipsec/xform_ipip.c',
1416                'netipsec/xform_tcp.c',
1417        ]
1418)
1419
1420net80211 = Module('net80211')
1421net80211.addHeaderFiles(
1422        [
1423                'net80211/ieee80211_action.h',
1424                'net80211/ieee80211_adhoc.h',
1425                'net80211/ieee80211_ageq.h',
1426                'net80211/ieee80211_amrr.h',
1427                'net80211/ieee80211_crypto.h',
1428                'net80211/ieee80211_dfs.h',
1429                'net80211/ieee80211_freebsd.h',
1430                'net80211/_ieee80211.h',
1431                'net80211/ieee80211.h',
1432                'net80211/ieee80211_hostap.h',
1433                'net80211/ieee80211_ht.h',
1434                'net80211/ieee80211_input.h',
1435                'net80211/ieee80211_ioctl.h',
1436                'net80211/ieee80211_mesh.h',
1437                'net80211/ieee80211_monitor.h',
1438                'net80211/ieee80211_node.h',
1439                'net80211/ieee80211_phy.h',
1440                'net80211/ieee80211_power.h',
1441                'net80211/ieee80211_proto.h',
1442                'net80211/ieee80211_radiotap.h',
1443                'net80211/ieee80211_ratectl.h',
1444                'net80211/ieee80211_regdomain.h',
1445                'net80211/ieee80211_rssadapt.h',
1446                'net80211/ieee80211_scan.h',
1447                'net80211/ieee80211_sta.h',
1448                'net80211/ieee80211_superg.h',
1449                'net80211/ieee80211_tdma.h',
1450                'net80211/ieee80211_var.h',
1451                'net80211/ieee80211_wds.h',
1452        ]
1453)
1454netipsec.addSourceFiles(
1455        [
1456                'net80211/ieee80211_acl.c',
1457                'net80211/ieee80211_action.c',
1458                'net80211/ieee80211_adhoc.c',
1459                'net80211/ieee80211_ageq.c',
1460                'net80211/ieee80211_amrr.c',
1461                'net80211/ieee80211.c',
1462                'net80211/ieee80211_crypto.c',
1463                'net80211/ieee80211_crypto_ccmp.c',
1464                'net80211/ieee80211_crypto_none.c',
1465                'net80211/ieee80211_crypto_tkip.c',
1466                'net80211/ieee80211_crypto_wep.c',
1467                'net80211/ieee80211_ddb.c',
1468                'net80211/ieee80211_dfs.c',
1469                'net80211/ieee80211_freebsd.c',
1470                'net80211/ieee80211_hostap.c',
1471                'net80211/ieee80211_ht.c',
1472                'net80211/ieee80211_hwmp.c',
1473                'net80211/ieee80211_input.c',
1474                'net80211/ieee80211_ioctl.c',
1475                'net80211/ieee80211_mesh.c',
1476                'net80211/ieee80211_monitor.c',
1477                'net80211/ieee80211_node.c',
1478                'net80211/ieee80211_output.c',
1479                'net80211/ieee80211_phy.c',
1480                'net80211/ieee80211_power.c',
1481                'net80211/ieee80211_proto.c',
1482                'net80211/ieee80211_radiotap.c',
1483                'net80211/ieee80211_ratectl.c',
1484                'net80211/ieee80211_ratectl_none.c',
1485                'net80211/ieee80211_regdomain.c',
1486                'net80211/ieee80211_rssadapt.c',
1487                'net80211/ieee80211_scan.c',
1488                'net80211/ieee80211_scan_sta.c',
1489                'net80211/ieee80211_sta.c',
1490                'net80211/ieee80211_superg.c',
1491                'net80211/ieee80211_tdma.c',
1492                'net80211/ieee80211_wds.c',
1493                'net80211/ieee80211_xauth.c',
1494        ]
1495)
1496
1497opencrypto = Module('opencrypto')
1498opencrypto.addHeaderFiles(
1499        [
1500                'sys/md5.h',
1501                'opencrypto/deflate.h',
1502                'opencrypto/xform.h',
1503                'opencrypto/cryptosoft.h',
1504                'opencrypto/rmd160.h',
1505                'opencrypto/cryptodev.h',
1506                'opencrypto/castsb.h',
1507                'opencrypto/skipjack.h',
1508                'opencrypto/cast.h',
1509        ]
1510)
1511opencrypto.addSourceFiles(
1512        [
1513                'opencrypto/crypto.c',
1514                'opencrypto/deflate.c',
1515                'opencrypto/cryptosoft.c',
1516                'opencrypto/criov.c',
1517                'opencrypto/rmd160.c',
1518                'opencrypto/xform.c',
1519                'opencrypto/skipjack.c',
1520                'opencrypto/cast.c',
1521                'opencrypto/cryptodev.c',
1522        ]
1523)
1524
1525crypto = Module('crypto')
1526crypto.addHeaderFiles(
1527        [
1528                #'crypto/aesni/aesni.h',
1529                'crypto/sha1.h',
1530                'crypto/sha2/sha2.h',
1531                'crypto/rijndael/rijndael.h',
1532                'crypto/rijndael/rijndael_local.h',
1533                'crypto/rijndael/rijndael-api-fst.h',
1534                'crypto/des/des.h',
1535                'crypto/des/spr.h',
1536                'crypto/des/podd.h',
1537                'crypto/des/sk.h',
1538                'crypto/des/des_locl.h',
1539                'crypto/blowfish/bf_pi.h',
1540                'crypto/blowfish/bf_locl.h',
1541                'crypto/blowfish/blowfish.h',
1542                'crypto/rc4/rc4.h',
1543                #'crypto/via/padlock.h',
1544                'crypto/camellia/camellia.h',
1545        ]
1546)
1547crypto.addSourceFiles(
1548        [
1549                #'crypto/aesni/aesni.c',
1550                #'crypto/aesni/aesni_wrap.c',
1551                'crypto/sha1.c',
1552                'crypto/sha2/sha2.c',
1553                'crypto/rijndael/rijndael-alg-fst.c',
1554                'crypto/rijndael/rijndael-api.c',
1555                'crypto/rijndael/rijndael-api-fst.c',
1556                'crypto/des/des_setkey.c',
1557                'crypto/des/des_enc.c',
1558                'crypto/des/des_ecb.c',
1559                'crypto/blowfish/bf_enc.c',
1560                'crypto/blowfish/bf_skey.c',
1561                'crypto/blowfish/bf_ecb.c',
1562                'crypto/rc4/rc4.c',
1563                #'crypto/via/padlock.c',
1564                #'crypto/via/padlock_cipher.c',
1565                #'crypto/via/padlock_hash.c',
1566                'crypto/camellia/camellia-api.c',
1567                'crypto/camellia/camellia.c',
1568        ]
1569)
1570
1571altq = Module('altq')
1572altq.addHeaderFiles(
1573        [
1574                'contrib/altq/altq/altq_rmclass.h',
1575                'contrib/altq/altq/altq_cbq.h',
1576                'contrib/altq/altq/altq_var.h',
1577                'contrib/altq/altq/altqconf.h',
1578                'contrib/altq/altq/altq.h',
1579                'contrib/altq/altq/altq_hfsc.h',
1580                'contrib/altq/altq/altq_red.h',
1581                'contrib/altq/altq/altq_classq.h',
1582                'contrib/altq/altq/altq_priq.h',
1583                'contrib/altq/altq/altq_rmclass_debug.h',
1584                'contrib/altq/altq/altq_cdnr.h',
1585                'contrib/altq/altq/altq_rio.h',
1586                'contrib/altq/altq/if_altq.h',
1587        ]
1588)
1589altq.addSourceFiles(
1590        [
1591                'contrib/altq/altq/altq_rmclass.c',
1592                'contrib/altq/altq/altq_rio.c',
1593                'contrib/altq/altq/altq_subr.c',
1594                'contrib/altq/altq/altq_cdnr.c',
1595                'contrib/altq/altq/altq_priq.c',
1596                'contrib/altq/altq/altq_cbq.c',
1597                'contrib/altq/altq/altq_hfsc.c',
1598                'contrib/altq/altq/altq_red.c',
1599        ]
1600)
1601
1602pf = Module('pf')
1603pf.addHeaderFiles(
1604        [
1605                'contrib/pf/net/pf_mtag.h',
1606                'contrib/pf/net/if_pfsync.h',
1607                'contrib/pf/net/pfvar.h',
1608                'contrib/pf/net/if_pflog.h',
1609        ]
1610)
1611pf.addSourceFiles(
1612        [
1613                'contrib/pf/netinet/in4_cksum.c',
1614                'contrib/pf/net/pf.c',
1615                'contrib/pf/net/if_pflog.c',
1616                'contrib/pf/net/pf_subr.c',
1617                'contrib/pf/net/pf_ioctl.c',
1618                'contrib/pf/net/pf_table.c',
1619                'contrib/pf/net/pf_if.c',
1620                'contrib/pf/net/pf_osfp.c',
1621                'contrib/pf/net/pf_norm.c',
1622                'contrib/pf/net/pf_ruleset.c',
1623                'contrib/pf/net/if_pfsync.c',
1624        ]
1625)
1626
1627mm.addEmptyFiles(
1628        [
1629                'cam/cam_queue.h',
1630                'ddb/db_sym.h',
1631                'ddb/ddb.h',
1632                'machine/cpu.h',
1633                'machine/elf.h',
1634                'machine/sf_buf.h',
1635                #'machine/vmparam.h',
1636                'net/vnet.h',
1637                'security/audit/audit.h',
1638                'security/mac/mac_framework.h',
1639                'sys/bio.h',
1640                'sys/copyright.h',
1641                'sys/cpuset.h',
1642                'sys/errno.h',
1643                'sys/exec.h',
1644                'sys/fail.h',
1645                'sys/limits.h',
1646                'sys/namei.h',
1647                'sys/_pthreadtypes.h',
1648                #'sys/resourcevar.h',
1649                'sys/sbuf.h',
1650                'sys/sched.h',
1651                'sys/select.h',
1652                'sys/syscallsubr.h',
1653                'sys/sysent.h',
1654                'sys/syslimits.h',
1655                'sys/sysproto.h',
1656                'sys/stat.h',
1657                'sys/taskqueue.h',
1658                #'sys/time.h',
1659                'time.h',
1660                'sys/timespec.h',
1661                'sys/_timeval.h',
1662                #'sys/vmmeter.h',
1663                #'sys/vnode.h',
1664                #'vm/pmap.h',
1665                #'vm/uma_int.h',
1666                #'vm/uma_dbg.h',
1667                #'vm/vm_extern.h',
1668                #'vm/vm_map.h',
1669                #'vm/vm_object.h',
1670                #'vm/vm_page.h',
1671                #'vm/vm_pageout.h',
1672                #'vm/vm_param.h',
1673                #'vm/vm_kern.h',
1674                'dev/pci/pcireg.h',
1675                'dev/pci/pcivar.h',
1676                'geom/geom_disk.h',
1677                #'sys/kdb.h',
1678                #'libkern/jenkins.h',
1679                #'machine/pcb.h',
1680                #'net80211/ieee80211_freebsd.h',
1681                'netgraph/ng_ipfw.h',
1682                #'sys/sf_buf.h',
1683        ]
1684)
1685
1686# Register all the Module instances with the Module Manager
1687mm.addModule(netDeps)
1688mm.addModule(net)
1689mm.addModule(netinet)
1690mm.addModule(netinet6)
1691mm.addModule(netipsec)
1692mm.addModule(net80211)
1693mm.addModule(opencrypto)
1694mm.addModule(crypto)
1695mm.addModule(altq)
1696mm.addModule(pf)
1697mm.addModule(devNet)
1698
1699# mm.addModule(rtems)
1700mm.addModule(local)
1701mm.addModule(devUsbBase)
1702mm.addModule(devUsb)
1703mm.addModule(devUsbQuirk)
1704mm.addModule(devUsbController)
1705
1706mm.addModule(cam)
1707mm.addModule(devUsbStorage)
1708
1709#mm.addModule(devUsbNet)
1710
1711# Perform the actual file manipulation
1712if isForward == True:
1713    mm.copyFiles()
1714    mm.createMakefile()
1715else:
1716    mm.revertFiles()
1717
Note: See TracBrowser for help on using the repository browser.