Commit a9671ff5 authored by Colin Finck's avatar Colin Finck
Browse files

The first real AArch64 bringup commit for HermitCore-rs

* Split the CMake files into an architecture-independent and an architecture-dependent part.
  This overhaul of the build system also removes the custom "module system", which doesn't make much sense for a Rust kernel and doesn't work well with such a split configuration.
* Add an aarch64-unknown-hermit-kernel.json target for Xargo.
* Implement basic IRQ and serial port functions for AArch64 to get a first output.
* Copy the 4-level paging from x86_64 to AArch64 and remove the parts relying on the "x86" crate.
  While this still needs some work to get the names and flags right, 4-level paging should generally work on AArch64 with the same concepts that are used for x86_64.
* Comment out and stub out many functions for AArch64 to let is somewhat compile.
* Redefine core_id as a CPU number that is guaranteed to be sequential to make it architecture-independent.
  For x86_64, this number is now translated to a Local APIC ID in the "apic" module only.
* Add a per-architecture TaskStacks structure, which contains "stack" and "ist" on x86_64 and only "stack" on AArch64.
* Add a per-architecture network_adapter_init function to initialize RTL8139 only for x86_64.
* Get rid of the top-level "arch" directory and put the reasonable architecture-dependent include files into /include/hermit/<ARCH>, all prefixed with "arch_".
* Make the inclusion of some crates dependent on the target architecture.
* Rename get_number_of_processors to get_processor_count and make it return a usize.
parent c4b05b6f
......@@ -5,33 +5,6 @@ macro(include_guard)
set("_INCLUDE_GUARD_${CMAKE_CURRENT_LIST_FILE}" INCLUDED)
endmacro(include_guard)
macro(add_kernel_module_sources MODULE SOURCE_GLOB)
file(GLOB SOURCES "${SOURCE_GLOB}")
if("${SOURCES}" STREQUAL "")
message(FATAL_ERROR "Module '${MODULE}' has no sources")
endif()
# make sure modules are unique, this is needed of multiple sources
# are added to the same module
list(APPEND _KERNEL_MODULES "${MODULE}")
list(REMOVE_DUPLICATES _KERNEL_MODULES)
# append sources for module
list(APPEND "_KERNEL_SOURCES_${MODULE}" "${SOURCES}")
endmacro(add_kernel_module_sources)
macro(get_kernel_module_sources VAR MODULE)
set(${VAR} ${_KERNEL_SOURCES_${MODULE}})
endmacro(get_kernel_module_sources)
macro(get_kernel_modules VAR)
set(${VAR} ${_KERNEL_MODULES})
endmacro(get_kernel_modules)
# find program in /toolchain/dir/prefix-NAME, only supply NAME
function(find_toolchain_program NAME)
......@@ -50,12 +23,6 @@ function(find_toolchain_program NAME)
endif()
endfunction(find_toolchain_program)
macro(set_parent VAR VALUE)
set(${VAR} ${VALUE} PARENT_SCOPE)
set(${VAR} ${VALUE})
endmacro(set_parent)
function(get_cmd_variables VAR)
set(_OUTPUT "")
......
......@@ -46,22 +46,6 @@ if(NOT CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/HermitCore-Toolchain-${HERMIT_ARCH}${_BOOTSTRAP_ARCH_SUFFIX}.cmake)
endif()
# NASM is only required on x86_64
if("${HERMIT_ARCH}" STREQUAL "x86_64")
# NASM detection will change binary format depending on host system, but
# we only want to generate elf64 for HermitCore
# Note: Has to be set *before* ASM_NASM is enabled
set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
enable_language(ASM_NASM)
# NASM hack, because it requires include paths to have a trailing /, whereas
# CMake explicitly will remove it when adding includes the usual way
# Note: Has to be set *after* ASM_NASM is enabled
set(CMAKE_ASM_NASM_FLAGS
"${CMAKE_ASM_NASM_FLAGS} -I ${CMAKE_BINARY_DIR}/include/")
endif()
if(MTUNE)
set(HERMIT_KERNEL_FLAGS ${HERMIT_KERNEL_FLAGS} -mtune=${MTUNE})
set(HERMIT_APP_FLAGS ${HERMIT_APP_FLAGS} -mtune=${MTUNE})
......@@ -70,7 +54,7 @@ endif()
set(HERMIT_KERNEL_INCLUDES
${CMAKE_BINARY_DIR}/include
${HERMIT_ROOT}/include
${HERMIT_ROOT}/arch/${HERMIT_ARCH}/include
${HERMIT_ROOT}/include/hermit/${HERMIT_ARCH}
${HERMIT_ROOT}/lwip/src/include)
# HACK: when CMake detects compilers it taints CMAKE_INSTALL_PREFIX, so in
......
cmake_minimum_required(VERSION 3.7)
configure_file(config.asm.in config.asm)
configure_file(config.h.in config.h)
# Show include files in IDE
file(GLOB_RECURSE HERMIT_INCLUDES "*")
......
/*
* Copyright (c) 2010, Stefan Lankes, RWTH Aachen University
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @author Stefan Lankes
* @brief Functions related to processor IO
*
* This file contains inline functions for processor IO operations.
*/
#ifndef __ARCH_IO_H__
#define __ARCH_IO_H__
#ifdef __cplusplus
extern "C" {
#endif
/** @brief Read a byte from an IO port
*
* @param _port The port you want to read from
* @return The value which reads out from this port
*/
inline static unsigned char inportb(unsigned short _port) {
return *((unsigned char*)(size_t)_port);
}
/** @brief Read a word (2 byte) from an IO port
*
* @param _port The port you want to read from
* @return The value which reads out from this port
*/
inline static unsigned short inportw(unsigned short _port) {
return *((unsigned short*)(size_t)_port);
}
/** @brief Read a double word (4 byte) from an IO port
*
* @param _port The port you want to read from
* @return The value which reads out from this port
*/
inline static unsigned int inportl(unsigned short _port) {
return *((unsigned int*)(size_t)_port);
}
/** @brief Write a byte to an IO port
*
* @param _port The port you want to write to
* @param _data the 1 byte value you want to write
*/
inline static void outportb(unsigned short _port, unsigned char _data) {
*((unsigned char*)(size_t)_port) = _data;
}
/** @brief Write a word (2 bytes) to an IO port
*
* @param _port The port you want to write to
* @param _data the 2 byte value you want to write
*/
inline static void outportw(unsigned short _port, unsigned short _data) {
*((unsigned short*)(size_t)_port) = _data;
}
/** @brief Write a double word (4 bytes) to an IO port
*
* @param _port The port you want to write to
* @param _data the 4 byte value you want to write
*/
inline static void outportl(unsigned short _port, unsigned int _data)
{
*((unsigned int*)(size_t)_port) = _data;
}
#ifdef __cplusplus
}
#endif
#endif
......@@ -30,7 +30,7 @@
* @file arch/x86/include/asm/limits.h
* @brief Define constants related to numerical value-ranges of variable types
*
* This file contains define constants for the numerical
* This file contains define constants for the numerical
* ranges of the most typical variable types.
*/
......@@ -42,43 +42,43 @@ extern "C" {
#endif
/** Number of bits in a char */
#define CHAR_BIT 8
#define CHAR_BIT 8
/** Maximum value for a signed char */
#define SCHAR_MAX 0x7f
#define SCHAR_MAX 0x7f
/** Minimum value for a signed char */
#define SCHAR_MIN (-0x7f - 1)
#define SCHAR_MIN (-0x7f - 1)
/** Maximum value for an unsigned char */
#define UCHAR_MAX 0xff
#define UCHAR_MAX 0xff
/** Maximum value for an unsigned short */
#define USHRT_MAX 0xffff
#define USHRT_MAX 0xffff
/** Maximum value for a short */
#define SHRT_MAX 0x7fff
#define SHRT_MAX 0x7fff
/** Minimum value for a short */
#define SHRT_MIN (-0x7fff - 1)
#define SHRT_MIN (-0x7fff - 1)
/** Maximum value for an unsigned int */
#define UINT_MAX 0xffffffffU
#define UINT_MAX 0xffffffffU
/** Maximum value for an int */
#define INT_MAX 0x7fffffff
#define INT_MAX 0x7fffffff
/** Minimum value for an int */
#define INT_MIN (-0x7fffffff - 1)
#define INT_MIN (-0x7fffffff - 1)
/** Maximum value for an unsigned long */
#define ULONG_MAX 0xffffffffUL
#define ULONG_MAX 0xffffffffUL
/** Maximum value for a long */
#define LONG_MAX 0x7fffffffL
#define LONG_MAX 0x7fffffffL
/** Minimum value for a long */
#define LONG_MIN (-0x7fffffffL - 1)
#define LONG_MIN (-0x7fffffffL - 1)
/** Maximum value for an unsigned long long */
#define ULLONG_MAX 0xffffffffffffffffULL
/** Maximum value for a long long */
#define LLONG_MAX 0x7fffffffffffffffLL
#define LLONG_MAX 0x7fffffffffffffffLL
/** Minimum value for a long long */
#define LLONG_MIN (-0x7fffffffffffffffLL - 1)
#define LLONG_MIN (-0x7fffffffffffffffLL - 1)
#ifdef __cplusplus
}
......
/*
* Copyright (c) 2010, Stefan Lankes, RWTH Aachen University
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @author Stefan Lankes
* @file arch/x86/include/asm/stddef.h
* @brief Standard datatypes
*
* This file contains typedefs for standard datatypes for numerical and character values.
*/
#ifndef __ARCH_STDDEF_H__
#define __ARCH_STDDEF_H__
#ifdef __cplusplus
extern "C" {
#endif
// A popular type for addresses
typedef unsigned long long size_t;
/// Pointer differences
typedef long long ptrdiff_t;
#ifdef __KERNEL__
typedef long long ssize_t;
typedef long long off_t;
#endif
/// Unsigned 64 bit integer
typedef unsigned long uint64_t;
/// Signed 64 bit integer
typedef long int64_t;
/// Unsigned 32 bit integer
typedef unsigned int uint32_t;
/// Signed 32 bit integer
typedef int int32_t;
/// Unsigned 16 bit integer
typedef unsigned short uint16_t;
/// Signed 16 bit integer
typedef short int16_t;
/// Unsigned 8 bit integer (/char)
typedef unsigned char uint8_t;
/// Signed 8 bit integer (/char)
typedef char int8_t;
/// 16 bit wide char type
typedef unsigned short wchar_t;
#ifndef _WINT_T
#define _WINT_T
typedef wchar_t wint_t;
#endif
/// This defines registers, which are saved for a "user-level" context swicth
typedef struct mregs {
/// TODO
uint64_t dummy;
} mregs_t;
typedef struct {
void *ss_sp; /* Stack base or pointer. */
} stack_t;
#ifdef __cplusplus
}
#endif
#endif
#define KERNEL_STACK_SIZE @KERNEL_STACK_SIZE@
......@@ -34,7 +34,7 @@
* @brief Definition of basic data types
*/
#include <asm/stddef.h>
#include <arch_stddef.h>
#ifdef __cplusplus
extern "C" {
......
......@@ -133,7 +133,7 @@ int sys_spinlock_irqsave_init(HermitSpinlockIrqSave** lock);
int sys_spinlock_irqsave_destroy(HermitSpinlockIrqSave* lock);
int sys_spinlock_irqsave_lock(HermitSpinlockIrqSave* lock);
int sys_spinlock_irqsave_unlock(HermitSpinlockIrqSave* lock);
int sys_spawn(tid_t* id, entry_point_t func, void* arg, unsigned char prio, unsigned int core_id);
int sys_spawn(tid_t* id, entry_point_t func, void* arg, unsigned char prio, size_t core_id);
int sys_clock_getres(unsigned long clock_id, HermitTimespec* res);
int sys_clock_gettime(unsigned long clock_id, HermitTimespec* tp);
int sys_clock_nanosleep(unsigned long clock_id, int flags, const HermitTimespec* rqtp, HermitTimespec* rmtp);
......@@ -141,7 +141,7 @@ int sys_clock_settime(unsigned long clock_id, const HermitTimespec* tp);
int sys_clone(tid_t* id, void* ep, void* argv);
int sys_getpagesize(void);
int sys_gettimeofday(HermitTimeval* tp, void* tz);
unsigned int sys_get_number_of_processors(void);
size_t sys_get_processor_count(void);
unsigned short sys_get_processor_frequency(void);
off_t sys_lseek(int fd, off_t offset, int whence);
int sys_setitimer(int which, const HermitItimerval* value, HermitItimerval* ovalue);
......
/*
* Copyright (c) 2010, Stefan Lankes, RWTH Aachen University
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @author Stefan Lankes
* @brief Functions related to processor IO
*
* This file contains inline functions for processor IO operations.
*/
#ifndef __ARCH_IO_H__
#define __ARCH_IO_H__
#ifdef __cplusplus
extern "C" {
#endif
/** @brief Read a byte from an IO port
*
* @param _port The port you want to read from
* @return The value which reads out from this port
*/
inline static unsigned char inportb(unsigned short _port) {
unsigned char rv;
asm volatile("inb %1, %0":"=a"(rv):"dN"(_port));
return rv;
}
/** @brief Read a word (2 byte) from an IO port
*
* @param _port The port you want to read from
* @return The value which reads out from this port
*/
inline static unsigned short inportw(unsigned short _port) {
unsigned short rv;
asm volatile("inw %1, %0":"=a"(rv):"dN"(_port));
return rv;
}
/** @brief Read a double word (4 byte) from an IO port
*
* @param _port The port you want to read from
* @return The value which reads out from this port
*/
inline static unsigned int inportl(unsigned short _port) {
unsigned int rv;
asm volatile("inl %1, %0":"=a"(rv):"dN"(_port));
return rv;
}
/** @brief Write a byte to an IO port
*
* @param _port The port you want to write to
* @param _data the 1 byte value you want to write
*/
inline static void outportb(unsigned short _port, unsigned char _data) {
asm volatile("outb %1, %0"::"dN"(_port), "a"(_data));
}
/** @brief Write a word (2 bytes) to an IO port
*
* @param _port The port you want to write to
* @param _data the 2 byte value you want to write
*/
inline static void outportw(unsigned short _port, unsigned short _data) {
asm volatile("outw %1, %0"::"dN"(_port), "a"(_data));
}
/** @brief Write a double word (4 bytes) to an IO port
*
* @param _port The port you want to write to
* @param _data the 4 byte value you want to write
*/
inline static void outportl(unsigned short _port, unsigned int _data)
{
asm volatile("outl %1, %0"::"dN"(_port), "a"(_data));
}
#ifdef __cplusplus
}
#endif
#endif
/*
* Copyright (c) 2010, Stefan Lankes, RWTH Aachen University
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* author Stefan Lankes
* @file arch/x86/include/asm/limits.h
* @brief Define constants related to numerical value-ranges of variable types
*
* This file contains define constants for the numerical
* ranges of the most typical variable types.
*/
#ifndef __ARCH_LIMITS_H__
#define __ARCH_LIMITS_H__
#ifdef __cplusplus
extern "C" {
#endif
/** Number of bits in a char */
#define CHAR_BIT 8
/** Maximum value for a signed char */
#define SCHAR_MAX 0x7f
/** Minimum value for a signed char */
#define SCHAR_MIN (-0x7f - 1)
/** Maximum value for an unsigned char */
#define UCHAR_MAX 0xff
/** Maximum value for an unsigned short */
#define USHRT_MAX 0xffff
/** Maximum value for a short */
#define SHRT_MAX 0x7fff
/** Minimum value for a short */
#define SHRT_MIN (-0x7fff - 1)
/** Maximum value for an unsigned int */
#define UINT_MAX 0xffffffffU
/** Maximum value for an int */
#define INT_MAX 0x7fffffff
/** Minimum value for an int */
#define INT_MIN (-0x7fffffff - 1)
/** Maximum value for an unsigned long */
#define ULONG_MAX 0xffffffffUL
/** Maximum value for a long */
#define LONG_MAX 0x7fffffffL
/** Minimum value for a long */
#define LONG_MIN (-0x7fffffffL - 1)
/** Maximum value for an unsigned long long */
#define ULLONG_MAX 0xffffffffffffffffULL
/** Maximum value for a long long */
#define LLONG_MAX 0x7fffffffffffffffLL
/** Minimum value for a long long */
#define LLONG_MIN (-0x7fffffffffffffffLL - 1)
#ifdef __cplusplus
}
#endif
#endif
......@@ -40,44 +40,6 @@
extern "C" {
#endif
#define per_core(var) ({ \
typeof(var) ptr; \
switch (sizeof(var)) { \
case 4: \
asm volatile ("movl %%gs:(" #var "), %0" : "=r"(ptr)); \
break; \
case 8: \
asm volatile ("movq %%gs:(" #var "), %0" : "=r"(ptr)); \
break; \
} \
ptr; })
#define set_per_core(var, value) ({ \
switch (sizeof(var)) { \
case 4: asm volatile ("movl %0, %%gs:(" #var ")" :: "r"(value)); \
break; \
case 8: \
asm volatile ("movq %0, %%gs:(" #var ")" :: "r"(value)); \
break; \
} \
})
#if __SIZEOF_POINTER__ == 4
#define KERNEL_SPACE (1UL << 30) /* 1 GiB */
/// This type is used to represent the size of an object.
typedef unsigned long size_t;
/// Pointer differences
typedef long ptrdiff_t;
/// It is similar to size_t, but must be a signed type.
typedef long ssize_t;
/// The type represents an offset and is similar to size_t, but must be a signed type.
typedef long off_t;
#elif __SIZEOF_POINTER__ == 8
#define KERNEL_SPACE (1ULL << 30)
// A popular type for addresses
typedef unsigned long long size_t;
/// Pointer differences
......@@ -86,9 +48,6 @@ typedef long long ptrdiff_t;
typedef long long ssize_t;
typedef long long off_t;
#endif