summaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
Diffstat (limited to 'dev')
-rw-r--r--dev/ide_atareg.h7
-rw-r--r--dev/ide_ctrl.cc2
2 files changed, 9 insertions, 0 deletions
diff --git a/dev/ide_atareg.h b/dev/ide_atareg.h
index a3a2bd604..5320529c8 100644
--- a/dev/ide_atareg.h
+++ b/dev/ide_atareg.h
@@ -33,7 +33,14 @@
#ifndef _DEV_ATA_ATAREG_H_
#define _DEV_ATA_ATAREG_H_
+#if defined(linux)
+#include <endian.h>
+#else
+#include <machine/endian.h>
+#endif
+
#define ATA_BYTE_ORDER LITTLE_ENDIAN
+
/*
* Drive parameter structure for ATA/ATAPI.
* Bit fields: WDC_* : common to ATA/ATAPI
diff --git a/dev/ide_ctrl.cc b/dev/ide_ctrl.cc
index 964bd01c2..defeb641b 100644
--- a/dev/ide_ctrl.cc
+++ b/dev/ide_ctrl.cc
@@ -103,6 +103,8 @@ IdeController::IdeController(Params *p)
// setup the disks attached to controller
memset(disks, 0, sizeof(IdeDisk *) * 4);
+ dev[0] = 0;
+ dev[1] = 0;
if (params()->disks.size() > 3)
panic("IDE controllers support a maximum of 4 devices attached!\n");