File tree Expand file tree Collapse file tree 5 files changed +27
-25
lines changed Expand file tree Collapse file tree 5 files changed +27
-25
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,8 @@ void hard_fault_default(void);
9494/**
9595 * @brief Default memory manager behavior callback (weak function)
9696 *
97- * @retval 1 when the memory fault has been handled,
98- * @retval 0 otherwise.
97+ * @retval >=0 when the memory fault has been handled,
98+ * @retval < 0 otherwise.
9999 */
100100int mem_manage_handler (void );
101101
Original file line number Diff line number Diff line change 8888 */
8989
9090#include <stdio.h>
91+ #include <errno.h>
9192
9293#include "sched.h"
9394#include "thread.h"
@@ -493,12 +494,12 @@ void __attribute__((naked)) __attribute__((used)) isr_svc(void)
493494#endif
494495}
495496
496- __attribute__((weak ))int
497+ __attribute__((weak )) int
497498svc_dispatch_handler (unsigned int svc_number , unsigned int * svc_args )
498499{
499500 (void )svc_number ;
500501 (void )svc_args ;
501- return 0 ;
502+ return - ENOTSUP ;
502503}
503504
504505static void __attribute__((used )) _svc_dispatch (unsigned int * svc_args )
Original file line number Diff line number Diff line change 2222#include <stdint.h>
2323#include <stdio.h>
2424#include <inttypes.h>
25+ #include <errno.h>
2526
2627#include "cpu.h"
2728#include "periph_cpu.h"
@@ -473,14 +474,14 @@ void hard_fault_default(void)
473474 defined(CPU_CORE_CORTEX_M4 ) || defined(CPU_CORE_CORTEX_M4F ) || \
474475 defined(CPU_CORE_CORTEX_M7 )
475476
476- __attribute__((weak ))int mem_manage_handler (void )
477+ __attribute__((weak )) int mem_manage_handler (void )
477478{
478- return 0 ;
479+ return - ENOTSUP ;
479480}
480481
481482void mem_manage_default (void )
482483{
483- if (mem_manage_handler () == 1 ) {
484+ if (mem_manage_handler () >= 0 ) {
484485 return ;
485486 }
486487 core_panic (PANIC_MEM_MANAGE , "MEM MANAGE HANDLER" );
Original file line number Diff line number Diff line change 11/*
2- * Copyright (C) 2025 Université de Lille
2+ * Copyright (C) 2024- 2025 Université de Lille
33 *
44 * This file is subject to the terms and conditions of the GNU Lesser
55 * General Public License v2.1. See the file LICENSE in the top level
@@ -99,7 +99,7 @@ static int drop_file(const file_to_drop_t *file_to_drop) {
9999 int file_handle = vfs_open (file_to_drop -> filename , O_RDONLY , 0 );
100100 if (file_handle < 0 ) {
101101
102- /** There's no executable file yet, let's drop one */
102+ /* There's no executable file yet, let's drop one */
103103 int ret = xipfs_extended_driver_new_file (
104104 file_to_drop -> filename , file_to_drop -> bytesize , file_to_drop -> is_executable
105105 );
@@ -109,7 +109,7 @@ static int drop_file(const file_to_drop_t *file_to_drop) {
109109 return EXIT_FAILURE ;
110110 }
111111
112- /**
112+ /*
113113 * Fill it with data
114114 * Take care : vfs does not support O_APPEND with vfs_write, only O_WRONLY or O_RDWR
115115 */
Original file line number Diff line number Diff line change @@ -739,28 +739,28 @@ int mem_manage_handler(void)
739739 uint32_t cfsr = SCB -> CFSR ;
740740 uintptr_t psp = __get_PSP ();
741741 if (xipfs_mem_manage_handler ((void * )psp , mmfar , cfsr ) == 0 ) {
742- return 1 ;
742+ return 0 ;
743743 }
744744
745- return 0 ;
745+ return - EINVAL ;
746746}
747747
748748int svc_dispatch_handler (unsigned int svc_number , unsigned int * svc_args )
749749{
750750 switch (svc_number ) {
751- case XIPFS_ENTER_SVC_NUMBER : {
752- void * crt0_ctx = (void * )svc_args [0 ];
753- void * entry_point = (void * )svc_args [1 ];
754- void * stack_top = (void * )svc_args [2 ];
755- xipfs_safe_exec_enter (crt0_ctx , entry_point , stack_top );
756- return 0 ;
757- }
758- case XIPFS_SYSCALL_SVC_NUMBER : {
759- xipfs_syscall_dispatcher (svc_args );
760- return 0 ;
761- }
762- default :
763- return - ENOTSUP ;
751+ case XIPFS_ENTER_SVC_NUMBER : {
752+ void * crt0_ctx = (void * )svc_args [0 ];
753+ void * entry_point = (void * )svc_args [1 ];
754+ void * stack_top = (void * )svc_args [2 ];
755+ xipfs_safe_exec_enter (crt0_ctx , entry_point , stack_top );
756+ return 0 ;
757+ }
758+ case XIPFS_SYSCALL_SVC_NUMBER : {
759+ xipfs_syscall_dispatcher (svc_args );
760+ return 0 ;
761+ }
762+ default :
763+ return - ENOTSUP ;
764764 }
765765}
766766
You can’t perform that action at this time.
0 commit comments