Skip to content

Commit

Permalink
lmdk: Update dummy module example
Browse files Browse the repository at this point in the history
Updated dummy module example to use DECLARE_LOADABLE_MODULE_API_VERSION
macro.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
  • Loading branch information
softwarecki authored and kv2019i committed Nov 28, 2023
1 parent cb1542d commit 4509d7c
Showing 1 changed file with 6 additions and 33 deletions.
39 changes: 6 additions & 33 deletions lmdk/modules/dummy/dummy.c
Original file line number Diff line number Diff line change
@@ -1,41 +1,14 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright 2023 Intel Corporation. All rights reserved.
/*
* Copyright 2023 Intel Corporation. All rights reserved.
*/

#include <rimage/sof/user/manifest.h>
#include <module/api_ver.h>

/* rimage fails if no .bss section found */
int bss_workaround;
DECLARE_LOADABLE_MODULE_API_VERSION(dummy);

#define ADSP_BUILD_INFO_FORMAT 0

/* these supposed to be defined in some API header file which is not yet available */
union adsp_api_version {
uint32_t full;
struct {
uint32_t minor : 10;
uint32_t middle : 10;
uint32_t major : 10;
uint32_t reserved : 2;
} fields;
};

struct adsp_build_info {
uint32_t format;
union adsp_api_version api_version_number;
};

struct adsp_build_info dummy_build_info __attribute__((section(".buildinfo"))) = {
ADSP_BUILD_INFO_FORMAT,
{
((0x3FF & MAJOR_IADSP_API_VERSION) << 20) |
((0x3FF & MIDDLE_IADSP_API_VERSION) << 10) |
((0x3FF & MINOR_IADSP_API_VERSION) << 0)
}
};

__attribute__((section(".cmi.text")))
void *dummyPackageEntryPoint(int a, int b)
void *dummyPackageEntryPoint(void *mod_cfg, void *parent_ppl, void **mod_ptr)
{
/* supposed to return here a pointer to module interface implementation */
return (void *)0x12345678;
Expand Down

0 comments on commit 4509d7c

Please sign in to comment.