summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Sommer <jan.sommer@dlr.de>2020-04-17 10:24:08 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-04-17 13:18:06 +0200
commita69293ca57c5a42402d7bbc26c52c6221c7d2f43 (patch)
treecf97c3a0d0dd1fe4a96a28396e62fc838def1162
parenti386: Delete old machine dependent files (diff)
downloadrtems-libbsd-a69293ca57c5a42402d7bbc26c52c6221c7d2f43.tar.bz2
i386: Port to RTEMS
- Update imported files to compile rtems-libbsd for i386 based BSPs - Mostly commenting out parts which create compile or link errors in RTEMS, but aren't needed
-rw-r--r--freebsd/sbin/sysctl/sysctl.c8
-rw-r--r--freebsd/sys/dev/pci/pci_pci.c2
-rw-r--r--freebsd/sys/i386/include/machine/cpufunc.h2
-rw-r--r--freebsd/sys/kern/subr_gtaskqueue.c4
-rw-r--r--rtemsbsd/i386/include/machine/clock.h2
-rw-r--r--rtemsbsd/include/rtems/bsd/local/opt_acpi.h0
6 files changed, 18 insertions, 0 deletions
diff --git a/freebsd/sbin/sysctl/sysctl.c b/freebsd/sbin/sysctl/sysctl.c
index 30ebe5fd..035c1db2 100644
--- a/freebsd/sbin/sysctl/sysctl.c
+++ b/freebsd/sbin/sysctl/sysctl.c
@@ -69,7 +69,9 @@ static const char rcsid[] =
#endif
#if defined(__amd64__) || defined(__i386__)
+#ifndef __rtems__
#include <machine/pc/bios.h>
+#endif /* __rtems__ */
#endif
#include <assert.h>
@@ -832,6 +834,7 @@ S_efi_map(size_t l2, void *p)
#endif
#if defined(__amd64__) || defined(__i386__)
+#ifndef __rtems__
static int
S_bios_smap_xattr(size_t l2, void *p)
{
@@ -850,6 +853,7 @@ S_bios_smap_xattr(size_t l2, void *p)
(uintmax_t)smap->length);
return (0);
}
+#endif /* __rtems__ */
#endif
static int
@@ -1061,7 +1065,11 @@ show_var(int *oid, int nlen)
#endif
#if defined(__amd64__) || defined(__i386__)
else if (strcmp(fmt, "S,bios_smap_xattr") == 0)
+#ifndef __rtems__
func = S_bios_smap_xattr;
+#else /* __rtems__ */
+ func = NULL;
+#endif /* __rtems__ */
#endif
else {
func = NULL;
diff --git a/freebsd/sys/dev/pci/pci_pci.c b/freebsd/sys/dev/pci/pci_pci.c
index 43c71461..5ba3e9a0 100644
--- a/freebsd/sys/dev/pci/pci_pci.c
+++ b/freebsd/sys/dev/pci/pci_pci.c
@@ -1593,6 +1593,7 @@ pcib_attach_common(device_t dev)
sc->flags |= PCIB_SUBTRACTIVE;
break;
+#ifndef __rtems__
#if !(defined(NEW_PCIB) && defined(PCI_RES_BUS))
/* Compaq R3000 BIOS sets wrong subordinate bus number. */
case 0x00dd10de:
@@ -1620,6 +1621,7 @@ pcib_attach_common(device_t dev)
break;
}
#endif
+#endif /* __rtems__ */
}
if (pci_msi_device_blacklisted(dev))
diff --git a/freebsd/sys/i386/include/machine/cpufunc.h b/freebsd/sys/i386/include/machine/cpufunc.h
index a029da3b..e50ef9d7 100644
--- a/freebsd/sys/i386/include/machine/cpufunc.h
+++ b/freebsd/sys/i386/include/machine/cpufunc.h
@@ -233,11 +233,13 @@ fls(int mask)
#define HAVE_INLINE_FLSL
+#ifndef __rtems__
static __inline __pure2 int
flsl(long mask)
{
return (fls((int)mask));
}
+#endif /* __rtems__ */
#endif /* _KERNEL */
diff --git a/freebsd/sys/kern/subr_gtaskqueue.c b/freebsd/sys/kern/subr_gtaskqueue.c
index c061c6b0..a777e15d 100644
--- a/freebsd/sys/kern/subr_gtaskqueue.c
+++ b/freebsd/sys/kern/subr_gtaskqueue.c
@@ -744,7 +744,9 @@ taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *gtask,
__func__, gtask->gt_name, error);
} else
#else /* __rtems__ */
+#ifndef __i386__
BSD_ASSERT(irq == -1);
+#endif /* __i386__ */
#endif /* __rtems__ */
mtx_unlock(&qgroup->tqg_lock);
}
@@ -776,7 +778,9 @@ taskqgroup_attach_deferred(struct taskqgroup *qgroup, struct grouptask *gtask)
}
#else /* __rtems__ */
+#ifndef __i386__
BSD_ASSERT(gtask->gt_irq == -1);
+#endif /* __i386__ */
#endif /* __rtems__ */
qgroup->tqg_queue[qid].tgc_cnt++;
LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list);
diff --git a/rtemsbsd/i386/include/machine/clock.h b/rtemsbsd/i386/include/machine/clock.h
new file mode 100644
index 00000000..415e2b55
--- /dev/null
+++ b/rtemsbsd/i386/include/machine/clock.h
@@ -0,0 +1,2 @@
+extern int tsc_is_invariant;
+extern uint64_t tsc_freq;
diff --git a/rtemsbsd/include/rtems/bsd/local/opt_acpi.h b/rtemsbsd/include/rtems/bsd/local/opt_acpi.h
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/rtemsbsd/include/rtems/bsd/local/opt_acpi.h