aboutsummaryrefslogtreecommitdiff
path: root/ports/powerpc/unistd.h
diff options
context:
space:
mode:
authorMichael Neuling2019-08-22 10:21:48 +1000
committerDamien George2019-10-22 22:45:33 +1100
commit079cc940a68b3b3b9d47d4402267393a528a0477 (patch)
treecf124486508818ab74f85625ab973e01a1db4ad4 /ports/powerpc/unistd.h
parent19ca025b45b3160a2ad5a20014cdd7bf0053ff9d (diff)
powerpc: Add initial port to bare metal PowerPC arch.
Runs in microwatt (GHDL and FPGA) and qemu. Port done initially by Michael Neuling, with help from Anton Blanchard and Jordan Niethe.
Diffstat (limited to 'ports/powerpc/unistd.h')
-rw-r--r--ports/powerpc/unistd.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/ports/powerpc/unistd.h b/ports/powerpc/unistd.h
new file mode 100644
index 000000000..88e3b2721
--- /dev/null
+++ b/ports/powerpc/unistd.h
@@ -0,0 +1,36 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2019, Michael Neuling, IBM Corporation.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+#ifndef MICROPY_INCLUDED_POWERPC_UNISTD_H
+#define MICROPY_INCLUDED_POWERPC_UNISTD_H
+
+// powerpc gcc compiler doesn't seem to have unistd.h file
+
+#define SEEK_SET 0
+#define SEEK_CUR 1
+
+typedef int ssize_t;
+
+#endif // MICROPY_INCLUDED_POWERPC_UNISTD_H