Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ TARGET_B = $(BIN_DIR)/partition_b



all: clean mk_build_dir alib amain part_a part_b
all: mk_build_dir alib amain part_a part_b
@echo done!


Expand All @@ -64,12 +64,33 @@ part_b: $(OBJS_B)
cd $(MY_BUILD_DIR); $(CC) $(CFLAGS) $(LDFLAGS) -o $(TARGET_B) $(OBJS_B) ./liba653.a $(LDLIBS)


alib:
make -e -C $(SRC_DIR)/a653_lib
alib: $(TMP_DIR)/download/a653Blackboard.h $(TMP_DIR)/download/a653Buffer.h $(TMP_DIR)/download/a653Event.h $(TMP_DIR)/download/a653Mutex.h
cp -r $(SRC_DIR)/a653_inc $(MY_BUILD_DIR)
cp $^ $(MY_BUILD_DIR)/a653_inc
# cp -r $(SRC_DIR)/a653_ada $(MY_BUILD_DIR)
# relies on the above headers
make -e -C $(SRC_DIR)/a653_lib


# rule to download the ARINC headerfiles
$(TMP_DIR)/download/arinc653.h.zip:
@mkdir -p -- $(@D)
test -f $@ || curl --user-agent 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0' \
--location --output-dir $(TMP_DIR)/download --remote-name-all \
https://brx-content.fullsight.org/site/binaries/content/assets/itc/content/support-files/arinc653.h.zip

# rule to extract the ARINC headerfiles
$(TMP_DIR)/download/ARINC653.h: $(TMP_DIR)/download/arinc653.h.zip
@mkdir -p -- $(@D)
test -f $@ || echo $^ | xargs --max-args=1 bsdtar -x --cd $(TMP_DIR)/download --modification-time --file

# rule to generate our Wasm header file, by making every open type a 32 Bit integer
$(TMP_DIR)/download/ARINC653_patched.h: $(TMP_DIR)/download/ARINC653.h
@mkdir -p -- $(@D)
awk -f $(SRC_DIR)/scripts/process-arinc-header.awk $< > $@

$(TMP_DIR)/download/a653Blackboard.h $(TMP_DIR)/download/a653Buffer.h $(TMP_DIR)/download/a653Event.h $(TMP_DIR)/download/a653Mutex.h &: $(TMP_DIR)/download/ARINC653_patched.h
cd $(TMP_DIR)/download; awk -f $(SRC_DIR)/scripts/split-arinc-header.awk $<


gcc_version:
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,7 @@ pid: 578773 <1702486050.349254883>: > taskset --cpu-list 1 ./partition_b & :
## Tests debugging

## Build with Make

## Links

[Required Services](https://www.aviation-ia.com/support-files/arinc653h)
4 changes: 2 additions & 2 deletions a653_lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
CC = gcc
AR = ar

CFLAGS = -Wall -Wno-unused-function -g2 -O0 -fPIC -c -I../a653_inc $(COMMON_SWITCH)
CFLAGS = -Wall -Wno-unused-function -g2 -O0 -fPIC -c -I$(BUILD_DIR)/a653_inc $(COMMON_SWITCH)
LDFLAGS = -g2 #-L /tools/gcc-810-ppc/lib

OBJS = a653_i_semaphore.o a653_i_partition.o a653_i_process.o a653_i_sampling.o a653_i_queuing.o a653_i_time.o a653Init.o a653_i_shm_if.o a653_i_sync.o a653_i_time_lib.o a653_i_error.o
OBJS = a653_i_semaphore.o a653_i_partition.o a653_i_process.o a653_i_sampling.o a653_i_queuing.o a653_i_time.o a653Init.o a653_i_shm_if.o a653_i_sync.o a653_i_time_lib.o a653_i_error.o a653_i_buffer.o a653_i_blackboard.o a653_i_mutex.o a653_i_event.o

MY_BUILD_DIR = $(BUILD_DIR)/a653_lib
TARGET = $(BUILD_DIR)/liba653.a
Expand Down
80 changes: 80 additions & 0 deletions a653_lib/a653_i_blackboard.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* Copyright (c) 2022-2023 Airbus Defence and Space
*
* This file is part of liba653.
*
* liba653 is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* liba653 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with liba653; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

/**
* @file a653_i_blackboard.c
* @copyright Airbus Defence and Space
* @author [email protected]
* @date Mon Nov 3 21:28:21 CET 2025
* @brief a653 blackboard
* @details
*/

/* includes */

#include "a653Lib.h"
#include "a653Blackboard.h"

void CREATE_BLACKBOARD (
/*in */ BLACKBOARD_NAME_TYPE BLACKBOARD_NAME,
/*in */ MESSAGE_SIZE_TYPE MAX_MESSAGE_SIZE,
/*out*/ BLACKBOARD_ID_TYPE *BLACKBOARD_ID,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void DISPLAY_BLACKBOARD (
/*in */ BLACKBOARD_ID_TYPE BLACKBOARD_ID,
/*in */ MESSAGE_ADDR_TYPE MESSAGE_ADDR, /* by reference */
/*in */ MESSAGE_SIZE_TYPE LENGTH,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void READ_BLACKBOARD (
/*in */ BLACKBOARD_ID_TYPE BLACKBOARD_ID,
/*in */ SYSTEM_TIME_TYPE TIME_OUT,
/*in */ MESSAGE_ADDR_TYPE MESSAGE_ADDR,
/* The message address is passed IN, although */
/* the respective message is passed OUT */
/*out*/ MESSAGE_SIZE_TYPE *LENGTH,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void CLEAR_BLACKBOARD (
/*in */ BLACKBOARD_ID_TYPE BLACKBOARD_ID,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void GET_BLACKBOARD_ID (
/*in */ BLACKBOARD_NAME_TYPE BLACKBOARD_NAME,
/*out*/ BLACKBOARD_ID_TYPE *BLACKBOARD_ID,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void GET_BLACKBOARD_STATUS (
/*in */ BLACKBOARD_ID_TYPE BLACKBOARD_ID,
/*out*/ BLACKBOARD_STATUS_TYPE *BLACKBOARD_STATUS,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}
77 changes: 77 additions & 0 deletions a653_lib/a653_i_buffer.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* Copyright (c) 2022-2023 Airbus Defence and Space
*
* This file is part of liba653.
*
* liba653 is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* liba653 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with liba653; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

/**
* @file a653_i_buffer.c
* @copyright Airbus Defence and Space
* @author [email protected]
* @date Mon Nov 3 21:28:21 CET 2025
* @brief a653 buffer
* @details
*/

/* includes */

#include "a653Lib.h"
#include "a653Buffer.h"

void CREATE_BUFFER (
/*in */ BUFFER_NAME_TYPE BUFFER_NAME,
/*in */ MESSAGE_SIZE_TYPE MAX_MESSAGE_SIZE,
/*in */ MESSAGE_RANGE_TYPE MAX_NB_MESSAGE,
/*in */ QUEUING_DISCIPLINE_TYPE QUEUING_DISCIPLINE,
/*out*/ BUFFER_ID_TYPE *BUFFER_ID,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void SEND_BUFFER (
/*in */ BUFFER_ID_TYPE BUFFER_ID,
/*in */ MESSAGE_ADDR_TYPE MESSAGE_ADDR, /* by reference */
/*in */ MESSAGE_SIZE_TYPE LENGTH,
/*in */ SYSTEM_TIME_TYPE TIME_OUT,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void RECEIVE_BUFFER (
/*in */ BUFFER_ID_TYPE BUFFER_ID,
/*in */ SYSTEM_TIME_TYPE TIME_OUT,
/*in */ MESSAGE_ADDR_TYPE MESSAGE_ADDR,
/* The message address is passed IN, although */
/* the respective message is passed OUT */
/*out*/ MESSAGE_SIZE_TYPE *LENGTH,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void GET_BUFFER_ID (
/*in */ BUFFER_NAME_TYPE BUFFER_NAME,
/*out*/ BUFFER_ID_TYPE *BUFFER_ID,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void GET_BUFFER_STATUS (
/*in */ BUFFER_ID_TYPE BUFFER_ID,
/*out*/ BUFFER_STATUS_TYPE *BUFFER_STATUS,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}
73 changes: 73 additions & 0 deletions a653_lib/a653_i_event.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* Copyright (c) 2022-2023 Airbus Defence and Space
*
* This file is part of liba653.
*
* liba653 is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* liba653 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with liba653; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

/**
* @file a653_i_event.c
* @copyright Airbus Defence and Space
* @author [email protected]
* @date Mon Nov 3 21:28:21 CET 2025
* @brief a653 event
* @details
*/

/* includes */

#include "a653Lib.h"
#include "a653Event.h"

void CREATE_EVENT (
/*in */ EVENT_NAME_TYPE EVENT_NAME,
/*out*/ EVENT_ID_TYPE *EVENT_ID,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void SET_EVENT (
/*in */ EVENT_ID_TYPE EVENT_ID,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void RESET_EVENT (
/*in */ EVENT_ID_TYPE EVENT_ID,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void WAIT_EVENT (
/*in */ EVENT_ID_TYPE EVENT_ID,
/*in */ SYSTEM_TIME_TYPE TIME_OUT,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void GET_EVENT_ID (
/*in */ EVENT_NAME_TYPE EVENT_NAME,
/*out*/ EVENT_ID_TYPE *EVENT_ID,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void GET_EVENT_STATUS (
/*in */ EVENT_ID_TYPE EVENT_ID,
/*out*/ EVENT_STATUS_TYPE *EVENT_STATUS,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}
83 changes: 83 additions & 0 deletions a653_lib/a653_i_mutex.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* Copyright (c) 2022-2023 Airbus Defence and Space
*
* This file is part of liba653.
*
* liba653 is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* liba653 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with liba653; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

/**
* @file a653_i_mutex.c
* @copyright Airbus Defence and Space
* @author [email protected]
* @date Mon Nov 3 21:28:21 CET 2025
* @brief a653 mutex
* @details
*/

/* includes */

#include "a653Lib.h"
#include "a653Mutex.h"

void CREATE_MUTEX (
/*in */ MUTEX_NAME_TYPE MUTEX_NAME,
/*in */ PRIORITY_TYPE MUTEX_PRIORITY,
/*in */ QUEUING_DISCIPLINE_TYPE QUEUING_DISCIPLINE,
/*out*/ MUTEX_ID_TYPE *MUTEX_ID,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void ACQUIRE_MUTEX (
/*in */ MUTEX_ID_TYPE MUTEX_ID,
/*in */ SYSTEM_TIME_TYPE TIME_OUT,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void RELEASE_MUTEX (
/*in */ MUTEX_ID_TYPE MUTEX_ID,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void RESET_MUTEX (
/*in */ MUTEX_ID_TYPE MUTEX_ID,
/*in */ PROCESS_ID_TYPE PROCESS_ID,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void GET_MUTEX_ID (
/*in */ MUTEX_NAME_TYPE MUTEX_NAME,
/*out*/ MUTEX_ID_TYPE *MUTEX_ID,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void GET_MUTEX_STATUS (
/*in */ MUTEX_ID_TYPE MUTEX_ID,
/*out*/ MUTEX_STATUS_TYPE *MUTEX_STATUS,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}

void GET_PROCESS_MUTEX_STATE (
/*in */ PROCESS_ID_TYPE PROCESS_ID,
/*out*/ MUTEX_ID_TYPE *MUTEX_ID,
/*out*/ RETURN_CODE_TYPE *RETURN_CODE ) {
*RETURN_CODE = NO_ACTION;
}
Loading