* Renamed the remaining C files to C++ files.

* Fixed some copyrights.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37250 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2010-06-25 08:30:17 +00:00
parent b6add3ffb6
commit 9209acd256
6 changed files with 40 additions and 32 deletions

View File

@ -26,7 +26,7 @@ KernelMergeObject boot_platform_atari_m68k_shell.o :
# cpu-specific stuff # cpu-specific stuff
# should be moved to boot/arch/m68k/... # should be moved to boot/arch/m68k/...
# XXX: add 020+68851 support # TODO: add 020+68851 support
KernelMergeObject boot_arch_m68k_030.o : KernelMergeObject boot_arch_m68k_030.o :
mmu_030.cpp mmu_030.cpp
: -fno-pic -Wno-unused -m68030 : -fno-pic -Wno-unused -m68030
@ -45,9 +45,9 @@ KernelMergeObject boot_arch_m68k_060.o :
KernelMergeObject boot_platform_atari_m68k_other.o : KernelMergeObject boot_platform_atari_m68k_other.o :
# shell.S # shell.S
start.c start.cpp
toscalls.c toscalls.cpp
debug.c debug.cpp
#bios.S #bios.S
console.cpp console.cpp
#serial.cpp #serial.cpp

View File

@ -5,6 +5,7 @@
#ifndef ATARI_MEMORY_MAP_H #ifndef ATARI_MEMORY_MAP_H
#define ATARI_MEMORY_MAP_H #define ATARI_MEMORY_MAP_H
/* the DMA-accessible RAM */ /* the DMA-accessible RAM */
/*#define ATARI_CHIPRAM_BASE 0x00000000*/ /*#define ATARI_CHIPRAM_BASE 0x00000000*/
/* actually, the first 2kB aren't usable */ /* actually, the first 2kB aren't usable */

View File

@ -1,5 +1,6 @@
/* /*
* Copyright 2003-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. * Copyright 2003-2010, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2008, François Revol, revol@free.fr. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
@ -27,11 +28,11 @@ extern void (*__ctor_end)(void);
extern uint8 __bss_start; extern uint8 __bss_start;
extern uint8 _end; extern uint8 _end;
extern int main(stage2_args *args); extern "C" int main(stage2_args *args);
void _start(void); extern "C" void _start(void);
uint32 sBootOptions; static uint32 sBootOptions;
static void static void
@ -52,7 +53,7 @@ call_ctors(void)
} }
uint32 extern "C" uint32
platform_boot_options(void) platform_boot_options(void)
{ {
#if 0 #if 0
@ -63,14 +64,15 @@ platform_boot_options(void)
} }
void extern "C" void
platform_start_kernel(void) platform_start_kernel(void)
{ {
static struct kernel_args *args = &gKernelArgs; static struct kernel_args *args = &gKernelArgs;
// something goes wrong when we pass &gKernelArgs directly // something goes wrong when we pass &gKernelArgs directly
// to the assembler inline below - might be a bug in GCC // to the assembler inline below - might be a bug in GCC
// or I don't see something important... // or I don't see something important...
addr_t stackTop = gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size; addr_t stackTop
= gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size;
//smp_init_other_cpus(); //smp_init_other_cpus();
//serial_cleanup(); //serial_cleanup();
@ -79,7 +81,8 @@ platform_start_kernel(void)
#warning M68K: stop ints #warning M68K: stop ints
dprintf("kernel entry at %lx\n", gKernelArgs.kernel_image.elf_header.e_entry); dprintf("kernel entry at %lx\n",
gKernelArgs.kernel_image.elf_header.e_entry);
asm volatile ( asm volatile (
"move.l %0,%%sp; " // move stack out of way "move.l %0,%%sp; " // move stack out of way
@ -106,22 +109,21 @@ platform_start_kernel(void)
} }
void extern "C" void
platform_exit(void) platform_exit(void)
{ {
// Terminate // Terminate
// XXX: Puntaes() instead ? // TODO: Puntaes() instead ?
Pterm0(); Pterm0();
} }
void extern "C" void
_start(void) _start(void)
{ {
stage2_args args; stage2_args args;
Bconout(DEV_CON, 'H'); Bconout(DEV_CON, 'H');
//asm("cld"); // Ain't nothing but a GCC thang. //asm("cld"); // Ain't nothing but a GCC thang.
//asm("fninit"); // initialize floating point unit //asm("fninit"); // initialize floating point unit
@ -141,11 +143,11 @@ _start(void)
Bconout(DEV_CON, 'K'); Bconout(DEV_CON, 'K');
console_init(); console_init();
Bconout(DEV_CON, 'U'); Bconout(DEV_CON, 'U');
dprintf("membot = %p\n", *TOSVAR_membot); dprintf("membot = %p\n", (void*)*TOSVAR_membot);
dprintf("memtop = %p\n", *TOSVAR_memtop); dprintf("memtop = %p\n", (void*)*TOSVAR_memtop);
dprintf("v_bas_ad= %p\n", *TOSVAR_v_bas_ad); dprintf("v_bas_ad = %p\n", *TOSVAR_v_bas_ad);
dprintf("phystop = %p\n", *TOSVARphystop); dprintf("phystop = %p\n", (void*)*TOSVARphystop);
dprintf("ramtop = %p\n", *TOSVARramtop); dprintf("ramtop = %p\n", (void*)*TOSVARramtop);
cpu_init(); cpu_init();
mmu_init(); mmu_init();
@ -161,4 +163,3 @@ _start(void)
//smp_init(); //smp_init();
main(&args); main(&args);
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de. * Copyright 2008, François Revol, revol@free.fr. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
@ -13,15 +13,17 @@
#include "toscalls.h" #include "toscalls.h"
void *gXHDIEntryPoint = NULL; void *gXHDIEntryPoint = NULL;
uint32 gXHDIVersion = 0; uint32 gXHDIVersion = 0;
NatFeatCookie *gNatFeatCookie = NULL; NatFeatCookie *gNatFeatCookie = NULL;
uint32 gDebugPrintfNatFeatID = 0; uint32 gDebugPrintfNatFeatID = 0;
/*! Maps TOS error codes to native errors /*! Maps TOS error codes to native errors
*/ */
status_t extern "C" status_t
toserror(int32 err) toserror(int32 err)
{ {
// generated from: // generated from:
@ -112,7 +114,7 @@ toserror(int32 err)
/*! Maps XHDI error codes to native errors /*! Maps XHDI error codes to native errors
* cf. http://toshyp.atari.org/010008.htm#XHDI_20error_20codes * cf. http://toshyp.atari.org/010008.htm#XHDI_20error_20codes
*/ */
status_t extern "C" status_t
xhdierror(int32 err) xhdierror(int32 err)
{ {
if (err <= -456) { if (err <= -456) {
@ -163,15 +165,18 @@ xhdierror(int32 err)
return toserror(err); return toserror(err);
} }
static void static void
dump_tos_cookie(const struct tos_cookie *c) dump_tos_cookie(const struct tos_cookie *c)
{ {
if (c) if (c != NULL) {
dprintf("%4.4s: 0x%08lx, %ld\n", (const char *)&c->cookie, c->ivalue, c->ivalue); dprintf("%4.4s: 0x%08lx, %ld\n", (const char *)&c->cookie, c->ivalue,
c->ivalue);
}
} }
void extern "C" void
dump_tos_cookies(void) dump_tos_cookies(void)
{ {
const tos_cookie *c = COOKIE_JAR; const tos_cookie *c = COOKIE_JAR;
@ -182,7 +187,7 @@ dump_tos_cookies(void)
} }
status_t extern "C" status_t
init_xhdi(void) init_xhdi(void)
{ {
const struct tos_cookie *c; const struct tos_cookie *c;
@ -201,7 +206,7 @@ init_xhdi(void)
} }
status_t extern "C" status_t
init_nat_features(void) init_nat_features(void)
{ {
gKernelArgs.arch_args.plat_args.atari.nat_feat.nf_get_id = NULL; gKernelArgs.arch_args.plat_args.atari.nat_feat.nf_get_id = NULL;
@ -221,7 +226,8 @@ init_nat_features(void)
return nat_features() ? B_OK : ENOENT; return nat_features() ? B_OK : ENOENT;
} }
void
extern "C" void
nat_feat_debugprintf(const char *str) nat_feat_debugprintf(const char *str)
{ {
if (gDebugPrintfNatFeatID) if (gDebugPrintfNatFeatID)

View File

@ -5,10 +5,10 @@
* Author: * Author:
* François Revol, revol@free.fr. * François Revol, revol@free.fr.
*/ */
#ifndef _TOSCALLS_H #ifndef _TOSCALLS_H
#define _TOSCALLS_H #define _TOSCALLS_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif