Move common shmem parameter declarations to shmem.h.

This commit is contained in:
Kārlis Seņko
2018-12-10 19:36:30 +02:00
committed by Daniel Agar
parent d1a1a1b9fe
commit c1d50d35d3
7 changed files with 23 additions and 40 deletions

View File

@@ -10,7 +10,6 @@ if (DEFINED ENV{QC_SOC_TARGET})
else()
set(QC_SOC_TARGET "APQ8074")
endif()
add_definitions(-D__PX4_QURT_EAGLE_${QC_SOC_TARGET})
include(px4_git)
px4_add_git_submodule(TARGET git_cmake_hexagon PATH "${PX4_SOURCE_DIR}/boards/atlflight/cmake_hexagon")

View File

@@ -54,10 +54,8 @@
#include "px4muorb.h"
//#define SHMEM_DEBUG
void update_to_shmem(param_t param, union param_value_u value);
int update_from_shmem(param_t param, union param_value_u *value);
void update_index_from_shmem(void);
uint64_t update_from_shmem_prev_time = 0, update_from_shmem_current_time = 0;
static uint64_t update_from_shmem_prev_time = 0, update_from_shmem_current_time = 0;
extern unsigned char *adsp_changed_index;
struct param_wbuf_s {

View File

@@ -119,8 +119,6 @@ void __cxa_pure_virtual()
block_indefinite();
}
#ifdef __PX4_QURT_EAGLE_APQ8074
float _Stof(const char *p0, char **p1, long p2)
{
PX4_WARN("Error: Calling unresolved symbol stub[%s]", __FUNCTION__);
@@ -155,5 +153,3 @@ void *bsearch(const void *key, const void *ptr, size_t count, size_t size, int (
return NULL;
}
#endif

View File

@@ -51,19 +51,12 @@
static atomic_word_t mem_lock;
int mem_fd;
unsigned char *map_base, *virt_addr;
struct shmem_info *shmem_info_p;
int get_shmem_lock(const char *caller_file_name, int caller_line_number);
void release_shmem_lock(const char *caller_file_name, int caller_line_number);
void init_shared_memory();
void copy_params_to_shmem(param_info_s *);
void update_to_shmem(param_t param, union param_value_u value);
int update_from_shmem(param_t param, union param_value_u *value);
void update_index_from_shmem();
uint64_t update_from_shmem_prev_time = 0, update_from_shmem_current_time = 0;
static unsigned char *map_base, *virt_addr;
static uint64_t update_from_shmem_prev_time = 0, update_from_shmem_current_time = 0;
static unsigned char krait_changed_index[MAX_SHMEM_PARAMS / 8 + 1];
struct shmem_info *shmem_info_p;
// Small helper to get log2 for ints
static unsigned log2_for_int(unsigned v)
{

View File

@@ -120,24 +120,10 @@ int size_param_changed_storage_bytes = 0;
const int bits_per_allocation_unit = (sizeof(*param_changed_storage) * 8);
//#define ENABLE_SHMEM_DEBUG
extern int get_shmem_lock(const char *caller_file_name, int caller_line_number);
extern void release_shmem_lock(const char *caller_file_name, int caller_line_number);
static void init_params();
extern void init_shared_memory();
extern void copy_params_to_shmem(const param_info_s *param_info_base);
extern struct shmem_info *shmem_info_p;
uint64_t sync_other_prev_time = 0, sync_other_current_time = 0;
extern void update_to_shmem(param_t param, union param_value_u value);
extern int update_from_shmem(param_t param, union param_value_u *value);
extern void update_index_from_shmem();
static int param_set_internal(param_t param, const void *val, bool mark_saved, bool notify_changes);
unsigned char set_called_from_get = 0;
static unsigned char set_called_from_get = 0;
static int param_import_done =
0; /*at startup, params are loaded from file, if present. we dont want to send notifications that time since muorb is not ready*/

View File

@@ -47,12 +47,7 @@
__BEGIN_DECLS
extern int dspal_main(int argc, char *argv[]);
extern struct shmem_info *shmem_info_p;
__END_DECLS
extern int get_shmem_lock(const char *caller_file_name, int caller_line_number);
extern void release_shmem_lock(const char *caller_file_name,
int caller_line_number);
extern void init_shared_memory(void);
int px4muorb_orb_initialize()
{

View File

@@ -33,6 +33,8 @@
#pragma once
#include <parameters/param.h>
#define MAX_SHMEM_PARAMS 2000 //MAP_SIZE - (LOCK_SIZE - sizeof(struct shmem_info))
#define PARAM_BUFFER_SIZE (MAX_SHMEM_PARAMS / 8 + 1)
@@ -64,3 +66,17 @@ struct shmem_info {
#define TYPE_MASK 0x1
extern bool handle_in_range(param_t);
#ifdef __PX4_QURT
extern struct shmem_info *shmem_info_p;
int get_shmem_lock(const char *caller_file_name, int caller_line_number);
void release_shmem_lock(const char *caller_file_name, int caller_line_number);
void init_shared_memory(void);
void copy_params_to_shmem(const param_info_s *param_info_base);
#endif
void update_to_shmem(param_t param, union param_value_u value);
int update_from_shmem(param_t param, union param_value_u *value);
void update_index_from_shmem(void);