From f64d2c0eaab73a834a98beaba6d5f3720cb6a203 Mon Sep 17 00:00:00 2001 From: jjak0b <32840785+jjak0b@users.noreply.github.com> Date: Sat, 21 Mar 2020 20:22:44 +0100 Subject: [PATCH] Fix warning di conversione e libdiv #15 Aggiunta Libdiv per compilazione uarm --- SConstruct | 4 +++- src/main.c | 2 +- src/scheduler/scheduler.c | 10 ++++++---- src/test.c | 10 +++++----- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/SConstruct b/SConstruct index 99bf9e4..81c301b 100644 --- a/SConstruct +++ b/SConstruct @@ -119,6 +119,7 @@ umps_sysinit_f = sysumps_s + '/sysinit' ##UARM dedicated crtso_uarm = uarm_d + '/crtso' libuarm = uarm_d + '/libuarm' +libdiv_uarm = uarm_d + '/libdiv' ##UMPS dedicated crtso_umps = umps_d + '/crtso' @@ -183,7 +184,7 @@ for i,x in enumerate(umps_headers_list): shared_noext_list = [main_f, p15test_f, test_f, shared_f, scheduler_f, pcb_f, handler_f, terminal_f, printer_f, device_f, asl_f] # Per favore, lascia i file crtso____ e lib_____ per ultimi -uarm_noext_list = [uarm_shared_f, uarm_sysinit_f, crtso_uarm, libuarm] +uarm_noext_list = [uarm_shared_f, uarm_sysinit_f, crtso_uarm, libuarm, libdiv_uarm ] umps_noext_list = [umps_shared_f, umps_sysinit_f, crtso_umps, libumps] # Source .C lists @@ -199,6 +200,7 @@ for x in uarm_noext_list: uarm_c_list.append(x+C_EXT) uarm_c_list[-1] = uarm_c_list[-1].replace(C_EXT, S_EXT_LOW) uarm_c_list[-2] = uarm_c_list[-2].replace(C_EXT, S_EXT_LOW) +uarm_c_list[-3] = uarm_c_list[-3].replace(C_EXT, S_EXT_LOW) for x in umps_noext_list: umps_c_list.append(x+C_EXT) diff --git a/src/main.c b/src/main.c index 8a55f69..cfd5ffa 100644 --- a/src/main.c +++ b/src/main.c @@ -19,7 +19,7 @@ #include "test.h" /* test fase */ -void main(){ +int main(){ // Inizialializzazione del sistema //---------------------------------------------------- initAreas(); diff --git a/src/scheduler/scheduler.c b/src/scheduler/scheduler.c index c639f5b..547f491 100644 --- a/src/scheduler/scheduler.c +++ b/src/scheduler/scheduler.c @@ -4,7 +4,7 @@ static scheduler_t *scheduler; -int scheduler_init() { +void scheduler_init() { static scheduler_t scheduler_struct; /* Tutte le funzioni di questo Header fanno riferimento implicito a questa struttura */ mkEmptyProcQ( &scheduler_struct.ready_queue ); scheduler_struct.running_p = NULL; @@ -56,6 +56,7 @@ int scheduler_StateToReady( state_t* state ) { int scheduler_StateToWaiting() { /* TODO */ + return 0; } int scheduler_StateToTerminate() { @@ -74,15 +75,16 @@ int scheduler_CreateProcess( function_t func, int priority ) { if( pcb == NULL ) { return -1; } - SetPC( &pcb->p_s, func ); - SetLR( &pcb->p_s, scheduler_StateToTerminate ); /* Temporaneamente questo è l'indirizzo di ritorno */ + SetPC( &pcb->p_s, (memaddr)func ); + SetLR( &pcb->p_s, (memaddr)scheduler_StateToTerminate ); /* Temporaneamente questo è l'indirizzo di ritorno */ /* TODO: SetSP( ); SP dovrebbe essere dinamicamente in base al gestore della memoria */ /* TODO: flag status, ecc ... */ EnableKernelMode( &pcb->p_s, FALSE ); scheduler_AddProcess( pcb ); + return 0; } -int scheduler_AddProcess( pcb_t *p ) { +void scheduler_AddProcess( pcb_t *p ) { insertProcQ( &scheduler->ready_queue, p ); } \ No newline at end of file diff --git a/src/test.c b/src/test.c index cbf55ac..3c67129 100644 --- a/src/test.c +++ b/src/test.c @@ -17,10 +17,10 @@ void test_init() { EnableKernelMode( &dummy->p_s, TRUE ); #ifdef TARGET_UARM - SetSP( &dummy->p_s, RAM_TOP - (FRAME_SIZE * i ) ); + SetSP( &dummy->p_s, (memaddr)RAM_TOP - (FRAME_SIZE * i ) ); #endif #ifdef TARGET_UMPS - SetSP( &dummy->p_s, NULL ); /* TODO */ + SetSP( &dummy->p_s, (memaddr)NULL ); /* TODO */ #endif dummy->original_priority = priority; dummy->priority = priority; @@ -28,9 +28,9 @@ void test_init() { tests[ i ] = dummy; } - SetPC( &tests[ 0 ]->p_s, test1 ); - SetPC( &tests[ 1 ]->p_s, test2 ); - SetPC( &tests[ 2 ]->p_s, test3 ); + SetPC( &tests[ 0 ]->p_s, (memaddr)test1 ); + SetPC( &tests[ 1 ]->p_s, (memaddr)test2 ); + SetPC( &tests[ 2 ]->p_s, (memaddr)test3 ); for( i = 0; i < 3; i++ ) { scheduler_AddProcess( tests[ i ] );