Developer World
Spresense SDK Library v3.2.0-ebc0364
supervisor.h
Go to the documentation of this file.
1/****************************************************************************
2 * mpcomm/supervisor/supervisor.h
3 *
4 * Copyright 2021 Sony Semiconductor Solutions Corporation
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
15 * distribution.
16 * 3. Neither the name of Sony Semiconductor Solutions Corporation nor
17 * the names of its contributors may be used to endorse or promote
18 * products derived from this software without specific prior written
19 * permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *
34 ****************************************************************************/
35
40#ifndef __MODULES_INCLUDE_MPCOMM_SUPERVISOR_H
41#define __MODULES_INCLUDE_MPCOMM_SUPERVISOR_H
42
43/****************************************************************************
44 * Included Files
45 ****************************************************************************/
46
47#include <pthread.h>
48
49#include <asmp/types.h>
50#include <asmp/mptask.h>
51#include <asmp/mpmq.h>
52
53#include <mpcomm/mpcomm.h>
54
55/****************************************************************************
56 * Public Types
57 ****************************************************************************/
58
68typedef struct worker_info
69{
73
77
82
92typedef struct supervisor_context
93{
97
101
104 cpu_set_t helpers_cpuset;
105
108 uint8_t helper_num;
109
113
116 sem_t sem_done;
118
119/****************************************************************************
120 * Public Function Prototypes
121 ****************************************************************************/
122
135 const char *filepath,
136 uint8_t helper_num);
137
148
160 void *data);
161
174 const struct timespec *abstime);
175
176#endif /* __MODULES_INCLUDE_MPCOMM_SUPERVISOR_H */
int16_t cpuid_t
Definition: types.h:64
#define MPCOMM_MAX_HELPERS
Definition: mpcomm.h:90
Definition: mpmq.h:77
Definition: mptask.h:248
Definition: supervisor.h:93
pthread_t controller_listener_pid
Definition: supervisor.h:112
worker_info_t controller
Definition: supervisor.h:96
uint8_t helper_num
Definition: supervisor.h:108
sem_t sem_done
Definition: supervisor.h:116
worker_info_t helpers[MPCOMM_MAX_HELPERS]
Definition: supervisor.h:100
cpu_set_t helpers_cpuset
Definition: supervisor.h:104
Definition: supervisor.h:69
cpuid_t cpuid
Definition: supervisor.h:80
mptask_t mptask
Definition: supervisor.h:72
mpmq_t mq
Definition: supervisor.h:76
struct worker_info worker_info_t
int mpcomm_supervisor_init(mpcomm_supervisor_context_t **ctx, const char *filepath, uint8_t helper_num)
int mpcomm_supervisor_send_controller(mpcomm_supervisor_context_t *ctx, void *data)
int mpcomm_supervisor_deinit(mpcomm_supervisor_context_t *ctx)
int mpcomm_supervisor_wait_controller_done(mpcomm_supervisor_context_t *ctx, const struct timespec *abstime)
struct supervisor_context mpcomm_supervisor_context_t