Remove obsolete PLATFORM_X86 and PLATFORM_X64 macros.

This commit is contained in:
Jonas 'Sortie' Termansen 2013-06-20 14:35:40 +02:00
parent c36b35adc2
commit b88853de81
9 changed files with 12 additions and 62 deletions

View File

@ -109,10 +109,7 @@
/*#define __SORTIX_SHOW_UNIMPLEMENTED*/
#if !defined(_LIBC_HACK_FEATURE_NO_DECLARATIONS)
#include <sortix/bits.h>
#include <sys/__/types.h>
#endif
#undef _LIBC_HACK_FEATURE_NO_DECLARATIONS

View File

@ -216,7 +216,7 @@ addr_t Construct32(Process* process, const uint8_t* file, size_t filelen)
addr_t Construct64(Process* process, const uint8_t* file, size_t filelen)
{
#ifndef PLATFORM_X64
#if !defined(__x86_64__)
(void) process;
(void) file;
(void) filelen;

View File

@ -1,31 +0,0 @@
/*******************************************************************************
Copyright(C) Jonas 'Sortie' Termansen 2011.
This file is part of Sortix.
Sortix is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
Sortix is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
Sortix. If not, see <http://www.gnu.org/licenses/>.
sortix/bits.h
Declares the current platform macro.
*******************************************************************************/
#if !defined(PLATFORM_X86) && !defined(PLATFORM_X64)
#if defined(__x86_64__)
#define PLATFORM_X64
#else
#define PLATFORM_X86
#endif
#endif

View File

@ -82,9 +82,9 @@ __BEGIN_DECLS
own state into such a structure and calling tfork. Note that this structure
is highly platform specific, portable code should use the standard threading
facilities combined with sfork if possible. */
#ifdef PLATFORM_X86
#if defined(__i386__)
typedef struct tforkregs_x86 tforkregs_t;
#elif defined(PLATFORM_X64)
#elif defined(__x86_64__)
typedef struct tforkregs_x64 tforkregs_t;
#else
#warning No tforkregs_cpu structure declared

View File

@ -38,26 +38,12 @@ typedef uintptr_t addr_t;
#define unlikely(x) __builtin_expect((x),0)
#define STATIC_ASSERT(condition) static_assert(condition, #condition)
// The following declarations should not be used if possible. They were part of
// what libmaxsi's old platform.h header declared and the kernel continues to
// depend on it.
#if !defined(PLATFORM_X64) && defined(__x86_64__)
#define PLATFORM_X64
#elif !defined(PLATFORM_X86) && defined(__i386__)
#define PLATFORM_X86
#endif
#if !defined(CPU) && defined(PLATFORM_X86)
#if !defined(CPU) && defined(__i386__)
#define CPU X86
#endif
#if !defined(CPU) && defined(PLATFORM_X64)
#if !defined(CPU) && defined(__x86_64__)
#define CPU X64
#endif
#if !defined(CPU_FAMILY) && defined(PLATFORM_X86) || defined(PLATFORM_X64)
#define PLATFORM_X86_FAMILY
#define CPU_FAMILY X86_FAMILY
#endif
#endif

View File

@ -229,9 +229,9 @@ void CrashHandler(CPU::InterruptRegisters* regs)
Log::Print("\n");
}
#ifdef PLATFORM_X64
#if defined(__x86_64__)
addr_t ip = regs->rip;
#else
#elif defined(__i386__)
addr_t ip = regs->eip;
#endif

View File

@ -618,9 +618,9 @@ static void BootThread(void* /*user*/)
}
}
#if defined(PLATFORM_X86)
#if defined(__i386__)
#define CPUTYPE_STR "i486-sortix"
#elif defined(PLATFORM_X64)
#elif defined(__x86_64__)
#define CPUTYPE_STR "x86_64-sortix"
#else
#error No cputype environmental variable provided here.

View File

@ -128,7 +128,7 @@ namespace Sortix
addr_t base = (addr_t) mmap->addr;
size_t length = Page::AlignDown(mmap->len);
#ifdef PLATFORM_X86
#if defined(__i386__)
// Figure out if the memory area is addressable (are our pointers big enough?)
if ( 0xFFFFFFFFULL < mmap->addr ) { continue; }
if ( 0xFFFFFFFFULL < mmap->addr + mmap->len ) { length = 0x100000000ULL - mmap->addr; }

View File

@ -92,11 +92,9 @@ namespace Sortix
}
}
#ifdef PLATFORM_X86
#if defined(__i386__)
#include "../x86/memorymanagement.h"
#endif
#ifdef PLATFORM_X64
#elif defined(__x86_64__)
#include "../x64/memorymanagement.h"
#endif