[PATCH v1 2/2] machine: Add machine dependent header files to libbsd.py

Jan Sommer jan.sommer at dlr.de
Mon May 10 14:29:08 UTC 2021


---
 libbsd.py     | 26 +++++++++++++++++++++++---
 waf_libbsd.py |  2 --
 2 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/libbsd.py b/libbsd.py
index add91e5a..248af993 100644
--- a/libbsd.py
+++ b/libbsd.py
@@ -104,6 +104,7 @@ _defaults = {
         # (source, [targets..])
         # i386
         ('freebsd/sys/i386/include', ['freebsd/sys/x86/include', 'freebsd/sys/i386/include']),
+        ('freebsd/sys/i386/include/machine', ['freebsd/sys/x86/include/machine', 'freebsd/sys/i386/include/machine']),
         # arm64
         ('freebsd/sys/aarch64/include', ['freebsd/sys/aarch64/include', 'freebsd/sys/arm64/include']),
     ],
@@ -124,6 +125,7 @@ _defaults = {
     #  local path                               wildcard                           dest path
     [('rtemsbsd/include',                       '**/*.h',                          ''),
      ('rtemsbsd/@CPU@/include',                 '**/*.h',                          ''),
+     ('freebsd/sys/@CPU@/include',              '**/*.h',                           ''),
      ('freebsd/include',                        '**/*.h',                          ''),
      ('freebsd/sys/bsm',                        '**/*.h',                          'bsm'),
      ('freebsd/sys/cam',                        '**/*.h',                          'cam'),
@@ -224,7 +226,7 @@ class rtems(builder.Module):
                 'sys/arm/lpc/lpc_pwr.c',
                 'sys/dev/atsam/if_atsam.c',
                 'sys/dev/atsam/if_atsam_media.c',
-                'sys/dev/dw_mmc/dw_mmc.c',
+                #'sys/dev/dw_mmc/dw_mmc.c',
                 'sys/dev/ffec/if_ffec_mcf548x.c',
                 'sys/dev/ffec/if_ffec_mpc8xx.c',
                 'sys/dev/input/touchscreen/tsc_lpc32xx.c',
@@ -595,6 +597,16 @@ class fdt(builder.Module):
             ],
             mm.generator['source']()
         )
+        self.addCPUDependentFreeBSDHeaderFiles(
+            [
+                'sys/arm/include/_bus.h',
+                'sys/arm/include/bus.h',
+                'sys/arm64/include/_bus.h',
+                'sys/arm64/include/bus.h',
+                'sys/riscv/include/_bus.h',
+                'sys/riscv/include/bus.h',
+            ]
+        )
         self.addRTEMSKernelSourceFiles(
             [
                 'rtems/ofw_machdep.c',
@@ -1600,6 +1612,8 @@ class dev_nic(builder.Module):
                 'sys/sparc64/include/cpufunc.h',
                 'sys/sparc64/include/asi.h',
                 'sys/sparc64/include/pstate.h',
+                'sys/riscv/include/cpufunc.h',
+                'sys/riscv/include/riscvreg.h',
             ]
         )
         self.addKernelSpaceSourceFiles(
@@ -2937,6 +2951,10 @@ class pci(builder.Module):
                 'sys/x86/include/legacyvar.h',
                 'sys/x86/include/bus.h',
                 'sys/x86/include/pci_cfgreg.h',
+                'sys/powerpc/include/bus.h',
+                'sys/powerpc/include/_bus.h',
+                'sys/sparc64/include/bus.h',
+                'sys/sparc64/include/_bus.h',
             ]
         )
         self.addCPUDependentFreeBSDSourceFiles(
@@ -5299,7 +5317,8 @@ class imx(builder.Module):
 
     def generate(self):
         mm = self.manager
-        self.addKernelSpaceHeaderFiles(
+
+        self.addCPUDependentFreeBSDHeaderFiles(
             [
                 'sys/arm/freescale/imx/imx6_anatopreg.h',
                 'sys/arm/freescale/imx/imx6_anatopvar.h',
@@ -5308,7 +5327,8 @@ class imx(builder.Module):
                 'sys/arm/freescale/imx/imx_machdep.h',
             ]
         )
-        self.addKernelSpaceSourceFiles(
+        self.addCPUDependentFreeBSDSourceFiles(
+            [ 'arm' ],
             [
                 'sys/arm/freescale/imx/imx6_ccm.c',
                 'sys/arm/freescale/imx/imx6_usbphy.c',
diff --git a/waf_libbsd.py b/waf_libbsd.py
index 070d3eac..bbbae929 100644
--- a/waf_libbsd.py
+++ b/waf_libbsd.py
@@ -538,8 +538,6 @@ class Builder(builder.ModuleManager):
         if 'header-paths' in config:
             headerPaths = config['header-paths']
             cpu = bld.get_env()['RTEMS_ARCH']
-            if cpu == "i386":
-                cpu = 'x86'
             for headers in headerPaths:
                 # Get the dest path
                 ipath = os.path.join(arch_inc_path, headers[2])
-- 
2.17.1



More information about the devel mailing list