summaryrefslogtreecommitdiff
path: root/host/arch/x86/lib/crossystem_arch.c
diff options
context:
space:
mode:
Diffstat (limited to 'host/arch/x86/lib/crossystem_arch.c')
-rw-r--r--host/arch/x86/lib/crossystem_arch.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/host/arch/x86/lib/crossystem_arch.c b/host/arch/x86/lib/crossystem_arch.c
index 3d1c8181..6a8f5a26 100644
--- a/host/arch/x86/lib/crossystem_arch.c
+++ b/host/arch/x86/lib/crossystem_arch.c
@@ -7,8 +7,10 @@
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
+#if !defined(__FreeBSD__)
#include <linux/nvram.h>
#include <linux/version.h>
+#endif
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
@@ -98,8 +100,10 @@ typedef struct {
static void VbFixCmosChecksum(FILE* file)
{
+#if !defined(__FreeBSD__)
int fd = fileno(file);
ioctl(fd, NVRAM_SETCKS);
+#endif
}
@@ -662,9 +666,11 @@ static int BraswellFindGpioChipOffset(unsigned *gpio_num, unsigned *offset,
if (uname(&host) == 0) {
if (sscanf(host.release, "%u.%u.", &maj, &min) == 2) {
+#if !defined(__FreeBSD__)
if (KERNEL_VERSION(maj, min, 0) >= KERNEL_VERSION(4, 16, 0) &&
*offset > 11)
*offset += 3;
+#endif
} else {
printf("Couldn't retrieve kernel version!\n");
ret = 0;