forked from airbus/a653lib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.c
More file actions
64 lines (48 loc) · 1.37 KB
/
init.c
File metadata and controls
64 lines (48 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/**
* @file init.c
* @author nicolaus.baer@airbus.com
* @date Tue Oct 24 15:53:18 CEST 2023
* @brief partition main function
* @details
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
//--------------------
#include <errno.h>
#include "a653Init.h"
#include "a653_config.h"
#include "a653Type.h"
#include "a653Error.h"
#include "a653Process.h"
#include "a653Partition.h"
#include "a653_i_process.h"
#include "a653_i_shm_if.h"
#include "a653_i_sync.h"
extern a653_shm_info_t *shm_ptr;
extern int own_partition_idx;
extern PARTITION_STATUS_TYPE pertition_status;
a653_global_config_t global_config = A653_PARTITION_CONFIG_DEF;
a653_channel_config_t channel_config[] = A653_CH_CONFIG_DEF;
a653_partition_config_t partition_config[] = A653_PART_CONFIG_DEF;
/* */
void beforeMain (void) __attribute__ ((constructor));
void beforeMain (void)
{
int idx = 0;;
setDebug(3);
printDebug(1,"a653 partition init (%d)\n",getpid());
a653_init_partition();
pertition_status.OPERATING_MODE = COLD_START;
shm_ptr->partition_info[own_partition_idx].init = 2;
printDebug(1,"a653 partition wait (%d)\n",getpid());
initTime();
while (shm_ptr->partition_info[own_partition_idx].init == 2){
if((idx++ % 0x100000) == 0){
printDebug(1,"a653 partition wait (%d)\n",getpid());
idx = 0;
}
usleep(5000);
}
}