Merge branch 'master' of github.com:MTGos/mtgos-3ds9

This commit is contained in:
Morten Delenk 2017-12-09 19:35:56 +00:00
commit 6214398f1e
6 changed files with 9 additions and 8 deletions

View file

@ -30,8 +30,8 @@ LOAD_PROFILE(${ARCH} ${SYSTEM})
ADD_EXECUTABLE(kernel ${PLATFORM_SRCS} ${ISA_SRCS} ${GENERIC_SRCS})
SET(CMAKE_ASM-ATT_COMPILE_OBJECT
"<CMAKE_C_COMPILER> -g -x assembler-with-cpp -I../../ -I../../libk/include/ -I../../kernel/src/include/ ${ISA_ASM_FLAGS} ${PLATFORM_ASM_FLAGS} -c -o <OBJECT> <SOURCE>")
SET(CMAKE_C_FLAGS "-g -w -Werror -Wno-unused -Wno-unused-variable -fno-use-cxa-atexit -std=c11 -ffreestanding -ffunction-sections -fdata-sections -I../../ -I../../libk/include/ -I../../kernel/src/include/ ${ISA_C_FLAGS} ${PLATFORM_C_FLAGS}")
SET(CMAKE_CXX_FLAGS "-g -w -Werror -Wno-unused -Wno-unused-variable -fno-use-cxa-atexit -ffreestanding -fno-rtti -fno-exceptions -std=gnu++17 -ffunction-sections -fdata-sections -I../../ -I../../libk/include/ -I../../kernel/src/include/ ${ISA_CXX_FLAGS} ${PLATFORM_CXX_FLAGS}")
SET(CMAKE_C_FLAGS "-g --all-warnings -Werror -Wno-error=reorder -Wno-unused -Wno-unused-variable -fno-use-cxa-atexit -std=c11 -ffreestanding -ffunction-sections -fdata-sections -I../../ -I../../libk/include/ -I../../kernel/src/include/ ${ISA_C_FLAGS} ${PLATFORM_C_FLAGS}")
SET(CMAKE_CXX_FLAGS "-g --all-warnings -Werror -Wno-error=reorder -Wno-unused -Wno-unused-variable -fno-use-cxa-atexit -ffreestanding -fno-rtti -fno-exceptions -std=gnu++17 -ffunction-sections -fdata-sections -I../../ -I../../libk/include/ -I../../kernel/src/include/ ${ISA_CXX_FLAGS} ${PLATFORM_CXX_FLAGS}")
SET_TARGET_PROPERTIES(kernel PROPERTIES LINK_FLAGS
"-T ../../kernel/${PLATFORM_LAYOUT} -N ${ISA_LINKER_FLAGS} ${PLATFORM_LINKER_FLAGS} -nostdlib -nodefaultlibs -Wl,--gc-sections -ffreestanding")
TARGET_LINK_LIBRARIES(kernel gcc)

View file

@ -22,7 +22,7 @@ void print_regdump(cpu_state *state) {
(*out << " returnAddr: ").puti(state->returnAddr);
*out << "\n";
}
extern "C" void panic2(char *msg, cpu_state *state);
extern "C" void panic2(const char *msg, cpu_state *state);
extern "C" cpu_state *handleINT(int number, cpu_state *state) {
*out << "Interrupt";
out->puti(number);
@ -49,7 +49,7 @@ extern "C" cpu_state *handleINT(int number, cpu_state *state) {
}
return new_cpu;
}
extern "C" void panic2(char *msg, cpu_state *state) {
extern "C" void panic2(const char *msg, cpu_state *state) {
out->setColor(Color::RED);
*out << "KERNEL PANIC: " << msg << "\n";
print_regdump(state);

View file

@ -37,7 +37,7 @@ IRQ_IO::~IRQ_IO() {}
void* IRQ_IO::handleIRQ(void *data) {
//Call IRQ handlers until all IRQs are done.
int bit;
while(bit=__builtin_ffs(*((volatile int*)0x10001004))) {
while((bit=__builtin_ffs(*((volatile int*)0x10001004)))) {
data = handlers[bit-1](data);
*((volatile int*)0x10001004)=(1<<(bit-1));
}

View file

@ -17,4 +17,5 @@ extern "C" int __cxa_guard_acquire(__guard *g) {
}
extern "C" int __cxa_guard_release(__guard *g) {
*(char *)g = 1;
return 0;
}

View file

@ -12,7 +12,7 @@ void setMainTTY(TTY *obj);
/**
* Halts the kernel due to a unresolvable error
*/
extern "C" void panic(const char* s);
extern "C" __attribute__((noreturn)) void panic(const char* s);
#if !defined(__LITTLE_ENDIAN__) || !defined(__BIG_ENDIAN__)
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__

View file

@ -42,13 +42,13 @@ auto PMM::operator,(size_t no_pages) -> phys_t {
PMM_ent *curr=head;
while(curr) {
//Is curr+n pages free?
if((curr->val+((no_pages-1)*page_size)) in this) {
if((curr->val+((no_pages-1)*page_size)) in *this) {
//We're onto something
bool notfound=false;
phys_t i;
size_t j;
for(i=curr->val,j=0; j<no_pages; i+=page_size, j++) {
if(!(i in this)) {
if(!(i in *this)) {
notfound=true;
break;
}