<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 14, 2020 at 9:33 PM <<a href="mailto:chrisj@rtems.org">chrisj@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Chris Johns <<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>><br>
<br>
- Provide support for separate user and kernel include paths in<br>
libbsd.py.<br>
<br>
- Update all added files with a suitable context to build them<br>
with. Supported contexts are `kernel` and `user`.<br>
<br>
- Kernel source use the kernel, CPU, and build header paths in<br>
this order.<br>
<br>
- User source use the user, kernel, CPU and build header paths<br>
in this order. The FreeBSD /usr/include tree has some kernel<br>
header files installed as well as user land header files. This<br>
complicates the separation as some kernel header files are not<br>
visible to user land code while other are. This is handled by<br>
appeanding the kernel header paths to the user header paths so<br></blockquote><div><br></div><div>^^^ appending</div><div><br></div><div>Otherwise, I am just asking does Python code need to pass. pylint</div><div>and yapf are mentioned in this thread but </div><div><a href="https://books.agiliq.com/projects/essential-python-tools/en/latest/linters.html">https://books.agiliq.com/projects/essential-python-tools/en/latest/linters.html</a><br></div><div>has a list of tools and claims that pycodelint matches pep8. I thought we </div><div>were trying to follow pep8. </div><div><br></div><div>It also mentions pyflake which sounds useful.</div><div><br></div><div>What is the recommended set of tools to pass and with what settings?</div><div><br></div><div>I know we aren't completely passing on all Python code but what's the</div><div>objective from a tool checking viewpoint.</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
user land code will include a user header with the same name as<br>
a kernel header over the kernel header but will find a kernel<br>
header if there is no matching user header file.<br>
<br>
Closes #4067<br>
---<br>
builder.py | 339 +++++++++++++++------------<br>
buildset/default.ini | 2 +<br>
freebsd-to-rtems.py | 12 +<br>
libbsd.py | 530 ++++++++++++++++++++++++-------------------<br>
waf_libbsd.py | 165 ++++++++------<br>
wscript | 4 +-<br>
6 files changed, 614 insertions(+), 438 deletions(-)<br>
<br>
diff --git a/builder.py b/builder.py<br>
index 9dfe373f..46e19b6a 100755<br>
--- a/builder.py<br>
+++ b/builder.py<br>
@@ -1,6 +1,6 @@<br>
# SPDX-License-Identifier: BSD-2-Clause<br>
-'''Manage the libbsd build configuration data.<br>
-'''<br>
+"""Manage the libbsd build configuration data.<br>
+"""<br>
<br>
# Copyright (c) 2015, 2020 Chris Johns <<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>>. All rights reserved.<br>
#<br>
@@ -35,15 +35,12 @@<br>
<br>
from __future__ import print_function<br>
<br>
-import shutil<br>
+import codecs<br>
+import copy<br>
+import difflib<br>
import os<br>
import re<br>
import sys<br>
-import getopt<br>
-import filecmp<br>
-import difflib<br>
-import codecs<br>
-import copy<br>
<br>
#<br>
# Global controls.<br>
@@ -67,21 +64,6 @@ verboseMoreDetail = 3<br>
verboseDebug = 4<br>
<br>
<br>
-def _cflagsIncludes(cflags, includes):<br>
- if type(cflags) is not list:<br>
- if cflags is not None:<br>
- _cflags = cflags.split(' ')<br>
- else:<br>
- _cflags = [None]<br>
- else:<br>
- _cflags = cflags<br>
- if type(includes) is not list:<br>
- _includes = [includes]<br>
- else:<br>
- _includes = includes<br>
- return _cflags, _includes<br>
-<br>
-<br>
def verbose(level=verboseInfo):<br>
return verboseLevel >= level<br>
<br>
@@ -527,7 +509,7 @@ class TargetSourceCPUDependentPathComposer(CPUDependentFreeBSDPathComposer):<br>
return path<br>
<br>
<br>
-class BuildSystemFragmentComposer(object):<br>
+class BuildSystemComposer(object):<br>
def __init__(self, includes=None):<br>
if type(includes) is not list:<br>
self.includes = [includes]<br>
@@ -537,7 +519,7 @@ class BuildSystemFragmentComposer(object):<br>
def __str__(self):<br>
return ''<br>
<br>
- def get_includes(self):<br>
+ def getIncludes(self):<br>
if None in self.includes:<br>
incs = []<br>
else:<br>
@@ -545,52 +527,70 @@ class BuildSystemFragmentComposer(object):<br>
return incs<br>
<br>
def compose(self, path):<br>
- return ''<br>
+ """A None result means there is nothing to build."""<br>
+ return None<br>
+<br>
+ @staticmethod<br>
+ def filesAsDefines(files):<br>
+ define_keys = ''<br>
+ for f in files:<br>
+ f = f.upper()<br>
+ for c in '\/-.':<br>
+ f = f.replace(c, '_')<br>
+ define_keys += ' ' + f<br>
+ return define_keys.strip()<br>
+<br>
+ @staticmethod<br>
+ def cflagsIncludes(cflags, includes):<br>
+ if type(cflags) is not list:<br>
+ if cflags is not None:<br>
+ _cflags = cflags.split(' ')<br>
+ else:<br>
+ _cflags = [None]<br>
+ else:<br>
+ _cflags = cflags<br>
+ if type(includes) is not list:<br>
+ _includes = [includes]<br>
+ else:<br>
+ _includes = includes<br>
+ return _cflags, _includes<br>
<br>
<br>
-class SourceFileFragmentComposer(BuildSystemFragmentComposer):<br>
+class SourceFileBuildComposer(BuildSystemComposer):<br>
def __init__(self, cflags="default", includes=None):<br>
- self.cflags, self.includes = _cflagsIncludes(cflags, includes)<br>
-<br>
- def _get_flags(self):<br>
- return self.cflags + self.get_includes()<br>
+ self.cflags, self.includes = self.cflagsIncludes(cflags, includes)<br>
<br>
def __str__(self):<br>
- return 'SF: ' + ' '.join(self._get_flags())<br>
+ return 'SF: ' + ' '.join(self.getFlags())<br>
<br>
def compose(self, path):<br>
- flags = self._get_flags()<br>
- return ['sources', flags,<br>
- ('default', None)], [path], self.cflags, self.includes<br>
+ flags = self.getFlags()<br>
+ return ['sources', flags, ('default', None)], \<br>
+ [path], self.cflags, self.includes<br>
<br>
+ def getFlags(self):<br>
+ return self.cflags + self.getIncludes()<br>
<br>
-class SourceFileIfHeaderComposer(SourceFileFragmentComposer):<br>
+<br>
+class SourceFileIfHeaderComposer(SourceFileBuildComposer):<br>
def __init__(self, headers, cflags="default", includes=None):<br>
if headers is not list:<br>
headers = [headers]<br>
self.headers = headers<br>
super(SourceFileIfHeaderComposer, self).__init__(cflags=cflags,<br>
includes=includes)<br>
+<br>
def __str__(self):<br>
- incs = self.headers + self.get_includes<br>
- if len(incs) > 0:<br>
- return 'SFIH:' + ' '.join(incs)<br>
- else:<br>
- return ''<br>
+ return 'SFIH:' + ' '.join(self.getFlags()) + \<br>
+ ' ' + self.filesAsDefines(self.headers)<br>
<br>
def compose(self, path):<br>
- r = SourceFileFragmentComposer.compose(self, path)<br>
- define_keys = ''<br>
- for h in self.headers:<br>
- h = h.upper()<br>
- for c in '\/-.':<br>
- h = h.replace(c, '_')<br>
- define_keys += ' ' + h<br>
- r[0][2] = (define_keys.strip(), self.headers)<br>
+ r = SourceFileBuildComposer.compose(self, path)<br>
+ r[0][2] = (self.filesAsDefines(self.headers), self.headers)<br>
return r<br>
<br>
<br>
-class TestFragementComposer(BuildSystemFragmentComposer):<br>
+class TestFragementComposer(BuildSystemComposer):<br>
def __init__(self,<br>
testName,<br>
fileFragments,<br>
@@ -638,13 +638,7 @@ class TestIfHeaderComposer(TestFragementComposer):<br>
<br>
def compose(self, path):<br>
r = TestFragementComposer.compose(self, path)<br>
- define_keys = ''<br>
- for h in self.headers:<br>
- h = h.upper()<br>
- for c in '\/-.':<br>
- h = h.replace(c, '_')<br>
- define_keys += ' ' + h<br>
- r[0][2] = (define_keys.strip(), self.headers)<br>
+ r[0][2] = (self.filesAsDefines(self.headers), self.headers)<br>
return r<br>
<br>
<br>
@@ -668,37 +662,33 @@ class TestIfLibraryComposer(TestFragementComposer):<br>
<br>
def compose(self, path):<br>
r = TestFragementComposer.compose(self, path)<br>
- define_keys = ''<br>
- for l in self.libraries:<br>
- l = l.upper()<br>
- for c in '\/-.':<br>
- l = l.replace(c, '_')<br>
- define_keys += ' ' + l<br>
- r[0][2] = (define_keys.strip(), self.libraries)<br>
+ r[0][2] = (self.filesAsDefines(self.libraries), self.libraries)<br>
return r<br>
<br>
<br>
-class KVMSymbolsFragmentComposer(BuildSystemFragmentComposer):<br>
+class KVMSymbolsBuildComposer(BuildSystemComposer):<br>
def compose(self, path):<br>
- return ['KVMSymbols', 'files',<br>
- ('default', None)], [path], self.includes<br>
+ return ['KVMSymbols', 'files', ('default', None)], \<br>
+ [path], self.includes<br>
<br>
<br>
-class RPCGENFragmentComposer(BuildSystemFragmentComposer):<br>
+class RPCGENBuildComposer(BuildSystemComposer):<br>
def compose(self, path):<br>
- return ['RPCGen', 'files', ('default', None)], [path]<br>
+ return ['RPCGen', 'files', ('default', None)], \<br>
+ [path]<br>
<br>
<br>
-class RouteKeywordsFragmentComposer(BuildSystemFragmentComposer):<br>
+class RouteKeywordsBuildComposer(BuildSystemComposer):<br>
def compose(self, path):<br>
- return ['RouteKeywords', 'files', ('default', None)], [path]<br>
+ return ['RouteKeywords', 'files', ('default', None)], \<br>
+ [path]<br>
<br>
<br>
-class LexFragmentComposer(BuildSystemFragmentComposer):<br>
+class LexBuildComposer(BuildSystemComposer):<br>
def __init__(self, sym, dep, cflags=None, includes=None, build=True):<br>
self.sym = sym<br>
self.dep = dep<br>
- self.cflags, self.includes = _cflagsIncludes(cflags, includes)<br>
+ self.cflags, self.includes = self.cflagsIncludes(cflags, includes)<br>
self.build = build<br>
<br>
def compose(self, path):<br>
@@ -715,11 +705,11 @@ class LexFragmentComposer(BuildSystemFragmentComposer):<br>
return ['lex', path, ('default', None)], d<br>
<br>
<br>
-class YaccFragmentComposer(BuildSystemFragmentComposer):<br>
+class YaccBuildComposer(BuildSystemComposer):<br>
def __init__(self, sym, header, cflags=None, includes=None, build=True):<br>
self.sym = sym<br>
self.header = header<br>
- self.cflags, self.includes = _cflagsIncludes(cflags, includes)<br>
+ self.cflags, self.includes = self.cflagsIncludes(cflags, includes)<br>
self.build = build<br>
<br>
def compose(self, path):<br>
@@ -738,14 +728,14 @@ class YaccFragmentComposer(BuildSystemFragmentComposer):<br>
<br>
class File(object):<br>
'''A file of source we move backwards and forwards and build.'''<br>
-<br>
- def __init__(self, path, pathComposer, forwardConverter, reverseConverter,<br>
- buildSystemComposer):<br>
+ def __init__(self, space, path, pathComposer, forwardConverter,<br>
+ reverseConverter, buildSystemComposer):<br>
if verbose(verboseMoreDetail):<br>
- print("FILE: %-50s F:%-45s R:%-45s" % \<br>
- (path,<br>
+ print("FILE: %-6s %-50s F:%-45s R:%-45s" % \<br>
+ (space, path,<br>
forwardConverter.__class__.__name__,<br>
reverseConverter.__class__.__name__))<br>
+ <a href="http://self.space" rel="noreferrer" target="_blank">self.space</a> = space<br>
self.path = path<br>
self.pathComposer = pathComposer<br>
self.originPath = self.pathComposer.composeOriginPath(self.path)<br>
@@ -756,12 +746,22 @@ class File(object):<br>
self.buildSystemComposer = buildSystemComposer<br>
<br>
def __str__(self):<br>
- out = self.path<br>
+ out = <a href="http://self.space" rel="noreferrer" target="_blank">self.space</a>[0].upper() + ' ' + self.path<br>
bsc = str(self.buildSystemComposer)<br>
if len(bsc) > 0:<br>
out += ' (' + bsc + ')'<br>
return out<br>
<br>
+ def __eq__(self, other):<br>
+ state = <a href="http://self.space" rel="noreferrer" target="_blank">self.space</a> == <a href="http://other.space" rel="noreferrer" target="_blank">other.space</a><br>
+ state = state and (self.path == self.path)<br>
+ state = state and (self.pathComposer == self.pathComposer)<br>
+ state = state and (self.originPath == self.originPath)<br>
+ state = state and (self.forwardConverter == self.forwardConverter)<br>
+ state = state and (self.self.reverseConverter == self.self.reverseConverter)<br>
+ state = state and (self.buildSystemComposer == self.buildSystemComposer)<br>
+ return state<br>
+<br>
def processSource(self, forward):<br>
if forward:<br>
if verbose(verboseDetail):<br>
@@ -771,17 +771,23 @@ class File(object):<br>
else:<br>
if verbose(verboseDetail):<br>
print("process source: %s => %s converter:%s" % \<br>
- (self.libbsdPath, self.originPath, self.reverseConverter.__class__.__name__))<br>
+ (self.libbsdPath, self.originPath,<br>
+ self.reverseConverter.__class__.__name__))<br>
self.reverseConverter.convert(self.libbsdPath, self.originPath)<br>
<br>
def getFragment(self):<br>
return self.buildSystemComposer.compose(<br>
self.pathComposer.composeLibBSDPath(self.path, ''))<br>
<br>
+ def getPath(self):<br>
+ return self.path<br>
+<br>
+ def getSpace(self):<br>
+ return <a href="http://self.space" rel="noreferrer" target="_blank">self.space</a><br>
+<br>
<br>
class Module(object):<br>
'''Logical group of related files we can perform actions on'''<br>
-<br>
def __init__(self, manager, name, enabled=True):<br>
self.manager = manager<br>
<a href="http://self.name" rel="noreferrer" target="_blank">self.name</a> = name<br>
@@ -791,23 +797,42 @@ class Module(object):<br>
self.dependencies = []<br>
<br>
def __str__(self):<br>
- out = [<a href="http://self.name" rel="noreferrer" target="_blank">self.name</a> + ': ' + self.conditionalOn]<br>
+ out = [<a href="http://self.name" rel="noreferrer" target="_blank">self.name</a> + ': conditional-on=' + self.conditionalOn]<br>
if len(self.dependencies) > 0:<br>
out += [' Deps: ' + str(len(self.dependencies))]<br>
out += [' ' + type(d).__name__ for d in self.dependencies]<br>
if len(self.files) > 0:<br>
- out += [' Files: ' + str(len(self.files))]<br>
+ counts = {}<br>
+ for f in self.files:<br>
+ space = f.getSpace()<br>
+ if space not in counts:<br>
+ counts[space] = 0<br>
+ counts[space] += 1<br>
+ count_str = ''<br>
+ for space in sorted(counts.keys()):<br>
+ count_str += '%s:%d ' % (space[0].upper(), counts[space])<br>
+ count_str = count_str[:-1]<br>
+ out += [' Files: %d (%s)' % (len(self.files), count_str)]<br>
out += [' ' + str(f) for f in self.files]<br>
if len(self.cpuDependentSourceFiles) > 0:<br>
out += [' CPU Dep: ' + str(len(self.cpuDependentSourceFiles))]<br>
for cpu in self.cpuDependentSourceFiles:<br>
- out += [' ' + cpu + ':' + str(f) for f in self.cpuDependentSourceFiles[cpu]]<br>
+ out += [' ' + cpu + ':']<br>
+ out += [<br>
+ ' ' + str(f) for f in self.cpuDependentSourceFiles[cpu]<br>
+ ]<br>
return os.linesep.join(out)<br>
<br>
def initCPUDependencies(self, cpu):<br>
if cpu not in self.cpuDependentSourceFiles:<br>
self.cpuDependentSourceFiles[cpu] = []<br>
<br>
+ def getName(self):<br>
+ return <a href="http://self.name" rel="noreferrer" target="_blank">self.name</a><br>
+<br>
+ def getFiles(self):<br>
+ return (f for f in self.files)<br>
+<br>
def processSource(self, direction):<br>
if verbose(verboseDetail):<br>
print("process module: %s" % (<a href="http://self.name" rel="noreferrer" target="_blank">self.name</a>))<br>
@@ -818,52 +843,64 @@ class Module(object):<br>
f.processSource(direction)<br>
<br>
def addFile(self, f):<br>
+ if not isinstance(f, File):<br>
+ raise TypeError('invalid type for addFiles: %s' % (type(f)))<br>
self.files += [f]<br>
<br>
def addFiles(self,<br>
+ space,<br>
newFiles,<br>
pathComposer,<br>
forwardConverter,<br>
reverseConverter,<br>
assertFile,<br>
- buildSystemComposer=BuildSystemFragmentComposer()):<br>
+ buildSystemComposer=BuildSystemComposer()):<br>
files = []<br>
for newFile in newFiles:<br>
assertFile(newFile)<br>
files += [<br>
- File(newFile, pathComposer, forwardConverter, reverseConverter,<br>
- buildSystemComposer)<br>
+ File(space, newFile, pathComposer, forwardConverter,<br>
+ reverseConverter, buildSystemComposer)<br>
]<br>
return files<br>
<br>
+ def addPlainTextFile(self, files):<br>
+ self.files += self.addFiles('user', files,<br>
+ FreeBSDPathComposer(), Converter(),<br>
+ Converter(), assertNothing)<br>
+<br>
def addKernelSpaceHeaderFiles(self, files):<br>
- self.files += self.addFiles(files, FreeBSDPathComposer(),<br>
+ self.files += self.addFiles('kernel', files, FreeBSDPathComposer(),<br>
FromFreeBSDToRTEMSHeaderConverter(),<br>
FromRTEMSToFreeBSDHeaderConverter(),<br>
assertHeaderOrSourceFile)<br>
<br>
def addUserSpaceHeaderFiles(self, files):<br>
self.files += self.addFiles(<br>
- files, FreeBSDPathComposer(),<br>
+ 'user', files, FreeBSDPathComposer(),<br>
FromFreeBSDToRTEMSUserSpaceHeaderConverter(),<br>
FromRTEMSToFreeBSDHeaderConverter(), assertHeaderFile)<br>
<br>
def addRTEMSHeaderFiles(self, files):<br>
- self.files += self.addFiles(files, RTEMSPathComposer(), NoConverter(),<br>
- NoConverter(), assertHeaderFile)<br>
+ self.files += self.addFiles('user', files, RTEMSPathComposer(),<br>
+ NoConverter(), NoConverter(),<br>
+ assertHeaderFile)<br>
<br>
def addLinuxHeaderFiles(self, files):<br>
- self.files += self.addFiles(files, PathComposer(), NoConverter(),<br>
- NoConverter(), assertHeaderFile)<br>
+ self.files += self.addFiles('kernel', files, PathComposer(),<br>
+ NoConverter(), NoConverter(),<br>
+ assertHeaderFile)<br>
<br>
def addCPUDependentFreeBSDHeaderFiles(self, files):<br>
- self.files += self.addFiles(files, CPUDependentFreeBSDPathComposer(),<br>
+ self.files += self.addFiles('kernel', files,<br>
+ CPUDependentFreeBSDPathComposer(),<br>
FromFreeBSDToRTEMSHeaderConverter(),<br>
FromRTEMSToFreeBSDHeaderConverter(),<br>
assertHeaderFile)<br>
<br>
def addCPUDependentLinuxHeaderFiles(self, files):<br>
- self.files += self.addFiles(files, CPUDependentLinuxPathComposer(),<br>
+ self.files += self.addFiles('kernel', files,<br>
+ CPUDependentLinuxPathComposer(),<br>
NoConverter(), NoConverter(),<br>
assertHeaderFile)<br>
<br>
@@ -871,73 +908,80 @@ class Module(object):<br>
files):<br>
for cpu in targetCPUs:<br>
self.files += self.addFiles(<br>
- files, TargetSourceCPUDependentPathComposer(cpu, sourceCPU),<br>
+ 'kernel', files,<br>
+ TargetSourceCPUDependentPathComposer(cpu, sourceCPU),<br>
FromFreeBSDToRTEMSHeaderConverter(), NoConverter(),<br>
assertHeaderFile)<br>
<br>
- def addSourceFiles(self, files, sourceFileFragmentComposer):<br>
- self.files += self.addFiles(files, PathComposer(), NoConverter(),<br>
+ def addSourceFiles(self, files, sourceFileBuildComposer):<br>
+ self.files += self.addFiles('user',<br>
+ files, PathComposer(), NoConverter(),<br>
NoConverter(), assertSourceFile,<br>
- sourceFileFragmentComposer)<br>
+ sourceFileBuildComposer)<br>
<br>
- def addKernelSpaceSourceFiles(self, files, sourceFileFragmentComposer):<br>
- self.files += self.addFiles(files, FreeBSDPathComposer(),<br>
+ def addKernelSpaceSourceFiles(self, files, sourceFileBuildComposer):<br>
+ self.files += self.addFiles('kernel', files, FreeBSDPathComposer(),<br>
FromFreeBSDToRTEMSSourceConverter(),<br>
FromRTEMSToFreeBSDSourceConverter(),<br>
- assertSourceFile,<br>
- sourceFileFragmentComposer)<br>
+ assertSourceFile, sourceFileBuildComposer)<br>
<br>
- def addUserSpaceSourceFiles(self, files, sourceFileFragmentComposer):<br>
+ def addUserSpaceSourceFiles(self, files, sourceFileBuildComposer):<br>
self.files += self.addFiles(<br>
- files, FreeBSDPathComposer(),<br>
+ 'user', files, FreeBSDPathComposer(),<br>
FromFreeBSDToRTEMSUserSpaceSourceConverter(),<br>
FromRTEMSToFreeBSDSourceConverter(), assertSourceFile,<br>
- sourceFileFragmentComposer)<br>
+ sourceFileBuildComposer)<br>
<br>
- def addRTEMSSourceFiles(self, files, sourceFileFragmentComposer):<br>
- self.files += self.addFiles(files, RTEMSPathComposer(), NoConverter(),<br>
- NoConverter(), assertSourceFile,<br>
- sourceFileFragmentComposer)<br>
+ def addRTEMSKernelSourceFiles(self, files, sourceFileBuildComposer):<br>
+ self.files += self.addFiles('kernel', files, RTEMSPathComposer(),<br>
+ NoConverter(), NoConverter(),<br>
+ assertSourceFile, sourceFileBuildComposer)<br>
<br>
- def addLinuxSourceFiles(self, files, sourceFileFragmentComposer):<br>
- self.files += self.addFiles(files, PathComposer(), NoConverter(),<br>
- NoConverter(), assertSourceFile,<br>
- sourceFileFragmentComposer)<br>
+ def addRTEMSUserSourceFiles(self, files, sourceFileBuildComposer):<br>
+ self.files += self.addFiles('user', files, RTEMSPathComposer(),<br>
+ NoConverter(), NoConverter(),<br>
+ assertSourceFile, sourceFileBuildComposer)<br>
+<br>
+ def addLinuxSourceFiles(self, files, sourceFileBuildComposer):<br>
+ self.files += self.addFiles('kernel', files, PathComposer(),<br>
+ NoConverter(), NoConverter(),<br>
+ assertSourceFile, sourceFileBuildComposer)<br>
<br>
def addCPUDependentFreeBSDSourceFiles(self, cpus, files,<br>
- sourceFileFragmentComposer):<br>
+ sourceFileBuildComposer):<br>
for cpu in cpus:<br>
self.initCPUDependencies(cpu)<br>
self.cpuDependentSourceFiles[cpu] += \<br>
- self.addFiles(files,<br>
- CPUDependentFreeBSDPathComposer(), FromFreeBSDToRTEMSSourceConverter(),<br>
- FromRTEMSToFreeBSDSourceConverter(), assertSourceFile,<br>
- sourceFileFragmentComposer)<br>
+ self.addFiles(<br>
+ 'kernel', files,<br>
+ CPUDependentFreeBSDPathComposer(), FromFreeBSDToRTEMSSourceConverter(),<br>
+ FromRTEMSToFreeBSDSourceConverter(), assertSourceFile,<br>
+ sourceFileBuildComposer)<br>
<br>
def addCPUDependentRTEMSSourceFiles(self, cpus, files,<br>
- sourceFileFragmentComposer):<br>
+ sourceFileBuildComposer):<br>
for cpu in cpus:<br>
self.initCPUDependencies(cpu)<br>
self.cpuDependentSourceFiles[cpu] += \<br>
- self.addFiles(files,<br>
+ self.addFiles('kernel', files,<br>
CPUDependentRTEMSPathComposer(), NoConverter(),<br>
NoConverter(), assertSourceFile,<br>
- sourceFileFragmentComposer)<br>
+ sourceFileBuildComposer)<br>
<br>
def addCPUDependentLinuxSourceFiles(self, cpus, files,<br>
- sourceFileFragmentComposer):<br>
+ sourceFileBuildComposer):<br>
for cpu in cpus:<br>
self.initCPUDependencies(cpu)<br>
self.cpuDependentSourceFiles[cpu] += \<br>
- self.addFiles(files,<br>
+ self.addFiles('kernel', files,<br>
CPUDependentLinuxPathComposer(), NoConverter(),<br>
NoConverter(), assertSourceFile,<br>
- sourceFileFragmentComposer)<br>
+ sourceFileBuildComposer)<br>
<br>
def addTest(self, testFragementComposer):<br>
self.files += [<br>
- File(testFragementComposer.testName, PathComposer(), NoConverter(),<br>
- NoConverter(), testFragementComposer)<br>
+ File('user', testFragementComposer.testName, PathComposer(),<br>
+ NoConverter(), NoConverter(), testFragementComposer)<br>
]<br>
<br>
def addDependency(self, dep):<br>
@@ -946,7 +990,6 @@ class Module(object):<br>
<br>
class ModuleManager(object):<br>
'''A manager for a collection of modules.'''<br>
-<br>
def __init__(self):<br>
self.modules = {}<br>
self.generator = {}<br>
@@ -987,7 +1030,7 @@ class ModuleManager(object):<br>
self.configuration = copy.deepcopy(config)<br>
<br>
def getConfiguration(self):<br>
- return self.configuration<br>
+ return copy.deepcopy(self.configuration)<br>
<br>
def updateConfiguration(self, config):<br>
self.configuration.update(config)<br>
@@ -1004,17 +1047,33 @@ class ModuleManager(object):<br>
if only_enabled == False:<br>
modules_to_process = self.getAllModules()<br>
for m in modules_to_process:<br>
+ if m not in self.modules:<br>
+ raise KeyError('enabled module not registered: %s' % (m))<br>
self.modules[m].generate()<br>
<br>
+ def duplicateCheck(self):<br>
+ dups = []<br>
+ modules_to_check = sorted(self.getAllModules(), reverse=True)<br>
+ while len(modules_to_check) > 1:<br>
+ mod = modules_to_check.pop()<br>
+ for m in modules_to_check:<br>
+ if m not in self.modules:<br>
+ raise KeyError('enabled module not registered: %s' % (m))<br>
+ for fmod in self.modules[mod].getFiles():<br>
+ for fm in self.modules[m].getFiles():<br>
+ if fmod.getPath() == fm.getPath():<br>
+ dups += [(m, mod, fm.getPath(), fm.getSpace())]<br>
+ return dups<br>
+<br>
def setGenerators(self):<br>
self.generator['convert'] = Converter<br>
self.generator['no-convert'] = NoConverter<br>
self.generator[<br>
- 'from-FreeBSD-to-RTEMS-UserSpaceSourceConverter'] = FromFreeBSDToRTEMSUserSpaceSourceConverter<br>
+ 'from-FreeBSD-to-RTEMS-UserSpaceSourceConverter'] = \<br>
+ FromFreeBSDToRTEMSUserSpaceSourceConverter<br>
self.generator[<br>
'from-RTEMS-To-FreeBSD-SourceConverter'] = FromRTEMSToFreeBSDSourceConverter<br>
- self.generator[<br>
- 'buildSystemFragmentComposer'] = BuildSystemFragmentComposer<br>
+ self.generator['buildSystemComposer'] = BuildSystemComposer<br>
<br>
self.generator['file'] = File<br>
<br>
@@ -1025,13 +1084,13 @@ class ModuleManager(object):<br>
self.generator[<br>
'target-src-cpu--path'] = TargetSourceCPUDependentPathComposer<br>
<br>
- self.generator['source'] = SourceFileFragmentComposer<br>
+ self.generator['source'] = SourceFileBuildComposer<br>
self.generator['test'] = TestFragementComposer<br>
- self.generator['kvm-symbols'] = KVMSymbolsFragmentComposer<br>
- self.generator['rpc-gen'] = RPCGENFragmentComposer<br>
- self.generator['route-keywords'] = RouteKeywordsFragmentComposer<br>
- self.generator['lex'] = LexFragmentComposer<br>
- self.generator['yacc'] = YaccFragmentComposer<br>
+ self.generator['kvm-symbols'] = KVMSymbolsBuildComposer<br>
+ self.generator['rpc-gen'] = RPCGENBuildComposer<br>
+ self.generator['route-keywords'] = RouteKeywordsBuildComposer<br>
+ self.generator['lex'] = LexBuildComposer<br>
+ self.generator['yacc'] = YaccBuildComposer<br>
<br>
self.generator['source-if-header'] = SourceFileIfHeaderComposer<br>
self.generator['test-if-header'] = TestIfHeaderComposer<br>
diff --git a/buildset/default.ini b/buildset/default.ini<br>
index b17f2b59..9c0d1bf8 100644<br>
--- a/buildset/default.ini<br>
+++ b/buildset/default.ini<br>
@@ -50,11 +50,13 @@ net80211 = off<br>
netinet = on<br>
netinet6 = on<br>
netipsec = off<br>
+nfsv2 = on<br>
nvme = on<br>
opencrypto = on<br>
pci = on<br>
pf = on<br>
regulator = on<br>
+rpc_user = on<br>
rtems = on<br>
tests = on<br>
tty = on<br>
diff --git a/freebsd-to-rtems.py b/freebsd-to-rtems.py<br>
index 5710b902..8f66e589 100755<br>
--- a/freebsd-to-rtems.py<br>
+++ b/freebsd-to-rtems.py<br>
@@ -152,6 +152,18 @@ try:<br>
libbsd.load(build)<br>
build.generateBuild(only_enabled=False)<br>
<br>
+ dups = build.duplicateCheck()<br>
+ if len(dups) > 0:<br>
+ print()<br>
+ print('Duplicates: %d' % (len(dups)))<br>
+ mods = list(set([dup[0] for dup in dups]))<br>
+ max_mod_len = max(len(dup[1]) for dup in dups)<br>
+ for mod in mods:<br>
+ print(' %s:' % (mod))<br>
+ for dup in [dup for dup in dups if dup[0] == mod]:<br>
+ print(' %-*s %s %s' % (max_mod_len, dup[1], dup[3][0].upper(), dup[2]))<br>
+ print()<br>
+<br>
if isConfig:<br>
print()<br>
print(build)<br>
diff --git a/libbsd.py b/libbsd.py<br>
index c251fba4..5b7e8a88 100644<br>
--- a/libbsd.py<br>
+++ b/libbsd.py<br>
@@ -1,5 +1,5 @@<br>
#<br>
-# Copyright (c) 2015-2016, 2018 Chris Johns <<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>>.<br>
+# Copyright (c) 2015, 2020 Chris Johns <<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>>.<br>
# All rights reserved.<br>
#<br>
# Copyright (c) 2009, 2018 embedded brains GmbH. All rights reserved.<br>
@@ -56,51 +56,56 @@ _defaults = {<br>
#<br>
# Includes<br>
#<br>
- 'include-paths': ['rtemsbsd/include',<br>
- 'freebsd/sys',<br>
- 'freebsd/sys/contrib/ck/include',<br>
- 'freebsd/sys/contrib/libsodium/src/libsodium/include',<br>
- 'freebsd/sys/contrib/libsodium/src/libsodium/include/sodium',<br>
- 'freebsd/sys/contrib/pf',<br>
- 'freebsd/crypto',<br>
- 'freebsd/crypto/openssl/include',<br>
- 'freebsd/sys/net',<br>
- 'freebsd/include',<br>
- 'freebsd/lib',<br>
- 'freebsd/lib/libbsdstat',<br>
- 'freebsd/lib/libcapsicum',<br>
- 'freebsd/lib/libcasper',<br>
- 'freebsd/lib/libc/include',<br>
- 'freebsd/lib/libc/isc/include',<br>
- 'freebsd/lib/libc/resolv',<br>
- 'freebsd/lib/libutil',<br>
- 'freebsd/lib/libkvm',<br>
- 'freebsd/lib/libmemstat',<br>
- 'freebsd/contrib/expat/lib',<br>
- 'freebsd/contrib/libpcap',<br>
- 'freebsd/contrib/libxo',<br>
- 'ipsec-tools/src/libipsec',<br>
- 'linux/include',<br>
- 'linux/drivers/net/ethernet/freescale/fman',<br>
- 'rtemsbsd/sys',<br>
- 'mDNSResponder/mDNSCore',<br>
- 'mDNSResponder/mDNSShared',<br>
- 'mDNSResponder/mDNSPosix',<br>
- 'testsuite/include'],<br>
- 'cpu-include-paths': ['rtemsbsd/@CPU@/include',<br>
- 'freebsd/sys/@CPU@/include'],<br>
+ 'include-paths': {<br>
+ # The path where headers will be copied during the build.<br>
+ 'build': ['build-include'],<br>
+ # Kernel header paths<br>
+ 'kernel': ['rtemsbsd/include',<br>
+ 'freebsd/sys',<br>
+ 'freebsd/sys/contrib/ck/include',<br>
+ 'freebsd/sys/contrib/libsodium/src/libsodium/include',<br>
+ 'freebsd/sys/contrib/libsodium/src/libsodium/include/sodium',<br>
+ 'freebsd/sys/contrib/pf',<br>
+ 'freebsd/sys/net',<br>
+ 'ipsec-tools/src/libipsec',<br>
+ 'linux/include',<br>
+ 'linux/drivers/net/ethernet/freescale/fman',<br>
+ 'rtemsbsd/sys'],<br>
+ # User header paths<br>
+ 'user': ['freebsd/crypto',<br>
+ 'freebsd/crypto/openssl/include',<br>
+ 'freebsd/include',<br>
+ 'freebsd/lib',<br>
+ 'freebsd/lib/libbsdstat',<br>
+ 'freebsd/lib/libcapsicum',<br>
+ 'freebsd/lib/libcasper',<br>
+ 'freebsd/lib/libc/include',<br>
+ 'freebsd/lib/libc/isc/include',<br>
+ 'freebsd/lib/libc/resolv',<br>
+ 'freebsd/lib/libutil',<br>
+ 'freebsd/lib/libkvm',<br>
+ 'freebsd/lib/libmemstat',<br>
+ 'freebsd/contrib/expat/lib',<br>
+ 'freebsd/contrib/libpcap',<br>
+ 'freebsd/contrib/libxo',<br>
+ 'mDNSResponder/mDNSCore',<br>
+ 'mDNSResponder/mDNSShared',<br>
+ 'mDNSResponder/mDNSPosix',<br>
+ 'testsuite/include'],<br>
+ # CPU specific path, assumed to be in the kernel context<br>
+ 'cpu': ['rtemsbsd/@CPU@/include',<br>
+ 'freebsd/sys/@CPU@/include'],<br>
+ },<br>
<br>
#<br>
# Map paths based on RTEMS naming to FreeBSD naming.<br>
#<br>
- 'path-mappings': [ # (source, targets)<br>
- # i386<br>
- ('freebsd/sys/i386/include', ['freebsd/sys/x86/include', 'freebsd/sys/i386/include']),<br>
+ 'path-mappings': [<br>
+ # (source, [targets..])<br>
+ # i386<br>
+ ('freebsd/sys/i386/include', ['freebsd/sys/x86/include', 'freebsd/sys/i386/include']),<br>
],<br>
<br>
- # The path where headers will be copied during build.<br>
- 'build-include-path': ['build-include'],<br>
-<br>
#<br>
# Install headers<br>
#<br>
@@ -152,7 +157,7 @@ class rtems(builder.Module):<br>
<br>
def generate(self):<br>
mm = self.manager<br>
- self.addRTEMSSourceFiles(<br>
+ self.addRTEMSKernelSourceFiles(<br>
[<br>
'local/bus_if.c',<br>
'local/cryptodev_if.c',<br>
@@ -168,35 +173,11 @@ class rtems(builder.Module):<br>
'local/mmcbr_if.c',<br>
'local/if_dwc_if.c',<br>
'local/gpio_if.c',<br>
- 'rtems/ipsec_get_policylen.c',<br>
- 'rtems/rtems-bsd-arp-processor.c',<br>
'rtems/rtems-bsd-allocator-domain-size.c',<br>
- 'rtems/rtems-bsd-cxx.cc',<br>
'rtems/rtems-bsd-get-allocator-domain-size.c',<br>
- 'rtems/rtems-bsd-get-ethernet-addr.c',<br>
'rtems/rtems-bsd-get-mac-address.c',<br>
'rtems/rtems-bsd-get-task-priority.c',<br>
'rtems/rtems-bsd-get-task-stack-size.c',<br>
- 'rtems/rtems-bsd-ifconfig.c',<br>
- 'rtems/rtems-bsd-ifconfig-lo0.c',<br>
- 'rtems/rtems-bsd-init-dhcp.c',<br>
- 'rtems/rtems-bsd-rc-conf-net.c',<br>
- 'rtems/rtems-bsd-rc-conf-pf.c',<br>
- 'rtems/rtems-bsd-rc-conf.c',<br>
- 'rtems/rtems-bsd-set-if-input.c',<br>
- 'rtems/rtems-bsd-shell-arp.c',<br>
- 'rtems/rtems-bsd-shell-ifconfig.c',<br>
- 'rtems/rtems-bsd-shell-ifmcstat.c',<br>
- 'rtems/rtems-bsd-shell-netstat.c',<br>
- 'rtems/rtems-bsd-shell-nvmecontrol.c',<br>
- 'rtems/rtems-bsd-shell-pfctl.c',<br>
- 'rtems/rtems-bsd-shell-ping.c',<br>
- 'rtems/rtems-bsd-shell-route.c',<br>
- 'rtems/rtems-bsd-shell-stty.c',<br>
- 'rtems/rtems-bsd-shell-sysctl.c',<br>
- 'rtems/rtems-bsd-shell-tcpdump.c',<br>
- 'rtems/rtems-bsd-shell-vmstat.c',<br>
- 'rtems/rtems-bsd-shell-wlanstats.c',<br>
'rtems/rtems-bsd-syscall-api.c',<br>
'rtems/rtems-kernel-assert.c',<br>
'rtems/rtems-kernel-autoconf.c',<br>
@@ -235,16 +216,59 @@ class rtems(builder.Module):<br>
'rtems/rtems-legacy-rtrequest.c',<br>
'rtems/rtems-legacy-newproc.c',<br>
'rtems/rtems-legacy-mii.c',<br>
+ 'sys/arm/lpc/if_lpe.c',<br>
+ 'sys/arm/lpc/lpc_pwr.c',<br>
+ 'sys/dev/atsam/if_atsam.c',<br>
+ 'sys/dev/atsam/if_atsam_media.c',<br>
+ 'sys/dev/dw_mmc/dw_mmc.c',<br>
+ 'sys/dev/ffec/if_ffec_mcf548x.c',<br>
+ 'sys/dev/ffec/if_ffec_mpc8xx.c',<br>
+ 'sys/dev/input/touchscreen/tsc_lpc32xx.c',<br>
+ 'sys/dev/smc/if_smc_nexus.c',<br>
+ 'sys/dev/tsec/if_tsec_nexus.c',<br>
+ 'sys/dev/usb/controller/ehci_mpc83xx.c',<br>
+ 'sys/dev/usb/controller/ohci_lpc32xx.c',<br>
+ 'sys/dev/usb/controller/ohci_lpc.c',<br>
+ 'sys/dev/usb/controller/usb_otg_transceiver.c',<br>
+ 'sys/dev/usb/controller/usb_otg_transceiver_dump.c',<br>
+ 'sys/fs/devfs/devfs_devs.c',<br>
+ 'sys/net/if_ppp.c',<br>
+ 'sys/net/ppp_tty.c',<br>
+ ],<br>
+ mm.generator['source']()<br>
+ )<br>
+ self.addRTEMSUserSourceFiles(<br>
+ [<br>
+ 'rtems/ipsec_get_policylen.c',<br>
+ 'rtems/rtems-bsd-arp-processor.c',<br>
+ 'rtems/rtems-bsd-cxx.cc',<br>
+ 'rtems/rtems-bsd-get-ethernet-addr.c',<br>
+ 'rtems/rtems-bsd-ifconfig.c',<br>
+ 'rtems/rtems-bsd-ifconfig-lo0.c',<br>
+ 'rtems/rtems-bsd-init-dhcp.c',<br>
+ 'rtems/rtems-bsd-rc-conf-net.c',<br>
+ 'rtems/rtems-bsd-rc-conf-pf.c',<br>
+ 'rtems/rtems-bsd-rc-conf.c',<br>
+ 'rtems/rtems-bsd-set-if-input.c',<br>
+ 'rtems/rtems-bsd-shell-arp.c',<br>
+ 'rtems/rtems-bsd-shell-ifconfig.c',<br>
+ 'rtems/rtems-bsd-shell-ifmcstat.c',<br>
+ 'rtems/rtems-bsd-shell-netstat.c',<br>
+ 'rtems/rtems-bsd-shell-nvmecontrol.c',<br>
+ 'rtems/rtems-bsd-shell-pfctl.c',<br>
+ 'rtems/rtems-bsd-shell-ping.c',<br>
+ 'rtems/rtems-bsd-shell-route.c',<br>
+ 'rtems/rtems-bsd-shell-stty.c',<br>
+ 'rtems/rtems-bsd-shell-sysctl.c',<br>
+ 'rtems/rtems-bsd-shell-tcpdump.c',<br>
+ 'rtems/rtems-bsd-shell-vmstat.c',<br>
+ 'rtems/rtems-bsd-shell-wlanstats.c',<br>
'rtems/rtems-kvm.c',<br>
'rtems/rtems-program.c',<br>
'rtems/rtems-program-socket.c',<br>
'rtems/rtems-routes.c',<br>
'rtems/syslog.c',<br>
'ftpd/ftpd-service.c',<br>
- 'nfsclient/mount_prot_xdr.c',<br>
- 'nfsclient/nfs.c',<br>
- 'nfsclient/nfs_prot_xdr.c',<br>
- 'nfsclient/rpcio.c',<br>
'pppd/auth.c',<br>
'pppd/ccp.c',<br>
'pppd/chap.c',<br>
@@ -261,39 +285,24 @@ class rtems(builder.Module):<br>
'pppd/sys-rtems.c',<br>
'pppd/upap.c',<br>
'pppd/utils.c',<br>
- 'sys/arm/lpc/if_lpe.c',<br>
- 'sys/arm/lpc/lpc_pwr.c',<br>
- 'sys/dev/atsam/if_atsam.c',<br>
- 'sys/dev/atsam/if_atsam_media.c',<br>
- 'sys/dev/dw_mmc/dw_mmc.c',<br>
- 'sys/dev/ffec/if_ffec_mcf548x.c',<br>
- 'sys/dev/ffec/if_ffec_mpc8xx.c',<br>
- 'sys/dev/input/touchscreen/tsc_lpc32xx.c',<br>
- 'sys/dev/smc/if_smc_nexus.c',<br>
- 'sys/dev/tsec/if_tsec_nexus.c',<br>
- 'sys/dev/usb/controller/ehci_mpc83xx.c',<br>
- 'sys/dev/usb/controller/ohci_lpc32xx.c',<br>
- 'sys/dev/usb/controller/ohci_lpc.c',<br>
- 'sys/dev/usb/controller/usb_otg_transceiver.c',<br>
- 'sys/dev/usb/controller/usb_otg_transceiver_dump.c',<br>
- 'sys/fs/devfs/devfs_devs.c',<br>
- 'sys/net/if_ppp.c',<br>
- 'sys/net/ppp_tty.c',<br>
'telnetd/telnetd-service.c',<br>
],<br>
mm.generator['source']()<br>
)<br>
- self.addFile(mm.generator['file']('rtems/rtems-kernel-kvm-symbols.c',<br>
+ self.addFile(mm.generator['file']('kernel',<br>
+ 'rtems/rtems-kernel-kvm-symbols.c',<br>
mm.generator['rtems-path'](),<br>
mm.generator['no-convert'](),<br>
mm.generator['no-convert'](),<br>
mm.generator['kvm-symbols'](includes = 'rtemsbsd/rtems')))<br>
- self.addFile(mm.generator['file']('lib/libc/net/nslexer.l',<br>
+ self.addFile(mm.generator['file']('user',<br>
+ 'lib/libc/net/nslexer.l',<br>
mm.generator['freebsd-path'](),<br>
mm.generator['convert'](),<br>
mm.generator['convert'](),<br>
mm.generator['lex']('_nsyy', 'nsparser.c')))<br>
- self.addFile(mm.generator['file']('lib/libc/net/nsparser.y',<br>
+ self.addFile(mm.generator['file']('user',<br>
+ 'lib/libc/net/nsparser.y',<br>
mm.generator['freebsd-path'](),<br>
mm.generator['convert'](),<br>
mm.generator['convert'](),<br>
@@ -344,8 +353,6 @@ class base(builder.Module):<br>
'sys/contrib/ck/include/gcc/x86/ck_f_pr.h',<br>
'sys/contrib/ck/include/gcc/x86/ck_pr.h',<br>
'sys/fs/devfs/devfs_int.h',<br>
- 'sys/rpc/netconfig.h',<br>
- 'sys/rpc/types.h',<br>
'sys/security/audit/audit.h',<br>
'sys/security/mac/mac_framework.h',<br>
'sys/sys/acl.h',<br>
@@ -569,7 +576,7 @@ class fdt(builder.Module):<br>
],<br>
mm.generator['source']()<br>
)<br>
- self.addRTEMSSourceFiles(<br>
+ self.addRTEMSKernelSourceFiles(<br>
[<br>
'rtems/ofw_machdep.c',<br>
],<br>
@@ -606,7 +613,7 @@ class tty(builder.Module):<br>
],<br>
mm.generator['source']()<br>
)<br>
-# self.addRTEMSSourceFiles(<br>
+# self.addRTEMSKernelSourceFiles(<br>
# [<br>
# 'rtems/ofw_machdep.c',<br>
# ],<br>
@@ -643,7 +650,7 @@ class mmc(builder.Module):<br>
],<br>
mm.generator['source']()<br>
)<br>
- self.addRTEMSSourceFiles(<br>
+ self.addRTEMSKernelSourceFiles(<br>
[<br>
'sys/arm/at91/at91_mci.c',<br>
],<br>
@@ -682,7 +689,7 @@ class mmc_ti(builder.Module):<br>
],<br>
mm.generator['source']()<br>
)<br>
- self.addRTEMSSourceFiles(<br>
+ self.addRTEMSKernelSourceFiles(<br>
[<br>
'local/sdhci_if.c',<br>
'local/gpiobus_if.c',<br>
@@ -1082,7 +1089,7 @@ class dev_usb_wlan(builder.Module):<br>
'sys/dev/usb/wlan/if_zydreg.h',<br>
]<br>
)<br>
- self.addRTEMSSourceFiles(<br>
+ self.addRTEMSKernelSourceFiles(<br>
[<br>
'local/runfw.c',<br>
],<br>
@@ -1194,7 +1201,7 @@ class dev_wlan_rtwn(builder.Module):<br>
'sys/dev/rtwn/usb/rtwn_usb_var.h',<br>
]<br>
)<br>
- self.addRTEMSSourceFiles(<br>
+ self.addRTEMSKernelSourceFiles(<br>
[<br>
'local/rtwn-rtl8192cfwT.c',<br>
'local/rtwn-rtl8188eufw.c',<br>
@@ -1403,7 +1410,7 @@ class dev_net(builder.Module):<br>
],<br>
mm.generator['source']()<br>
)<br>
- self.addRTEMSSourceFiles(<br>
+ self.addRTEMSKernelSourceFiles(<br>
[<br>
'sys/dev/mii/ksz8091rnb_50MHz.c',<br>
],<br>
@@ -1697,7 +1704,7 @@ class nvme(builder.Module):<br>
],<br>
mm.generator['source']()<br>
)<br>
- self.addRTEMSSourceFiles(<br>
+ self.addRTEMSKernelSourceFiles(<br>
[<br>
'sys/dev/nvd/nvd.c',<br>
],<br>
@@ -2105,14 +2112,16 @@ class netipsec(builder.Module):<br>
],<br>
mm.generator['source'](libipsec_cflags)<br>
)<br>
- self.addFile(mm.generator['file']('ipsec-tools/src/libipsec/policy_token.l',<br>
+ self.addFile(mm.generator['file']('user',<br>
+ 'ipsec-tools/src/libipsec/policy_token.l',<br>
mm.generator['path'](),<br>
mm.generator['convert'](),<br>
mm.generator['convert'](),<br>
mm.generator['lex']('__libipsec',<br>
'policy_parse.c',<br>
libipsec_cflags)))<br>
- self.addFile(mm.generator['file']('ipsec-tools/src/libipsec/policy_parse.y',<br>
+ self.addFile(mm.generator['file']('user',<br>
+ 'ipsec-tools/src/libipsec/policy_parse.y',<br>
mm.generator['path'](),<br>
mm.generator['convert'](),<br>
mm.generator['convert'](),<br>
@@ -2174,7 +2183,8 @@ class netipsec(builder.Module):<br>
mm.generator['source'](racoon_cflags,<br>
['freebsd/crypto/openssl'])<br>
)<br>
- self.addFile(mm.generator['file']('ipsec-tools/src/racoon/cftoken.l',<br>
+ self.addFile(mm.generator['file']('user',<br>
+ 'ipsec-tools/src/racoon/cftoken.l',<br>
mm.generator['path'](),<br>
mm.generator['convert'](),<br>
mm.generator['convert'](),<br>
@@ -2182,7 +2192,8 @@ class netipsec(builder.Module):<br>
'cftoken.c',<br>
racoon_cflags,<br>
build=False)))<br>
- self.addFile(mm.generator['file']('ipsec-tools/src/racoon/cfparse.y',<br>
+ self.addFile(mm.generator['file']('user',<br>
+ 'ipsec-tools/src/racoon/cfparse.y',<br>
mm.generator['path'](),<br>
mm.generator['convert'](),<br>
mm.generator['convert'](),<br>
@@ -2190,7 +2201,8 @@ class netipsec(builder.Module):<br>
'cfparse.h',<br>
racoon_cflags,<br>
build=False)))<br>
- self.addFile(mm.generator['file']('ipsec-tools/src/racoon/prsa_tok.l',<br>
+ self.addFile(mm.generator['file']('user',<br>
+ 'ipsec-tools/src/racoon/prsa_tok.l',<br>
mm.generator['path'](),<br>
mm.generator['convert'](),<br>
mm.generator['convert'](),<br>
@@ -2198,7 +2210,8 @@ class netipsec(builder.Module):<br>
'prsa_tok.c',<br>
racoon_cflags,<br>
build=False)))<br>
- self.addFile(mm.generator['file']('ipsec-tools/src/racoon/prsa_par.y',<br>
+ self.addFile(mm.generator['file']('user',<br>
+ 'ipsec-tools/src/racoon/prsa_par.y',<br>
mm.generator['path'](),<br>
mm.generator['convert'](),<br>
mm.generator['convert'](),<br>
@@ -2211,7 +2224,7 @@ class netipsec(builder.Module):<br>
'rtems/ipsec.h',<br>
]<br>
)<br>
- self.addRTEMSSourceFiles(<br>
+ self.addRTEMSUserSourceFiles(<br>
[<br>
'rtems/rtems-bsd-racoon.c',<br>
'rtems/rtems-bsd-rc-conf-ipsec.c',<br>
@@ -2231,7 +2244,8 @@ class netipsec(builder.Module):<br>
],<br>
mm.generator['source'](setkey_cflags)<br>
)<br>
- self.addFile(mm.generator['file']('ipsec-tools/src/setkey/token.l',<br>
+ self.addFile(mm.generator['file']('user',<br>
+ 'ipsec-tools/src/setkey/token.l',<br>
mm.generator['path'](),<br>
mm.generator['convert'](),<br>
mm.generator['convert'](),<br>
@@ -2239,7 +2253,8 @@ class netipsec(builder.Module):<br>
'token.c',<br>
setkey_cflags,<br>
build=False)))<br>
- self.addFile(mm.generator['file']('ipsec-tools/src/setkey/parse.y',<br>
+ self.addFile(mm.generator['file']('user',<br>
+ 'ipsec-tools/src/setkey/parse.y',<br>
mm.generator['path'](),<br>
mm.generator['convert'](),<br>
mm.generator['convert'](),<br>
@@ -2247,7 +2262,7 @@ class netipsec(builder.Module):<br>
'parse.h',<br>
setkey_cflags,<br>
build=False)))<br>
- self.addRTEMSSourceFiles(<br>
+ self.addRTEMSUserSourceFiles(<br>
[<br>
'rtems/rtems-bsd-shell-setkey.c',<br>
],<br>
@@ -2585,6 +2600,156 @@ class pf(builder.Module):<br>
mm.generator['source']()<br>
)<br>
<br>
+#<br>
+# RPC for user space, remove when NFSv2 is removed<br>
+#<br>
+class rpc_user(builder.Module):<br>
+<br>
+ def __init__(self, manager):<br>
+ super(rpc_user, self).__init__(manager, type(self).__name__)<br>
+<br>
+ def generate(self):<br>
+ mm = self.manager<br>
+ # User space support for legacy nfsv2 client, remove when nfsv2 is removed<br>
+ self.addUserSpaceHeaderFiles(<br>
+ [<br>
+ 'include/rpc/clnt.h',<br>
+ 'include/rpc/pmap_rmt.h',<br>
+ 'include/rpc/svc_soc.h',<br>
+ 'include/rpc/nettype.h',<br>
+ 'include/rpc/xdr.h',<br>
+ 'include/rpc/svc.h',<br>
+ 'include/rpc/rpc_msg.h',<br>
+ 'include/rpc/rpcsec_gss.h',<br>
+ 'include/rpc/raw.h',<br>
+ 'include/rpc/clnt_stat.h',<br>
+ 'include/rpc/auth.h',<br>
+ 'include/rpc/svc_dg.h',<br>
+ 'include/rpc/auth_kerb.h',<br>
+ 'include/rpc/auth_des.h',<br>
+ 'include/rpc/rpcb_clnt.h',<br>
+ 'include/rpc/rpc.h',<br>
+ 'include/rpc/des.h',<br>
+ 'include/rpc/des_crypt.h',<br>
+ 'include/rpc/svc_auth.h',<br>
+ 'include/rpc/pmap_clnt.h',<br>
+ 'include/rpc/clnt_soc.h',<br>
+ 'include/rpc/pmap_prot.h',<br>
+ 'include/rpc/auth_unix.h',<br>
+ 'include/rpc/rpc_com.h',<br>
+ 'include/rpc/rpcent.h',<br>
+ 'include/rpcsvc/nis_db.h',<br>
+ 'include/rpcsvc/nislib.h',<br>
+ 'include/rpcsvc/nis_tags.h',<br>
+ 'include/rpcsvc/ypclnt.h',<br>
+ 'include/rpcsvc/yp_prot.h',<br>
+ 'lib/libc/rpc/mt_misc.h',<br>
+ 'lib/libc/rpc/rpc_com.h',<br>
+ ]<br>
+ )<br>
+ self.addFile(mm.generator['file']('user',<br>
+ 'include/rpc/rpcb_prot.x',<br>
+ mm.generator['freebsd-path'](),<br>
+ mm.generator['convert'](),<br>
+ mm.generator['convert'](),<br>
+ mm.generator['rpc-gen']()))<br>
+ self.addFile(mm.generator['file']('user',<br>
+ 'include/rpcsvc/nis.x',<br>
+ mm.generator['freebsd-path'](),<br>
+ mm.generator['convert'](),<br>
+ mm.generator['convert'](),<br>
+ mm.generator['rpc-gen']()))<br>
+ self.addUserSpaceSourceFiles(<br>
+ [<br>
+ 'lib/libc/rpc/auth_des.c',<br>
+ 'lib/libc/rpc/authdes_prot.c',<br>
+ 'lib/libc/rpc/auth_none.c',<br>
+ 'lib/libc/rpc/auth_time.c',<br>
+ 'lib/libc/rpc/auth_unix.c',<br>
+ 'lib/libc/rpc/authunix_prot.c',<br>
+ 'lib/libc/rpc/bindresvport.c',<br>
+ 'lib/libc/rpc/clnt_bcast.c',<br>
+ 'lib/libc/rpc/clnt_dg.c',<br>
+ 'lib/libc/rpc/clnt_generic.c',<br>
+ 'lib/libc/rpc/clnt_perror.c',<br>
+ 'lib/libc/rpc/clnt_raw.c',<br>
+ 'lib/libc/rpc/clnt_simple.c',<br>
+ 'lib/libc/rpc/clnt_vc.c',<br>
+ 'lib/libc/rpc/crypt_client.c',<br>
+ 'lib/libc/rpc/des_crypt.c',<br>
+ 'lib/libc/rpc/des_soft.c',<br>
+ 'lib/libc/rpc/getnetconfig.c',<br>
+ 'lib/libc/rpc/getnetpath.c',<br>
+ 'lib/libc/rpc/getpublickey.c',<br>
+ 'lib/libc/rpc/getrpcent.c',<br>
+ 'lib/libc/rpc/getrpcport.c',<br>
+ 'lib/libc/rpc/key_call.c',<br>
+ 'lib/libc/rpc/key_prot_xdr.c',<br>
+ 'lib/libc/rpc/mt_misc.c',<br>
+ 'lib/libc/rpc/netname.c',<br>
+ 'lib/libc/rpc/netnamer.c',<br>
+ 'lib/libc/rpc/pmap_clnt.c',<br>
+ 'lib/libc/rpc/pmap_getmaps.c',<br>
+ 'lib/libc/rpc/pmap_getport.c',<br>
+ 'lib/libc/rpc/pmap_prot2.c',<br>
+ 'lib/libc/rpc/pmap_prot.c',<br>
+ 'lib/libc/rpc/pmap_rmt.c',<br>
+ 'lib/libc/rpc/rpcb_clnt.c',<br>
+ 'lib/libc/rpc/rpcb_prot.c',<br>
+ 'lib/libc/rpc/rpcb_st_xdr.c',<br>
+ 'lib/libc/rpc/rpc_callmsg.c',<br>
+ 'lib/libc/rpc/rpc_commondata.c',<br>
+ 'lib/libc/rpc/rpcdname.c',<br>
+ 'lib/libc/rpc/rpc_dtablesize.c',<br>
+ 'lib/libc/rpc/rpc_generic.c',<br>
+ 'lib/libc/rpc/rpc_prot.c',<br>
+ 'lib/libc/rpc/rpcsec_gss_stub.c',<br>
+ 'lib/libc/rpc/rpc_soc.c',<br>
+ 'lib/libc/rpc/rtime.c',<br>
+ 'lib/libc/rpc/svc_auth.c',<br>
+ 'lib/libc/rpc/svc_auth_des.c',<br>
+ 'lib/libc/rpc/svc_auth_unix.c',<br>
+ 'lib/libc/rpc/svc.c',<br>
+ 'lib/libc/rpc/svc_dg.c',<br>
+ 'lib/libc/rpc/svc_generic.c',<br>
+ 'lib/libc/rpc/svc_raw.c',<br>
+ 'lib/libc/rpc/svc_run.c',<br>
+ 'lib/libc/rpc/svc_simple.c',<br>
+ 'lib/libc/rpc/svc_vc.c',<br>
+ 'lib/libc/xdr/xdr_array.c',<br>
+ 'lib/libc/xdr/xdr.c',<br>
+ 'lib/libc/xdr/xdr_float.c',<br>
+ 'lib/libc/xdr/xdr_mem.c',<br>
+ 'lib/libc/xdr/xdr_rec.c',<br>
+ 'lib/libc/xdr/xdr_reference.c',<br>
+ 'lib/libc/xdr/xdr_sizeof.c',<br>
+ 'lib/libc/xdr/xdr_stdio.c',<br>
+ ],<br>
+ mm.generator['source'](['-DINET'])<br>
+ )<br>
+<br>
+#<br>
+# NFSv2 Client<br>
+#<br>
+class nfsv2(builder.Module):<br>
+<br>
+ def __init__(self, manager):<br>
+ super(nfsv2, self).__init__(manager, type(self).__name__)<br>
+<br>
+ def generate(self):<br>
+ mm = self.manager<br>
+ self.addDependency(mm['rpc_user'])<br>
+ self.addRTEMSUserSourceFiles(<br>
+ [<br>
+ 'nfsclient/mount_prot_xdr.c',<br>
+ 'nfsclient/nfs.c',<br>
+ 'nfsclient/nfs_prot_xdr.c',<br>
+ 'nfsclient/rpcio.c',<br>
+ ],<br>
+ mm.generator['source']()<br>
+ )<br>
+<br>
+<br>
#<br>
# PCI<br>
#<br>
@@ -2630,6 +2795,7 @@ class pci(builder.Module):<br>
mm.generator['source']()<br>
)<br>
<br>
+<br>
#<br>
# User space<br>
#<br>
@@ -2665,36 +2831,6 @@ class user_space(builder.Module):<br>
'include/nsswitch.h',<br>
'include/resolv.h',<br>
'include/res_update.h',<br>
- 'include/rpc/clnt.h',<br>
- 'include/rpc/pmap_rmt.h',<br>
- 'include/rpc/svc_soc.h',<br>
- 'include/rpc/nettype.h',<br>
- 'include/rpc/xdr.h',<br>
- 'include/rpc/svc.h',<br>
- 'include/rpc/rpc_msg.h',<br>
- 'include/rpc/rpcsec_gss.h',<br>
- 'include/rpc/raw.h',<br>
- 'include/rpc/clnt_stat.h',<br>
- 'include/rpc/auth.h',<br>
- 'include/rpc/svc_dg.h',<br>
- 'include/rpc/auth_kerb.h',<br>
- 'include/rpc/auth_des.h',<br>
- 'include/rpc/rpcb_clnt.h',<br>
- 'include/rpc/rpc.h',<br>
- 'include/rpc/des.h',<br>
- 'include/rpc/des_crypt.h',<br>
- 'include/rpc/svc_auth.h',<br>
- 'include/rpc/pmap_clnt.h',<br>
- 'include/rpc/clnt_soc.h',<br>
- 'include/rpc/pmap_prot.h',<br>
- 'include/rpc/auth_unix.h',<br>
- 'include/rpc/rpc_com.h',<br>
- 'include/rpc/rpcent.h',<br>
- 'include/rpcsvc/nis_db.h',<br>
- 'include/rpcsvc/nislib.h',<br>
- 'include/rpcsvc/nis_tags.h',<br>
- 'include/rpcsvc/ypclnt.h',<br>
- 'include/rpcsvc/yp_prot.h',<br>
'include/sysexits.h',<br>
'lib/lib80211/lib80211_ioctl.h',<br>
'lib/lib80211/lib80211_regdomain.h',<br>
@@ -2724,8 +2860,6 @@ class user_space(builder.Module):<br>
'lib/libc/net/res_config.h',<br>
'lib/libc/resolv/res_debug.h',<br>
'lib/libc/resolv/res_private.h',<br>
- 'lib/libc/rpc/mt_misc.h',<br>
- 'lib/libc/rpc/rpc_com.h',<br>
'lib/libc/stdio/local.h',<br>
'lib/libkvm/kvm.h',<br>
'lib/libmemstat/memstat.h',<br>
@@ -2741,22 +2875,14 @@ class user_space(builder.Module):<br>
'usr.bin/netstat/netstat.h'<br>
]<br>
)<br>
- self.addFile(mm.generator['file']('include/rpc/rpcb_prot.x',<br>
- mm.generator['freebsd-path'](),<br>
- mm.generator['convert'](),<br>
- mm.generator['convert'](),<br>
- mm.generator['rpc-gen']()))<br>
- self.addFile(mm.generator['file']('include/rpcsvc/nis.x',<br>
- mm.generator['freebsd-path'](),<br>
- mm.generator['convert'](),<br>
- mm.generator['convert'](),<br>
- mm.generator['rpc-gen']()))<br>
- self.addFile(mm.generator['file']('sbin/route/keywords',<br>
+ self.addFile(mm.generator['file']('user',<br>
+ 'sbin/route/keywords',<br>
mm.generator['freebsd-path'](),<br>
mm.generator['convert'](),<br>
mm.generator['convert'](),<br>
mm.generator['route-keywords']()))<br>
- self.addFile(mm.generator['file']('sbin/pfctl/parse.y',<br>
+ self.addFile(mm.generator['file']('user',<br>
+ 'sbin/pfctl/parse.y',<br>
mm.generator['freebsd-path'](),<br>
mm.generator['convert'](),<br>
mm.generator['convert'](),<br>
@@ -2796,7 +2922,7 @@ class user_space(builder.Module):<br>
'include/machine/rtems-bsd-regdomain.h',<br>
]<br>
)<br>
- self.addRTEMSSourceFiles(<br>
+ self.addRTEMSUserSourceFiles(<br>
[<br>
'rtems/rtems-bsd-regdomain.c',<br>
],<br>
@@ -2891,72 +3017,9 @@ class user_space(builder.Module):<br>
'lib/libc/resolv/res_send.c',<br>
'lib/libc/resolv/res_state.c',<br>
'lib/libc/resolv/res_update.c',<br>
- 'lib/libc/rpc/auth_des.c',<br>
- 'lib/libc/rpc/authdes_prot.c',<br>
- 'lib/libc/rpc/auth_none.c',<br>
- 'lib/libc/rpc/auth_time.c',<br>
- 'lib/libc/rpc/auth_unix.c',<br>
- 'lib/libc/rpc/authunix_prot.c',<br>
- 'lib/libc/rpc/bindresvport.c',<br>
- 'lib/libc/rpc/clnt_bcast.c',<br>
- 'lib/libc/rpc/clnt_dg.c',<br>
- 'lib/libc/rpc/clnt_generic.c',<br>
- 'lib/libc/rpc/clnt_perror.c',<br>
- 'lib/libc/rpc/clnt_raw.c',<br>
- 'lib/libc/rpc/clnt_simple.c',<br>
- 'lib/libc/rpc/clnt_vc.c',<br>
- 'lib/libc/rpc/crypt_client.c',<br>
- 'lib/libc/rpc/des_crypt.c',<br>
- 'lib/libc/rpc/des_soft.c',<br>
- 'lib/libc/rpc/getnetconfig.c',<br>
- 'lib/libc/rpc/getnetpath.c',<br>
- 'lib/libc/rpc/getpublickey.c',<br>
- 'lib/libc/rpc/getrpcent.c',<br>
- 'lib/libc/rpc/getrpcport.c',<br>
- 'lib/libc/rpc/key_call.c',<br>
- 'lib/libc/rpc/key_prot_xdr.c',<br>
- 'lib/libc/rpc/mt_misc.c',<br>
- 'lib/libc/rpc/netname.c',<br>
- 'lib/libc/rpc/netnamer.c',<br>
- 'lib/libc/rpc/pmap_clnt.c',<br>
- 'lib/libc/rpc/pmap_getmaps.c',<br>
- 'lib/libc/rpc/pmap_getport.c',<br>
- 'lib/libc/rpc/pmap_prot2.c',<br>
- 'lib/libc/rpc/pmap_prot.c',<br>
- 'lib/libc/rpc/pmap_rmt.c',<br>
- 'lib/libc/rpc/rpcb_clnt.c',<br>
- 'lib/libc/rpc/rpcb_prot.c',<br>
- 'lib/libc/rpc/rpcb_st_xdr.c',<br>
- 'lib/libc/rpc/rpc_callmsg.c',<br>
- 'lib/libc/rpc/rpc_commondata.c',<br>
- 'lib/libc/rpc/rpcdname.c',<br>
- 'lib/libc/rpc/rpc_dtablesize.c',<br>
- 'lib/libc/rpc/rpc_generic.c',<br>
- 'lib/libc/rpc/rpc_prot.c',<br>
- 'lib/libc/rpc/rpcsec_gss_stub.c',<br>
- 'lib/libc/rpc/rpc_soc.c',<br>
- 'lib/libc/rpc/rtime.c',<br>
- 'lib/libc/rpc/svc_auth.c',<br>
- 'lib/libc/rpc/svc_auth_des.c',<br>
- 'lib/libc/rpc/svc_auth_unix.c',<br>
- 'lib/libc/rpc/svc.c',<br>
- 'lib/libc/rpc/svc_dg.c',<br>
- 'lib/libc/rpc/svc_generic.c',<br>
- 'lib/libc/rpc/svc_raw.c',<br>
- 'lib/libc/rpc/svc_run.c',<br>
- 'lib/libc/rpc/svc_simple.c',<br>
- 'lib/libc/rpc/svc_vc.c',<br>
'lib/libc/stdio/fgetln.c',<br>
'lib/libc/stdlib/strtonum.c',<br>
'lib/libc/string/strsep.c',<br>
- 'lib/libc/xdr/xdr_array.c',<br>
- 'lib/libc/xdr/xdr.c',<br>
- 'lib/libc/xdr/xdr_float.c',<br>
- 'lib/libc/xdr/xdr_mem.c',<br>
- 'lib/libc/xdr/xdr_rec.c',<br>
- 'lib/libc/xdr/xdr_reference.c',<br>
- 'lib/libc/xdr/xdr_sizeof.c',<br>
- 'lib/libc/xdr/xdr_stdio.c',<br>
'lib/libmemstat/memstat_all.c',<br>
'lib/libmemstat/memstat.c',<br>
'lib/libmemstat/memstat_malloc.c',<br>
@@ -3068,6 +3131,7 @@ class crypto_openssl(builder.Module):<br>
<br>
def generate(self):<br>
mm = self.manager<br>
+ self.addDependency(mm['user_space'])<br>
self.addUserSpaceHeaderFiles(<br>
[<br>
'crypto/openssl/crypto/aes/aes_locl.h',<br>
@@ -4021,21 +4085,22 @@ class crypto_openssl(builder.Module):<br>
'freebsd/crypto/openssl/crypto/ec/curve448',<br>
'freebsd/crypto/openssl/crypto/ec/curve448/arch_32'])<br>
)<br>
- self.addFile(mm.generator['file']('crypto/openssl/crypto/LPdir_unix.c',<br>
+ self.addFile(mm.generator['file']('user',<br>
+ 'crypto/openssl/crypto/LPdir_unix.c',<br>
mm.generator['freebsd-path'](),<br>
mm.generator['from-FreeBSD-to-RTEMS-UserSpaceSourceConverter'](),<br>
mm.generator['from-RTEMS-To-FreeBSD-SourceConverter'](),<br>
- mm.generator['buildSystemFragmentComposer']()))<br>
- self.addFile(mm.generator['file']('crypto/openssl/crypto/ec/ecp_nistz256_table.c',<br>
+ mm.generator['buildSystemComposer']()))<br>
+ self.addFile(mm.generator['file']('user',<br>
+ 'crypto/openssl/crypto/ec/ecp_nistz256_table.c',<br>
mm.generator['freebsd-path'](),<br>
mm.generator['from-FreeBSD-to-RTEMS-UserSpaceSourceConverter'](),<br>
mm.generator['from-RTEMS-To-FreeBSD-SourceConverter'](),<br>
- mm.generator['buildSystemFragmentComposer']()))<br>
+ mm.generator['buildSystemComposer']()))<br>
<br>
#<br>
# /usr/bin/openssl<br>
#<br>
-# depends on crypto_openssl, user_space<br>
class usr_bin_openssl(builder.Module):<br>
<br>
def __init__(self, manager):<br>
@@ -4043,6 +4108,7 @@ class usr_bin_openssl(builder.Module):<br>
<br>
def generate(self):<br>
mm = self.manager<br>
+ self.addDependency(mm['crypto_openssl'])<br>
self.addUserSpaceHeaderFiles(<br>
[<br>
'crypto/openssl/apps/apps.h',<br>
@@ -4115,7 +4181,7 @@ class usr_bin_openssl(builder.Module):<br>
['freebsd/crypto/openssl']<br>
)<br>
)<br>
- self.addRTEMSSourceFiles(<br>
+ self.addRTEMSUserSourceFiles(<br>
[<br>
'rtems/rtems-bsd-shell-openssl.c',<br>
],<br>
@@ -4233,14 +4299,16 @@ class contrib_libpcap(builder.Module):<br>
)<br>
gen_cflags = cflags + ['-DNEED_YYPARSE_WRAPPER=1',<br>
'-Dyylval=pcap_lval']<br>
- self.addFile(mm.generator['file']('contrib/libpcap/scanner.l',<br>
+ self.addFile(mm.generator['file']('user',<br>
+ 'contrib/libpcap/scanner.l',<br>
mm.generator['freebsd-path'](),<br>
mm.generator['convert'](),<br>
mm.generator['convert'](),<br>
mm.generator['lex']('pcap',<br>
'scanner.c',<br>
gen_cflags)))<br>
- self.addFile(mm.generator['file']('contrib/libpcap/grammar.y',<br>
+ self.addFile(mm.generator['file']('user',<br>
+ 'contrib/libpcap/grammar.y',<br>
mm.generator['freebsd-path'](),<br>
mm.generator['convert'](),<br>
mm.generator['convert'](),<br>
@@ -4811,7 +4879,7 @@ class usr_sbin_wpa_supplicant(builder.Module):<br>
'freebsd/usr.sbin/wpa/wpa_supplicant',<br>
'freebsd/crypto/openssl/crypto'])<br>
)<br>
- self.addRTEMSSourceFiles(<br>
+ self.addRTEMSUserSourceFiles(<br>
[<br>
'rtems/rtems-bsd-shell-wpa_supplicant.c',<br>
'rtems/rtems-wpa_supplicant_mutex.c',<br>
@@ -4920,7 +4988,7 @@ class dhcpcd(builder.Module):<br>
],<br>
mm.generator['source']('-D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET')<br>
)<br>
- self.addRTEMSSourceFiles(<br>
+ self.addRTEMSUserSourceFiles(<br>
[<br>
'rtems/rtems-bsd-shell-dhcpcd.c',<br>
],<br>
@@ -4958,6 +5026,7 @@ class mdnsresponder(builder.Module):<br>
mm.generator['source']()<br>
)<br>
<br>
+<br>
class dpaa(builder.Module):<br>
<br>
def __init__(self, manager):<br>
@@ -5057,7 +5126,7 @@ class regulator(builder.Module):<br>
<br>
def generate(self):<br>
mm = self.manager<br>
- self.addRTEMSSourceFiles(<br>
+ self.addRTEMSKernelSourceFiles(<br>
[<br>
'local/regdev_if.c',<br>
'local/regnode_if.c',<br>
@@ -5223,6 +5292,9 @@ def load(mm):<br>
mm.addModule(pf(mm))<br>
mm.addModule(dev_net(mm))<br>
<br>
+ mm.addModule(rpc_user(mm))<br>
+ mm.addModule(nfsv2(mm))<br>
+<br>
# Add PCI<br>
mm.addModule(pci(mm))<br>
<br>
diff --git a/waf_libbsd.py b/waf_libbsd.py<br>
index bdd1cf4a..d7a0c224 100644<br>
--- a/waf_libbsd.py<br>
+++ b/waf_libbsd.py<br>
@@ -1,6 +1,6 @@<br>
# SPDX-License-Identifier: BSD-2-Clause<br>
-'''LibBSD build configuration to waf integration module.<br>
-'''<br>
+"""LibBSD build configuration to waf integration module.<br>
+"""<br>
<br>
# Copyright (c) 2015, 2020 Chris Johns <<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>>. All rights reserved.<br>
#<br>
@@ -37,12 +37,6 @@<br>
<br>
from __future__ import print_function<br>
<br>
-# Python 3 does no longer know the basestring class. Catch that.<br>
-try:<br>
- basestring<br>
-except NameError:<br>
- basestring = (str, bytes)<br>
-<br>
import os<br>
import sys<br>
import tempfile<br>
@@ -86,11 +80,11 @@ class Builder(builder.ModuleManager):<br>
return sources<br>
<br>
def generate(self, rtems_version):<br>
- def _dataInsert(data, cpu, frag):<br>
+ def _dataInsert(data, cpu, space, frag):<br>
#<br>
- # The default handler returns an empty string. Skip it.<br>
+ # The default handler returns None. Skip it.<br>
#<br>
- if type(frag) is not str:<br>
+ if frag is not None:<br>
# Start at the top of the tree<br>
d = data<br>
path = frag[0]<br>
@@ -99,6 +93,10 @@ class Builder(builder.ModuleManager):<br>
# Select the sub-part of the tree as the compile options<br>
# specialise how files are built.<br>
d = d[path[0]]<br>
+ # Group based on the space, ie kernel or user<br>
+ if space not in d:<br>
+ d[space] = {}<br>
+ d = d[space]<br>
if type(path[1]) is list:<br>
p = ' '.join(path[1])<br>
else:<br>
@@ -144,11 +142,14 @@ class Builder(builder.ModuleManager):<br>
m = self[mn]<br>
if m.conditionalOn == "none":<br>
for f in m.files:<br>
- _dataInsert(self.data, 'all', f.getFragment())<br>
+ _dataInsert(self.data, 'all', f.getSpace(),<br>
+ f.getFragment())<br>
for cpu, files in sorted(m.cpuDependentSourceFiles.items()):<br>
for f in files:<br>
- _dataInsert(self.data, cpu, f.getFragment())<br>
+ _dataInsert(self.data, cpu, f.getSpace(),<br>
+ f.getFragment())<br>
<br>
+ # Start here if you need to understand self.data. Add 'True or'<br>
if self.trace:<br>
import pprint<br>
pprint.pprint(self.data)<br>
@@ -206,21 +207,45 @@ class Builder(builder.ModuleManager):<br>
defines += ['%s=1' % (o.strip().upper())]<br>
<br>
#<br>
- # Include paths<br>
- #<br>
- includes = []<br>
- buildinclude = 'build-include'<br>
- if 'cpu-include-paths' in config:<br>
+ # Include paths, maintain paths for each build space.<br>
+ #<br>
+ include_paths = config['include-paths']<br>
+ if 'build' not in include_paths:<br>
+ bld.fatal('no build include path found in include-path defaults')<br>
+ buildinclude = include_paths['build']<br>
+ if isinstance(buildinclude, list):<br>
+ buildinclude = buildinclude[0]<br>
+ inc_paths = sorted(include_paths)<br>
+ inc_paths.remove('build')<br>
+ inc_paths.remove('cpu')<br>
+ includes = {}<br>
+ for inc in inc_paths:<br>
+ includes[inc] = include_paths[inc]<br>
+ # cpu include paths must be the first searched<br>
+ if 'cpu' in include_paths:<br>
cpu = bld.get_env()['RTEMS_ARCH']<br>
- for i in config['cpu-include-paths']:<br>
- includes += [i.replace('@CPU@', cpu)]<br>
- if 'include-paths' in config:<br>
- includes += config['include-paths']<br>
- if 'build-include-path' in config:<br>
- buildinclude = config['build-include-path']<br>
- if not isinstance(buildinclude, basestring):<br>
- buildinclude = buildinclude[0]<br>
- includes += [buildinclude]<br>
+ for i in include_paths['cpu']:<br>
+ includes['kernel'].insert(0, i.replace('@CPU@', cpu))<br>
+ includes['kernel'] += [buildinclude]<br>
+<br>
+ #<br>
+ # Path mappings<br>
+ #<br>
+ if 'path-mappings' in config:<br>
+ for source, target in config['path-mappings']:<br>
+ for space in includes:<br>
+ incs = includes[space]<br>
+ if source in incs:<br>
+ target = [target] if isinstance(target,<br>
+ str) else target<br>
+ i = incs.index(source)<br>
+ incs.remove(source)<br>
+ incs[i:i] = target<br>
+<br>
+ #<br>
+ # Place the kernel include paths after the user paths<br>
+ #<br>
+ includes['user'] += includes['kernel']<br>
<br>
#<br>
# Path mappings<br>
@@ -325,7 +350,7 @@ class Builder(builder.ModuleManager):<br>
# KVM Symbols<br>
#<br>
if 'KVMSymbols' in self.data:<br>
- kvmsymbols = self.data['KVMSymbols']<br>
+ kvmsymbols = self.data['KVMSymbols']['kernel']<br>
if 'includes' in kvmsymbols['files']:<br>
kvmsymbols_includes = kvmsymbols['files']['includes']<br>
else:<br>
@@ -337,7 +362,7 @@ class Builder(builder.ModuleManager):<br>
bld.objects(target='kvmsymbols',<br>
features='c',<br>
cflags=cflags,<br>
- includes=kvmsymbols_includes + includes,<br>
+ includes=kvmsymbols_includes + includes['kernel'],<br>
source=kvmsymbols['files']['all']['default'][0])<br>
libbsd_use += ["kvmsymbols"]<br>
<br>
@@ -348,7 +373,7 @@ class Builder(builder.ModuleManager):<br>
#<br>
if 'RPCGen' in self.data:<br>
if bld.env.AUTO_REGEN:<br>
- rpcgen = self.data['RPCGen']<br>
+ rpcgen = self.data['RPCGen']['user']<br>
rpcname = rpcgen['files']['all']['default'][0][:-2]<br>
bld(target=rpcname + '.h',<br>
source=rpcname + '.x',<br>
@@ -359,7 +384,7 @@ class Builder(builder.ModuleManager):<br>
#<br>
if 'RouteKeywords' in self.data:<br>
if bld.env.AUTO_REGEN:<br>
- routekw = self.data['RouteKeywords']<br>
+ routekw = self.data['RouteKeywords']['user']<br>
rkwname = routekw['files']['all']['default'][0]<br>
rkw_rule = host_shell + "cat ${SRC} | " + \<br>
"awk 'BEGIN { r = 0 } { if (NF == 1) " + \<br>
@@ -371,7 +396,7 @@ class Builder(builder.ModuleManager):<br>
# Lex<br>
#<br>
if 'lex' in self.data:<br>
- lexes = self.data['lex']<br>
+ lexes = self.data['lex']['user']<br>
for l in sorted(lexes.keys()):<br>
lex = lexes[l]['all']['default']<br>
if 'cflags' in lex:<br>
@@ -392,7 +417,7 @@ class Builder(builder.ModuleManager):<br>
bld.objects(target='lex_%s' % (lex['sym']),<br>
features='c',<br>
cflags=cflags,<br>
- includes=lexIncludes + includes,<br>
+ includes=lexIncludes + includes['user'],<br>
defines=defines + lexDefines,<br>
source=lex['file'][:-2] + '.c')<br>
libbsd_use += ['lex_%s' % (lex['sym'])]<br>
@@ -401,7 +426,7 @@ class Builder(builder.ModuleManager):<br>
# Yacc<br>
#<br>
if 'yacc' in self.data:<br>
- yaccs = self.data['yacc']<br>
+ yaccs = self.data['yacc']['user']<br>
for y in sorted(yaccs.keys()):<br>
yacc = yaccs[y]['all']['default']<br>
yaccFile = yacc['file']<br>
@@ -432,7 +457,7 @@ class Builder(builder.ModuleManager):<br>
bld.objects(target='yacc_%s' % (yaccSym),<br>
features='c',<br>
cflags=cflags,<br>
- includes=yaccIncludes + includes,<br>
+ includes=yaccIncludes + includes['user'],<br>
defines=defines + yaccDefines,<br>
source=yaccFile[:-2] + '.c')<br>
libbsd_use += ['yacc_%s' % (yaccSym)]<br>
@@ -442,34 +467,40 @@ class Builder(builder.ModuleManager):<br>
# specific files for those flags.<br>
#<br>
objs = 0<br>
- sources = sorted(self.data['sources'])<br>
- if 'default' in sources:<br>
- sources.remove('default')<br>
- for flags in sources:<br>
- objs += 1<br>
- build = self.data['sources'][flags]<br>
- target = 'objs%02d' % (objs)<br>
- bld_sources = Builder._sourceList(bld, build['all'])<br>
- archs = sorted(build)<br>
- for i in ['all', 'cflags', 'includes']:<br>
- if i in archs:<br>
- archs.remove(i)<br>
- for arch in archs:<br>
- if bld.get_env()['RTEMS_ARCH'] == arch:<br>
- bld_sources += Builder._sourceList(bld, build[arch])<br>
- bld.objects(target=target,<br>
- features='c',<br>
- cflags=cflags + sorted(build.get('cflags', [])),<br>
- includes=sorted(build.get('includes', [])) + includes,<br>
- defines=defines,<br>
- source=bld_sources)<br>
- libbsd_use += [target]<br>
-<br>
- #<br>
- # We hold the 'default' cflags set of files to the end to create the<br>
- # static library with.<br>
- #<br>
- build = self.data['sources']['default']<br>
+ for space in sorted(self.data['sources']):<br>
+ sources = sorted(self.data['sources'][space])<br>
+ if space == 'kernel' and 'default' in sources:<br>
+ sources.remove('default')<br>
+ for flags in sources:<br>
+ objs += 1<br>
+ build = self.data['sources'][space][flags]<br>
+ target = 'objs%02d' % (objs)<br>
+ bld_sources = Builder._sourceList(bld, build['all'])<br>
+ archs = sorted(build)<br>
+ for i in ['all', 'cflags', 'includes']:<br>
+ if i in archs:<br>
+ archs.remove(i)<br>
+ for arch in archs:<br>
+ if bld.get_env()['RTEMS_ARCH'] == arch:<br>
+ bld_sources += Builder._sourceList(bld, build[arch])<br>
+ bld_cflags = sorted(build.get('cflags', []))<br>
+ if 'default' in bld_cflags:<br>
+ bld_cflags.remove('default')<br>
+ bld.objects(target=target,<br>
+ features='c cxx',<br>
+ cflags=cflags + bld_cflags,<br>
+ cxxflags=cxxflags,<br>
+ includes=sorted(build.get('includes', [])) +<br>
+ includes[space],<br>
+ defines=defines,<br>
+ source=bld_sources)<br>
+ libbsd_use += [target]<br>
+<br>
+ #<br>
+ # We hold the kernel 'default' cflags set of files to the end to<br>
+ # create the static library with.<br>
+ #<br>
+ build = self.data['sources']['kernel']['default']<br>
bld_sources = Builder._sourceList(bld, build['all'])<br>
archs = sorted(build)<br>
archs.remove('all')<br>
@@ -480,7 +511,7 @@ class Builder(builder.ModuleManager):<br>
features='c cxx',<br>
cflags=cflags,<br>
cxxflags=cxxflags,<br>
- includes=includes,<br>
+ includes=includes['kernel'],<br>
defines=defines,<br>
source=bld_sources,<br>
use=libbsd_use)<br>
@@ -522,9 +553,9 @@ class Builder(builder.ModuleManager):<br>
#<br>
tests = []<br>
if 'tests' in self.data:<br>
- tests = self.data['tests']<br>
+ tests = self.data['tests']['user']<br>
for testName in sorted(tests):<br>
- test = self.data['tests'][testName]['all']<br>
+ test = tests[testName]['all']<br>
test_source = []<br>
libs = ['bsd', 'm', 'z', 'rtemstest']<br>
for cfg in test:<br>
@@ -542,7 +573,7 @@ class Builder(builder.ModuleManager):<br>
bld.program(target='%s.exe' % (testName),<br>
features='cprogram',<br>
cflags=cflags,<br>
- includes=includes,<br>
+ includes=includes['user'],<br>
source=test_sources,<br>
use=['bsd'],<br>
lib=libs,<br>
diff --git a/wscript b/wscript<br>
index e9541327..466b50be 100644<br>
--- a/wscript<br>
+++ b/wscript<br>
@@ -1,9 +1,9 @@<br>
# SPDX-License-Identifier: BSD-2-Clause<br>
-'''RTEMS LibBSD is a transparent source build of the FreeBSD kernel<br>
+"""RTEMS LibBSD is a transparent source build of the FreeBSD kernel<br>
source for RTEMS.<br>
<br>
To use see README.waf shipped with this file.<br>
-'''<br>
+"""<br>
<br>
# Copyright (c) 2015-2016 Chris Johns <<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>>. All rights reserved.<br>
#<br>
-- <br>
2.24.1<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div></div>