Skip to content
This repository has been archived by the owner on Nov 2, 2022. It is now read-only.

Commit

Permalink
Fix warning di conversione e libdiv #15
Browse files Browse the repository at this point in the history
Aggiunta Libdiv per compilazione uarm
  • Loading branch information
jjak0b committed Mar 21, 2020
1 parent 02caddd commit f64d2c0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
4 changes: 3 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "test.h" /* test fase */

void main(){
int main(){
// Inizialializzazione del sistema
//----------------------------------------------------
initAreas();
Expand Down
10 changes: 6 additions & 4 deletions src/scheduler/scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -56,6 +56,7 @@ int scheduler_StateToReady( state_t* state ) {

int scheduler_StateToWaiting() {
/* TODO */
return 0;
}

int scheduler_StateToTerminate() {
Expand All @@ -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 );
}
10 changes: 5 additions & 5 deletions src/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ 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;

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 ] );
Expand Down

0 comments on commit f64d2c0

Please sign in to comment.