Remove TactilityC and Firmware subprojects (#638)
- Removed TactilityC, moved its symbols to existing modules and several new ones (pthread-module, c-symbols-module, cpp-symbols-module, posix-symbols-module, freertos-module). - Removed Firmware subproject and moved main() into Tactility subproject. - Strengthened application archive, path, version, stack-size, and device validation. - Moved symbol resolution for elf_loader to app-esp32-module. - Improved `struct Module` declarations and made module and symbol definitions in modules more consistent. - Removed old http download code from Tactility subproject. - Rename app-module's source files for consistency. - Add missing pthread symbols. - Kernel module symbols are now resolvable on all platforms.
This commit is contained in:
committed by
GitHub
parent
d3556fb536
commit
19b11eb9a8
@@ -1,6 +1,8 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#include <app_esp32/module.h>
|
||||
|
||||
#include <private/elf_symbol.h>
|
||||
|
||||
#include <service/manager.h>
|
||||
|
||||
#include <tactility/error.h>
|
||||
@@ -10,11 +12,23 @@ extern "C" {
|
||||
|
||||
extern ServiceManifest loader_service_manifest;
|
||||
|
||||
// Overrides elf_loader's default KConfig-based symbol resolver with one that looks up symbols
|
||||
// across every started kernel module's own symbol table instead.
|
||||
uintptr_t app_esp32_symbol_resolver(const char* symbolName) {
|
||||
uintptr_t symbol_address;
|
||||
if (module_resolve_symbol_global(symbolName, &symbol_address)) {
|
||||
return symbol_address;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static error_t start() {
|
||||
elf_set_symbol_resolver(app_esp32_symbol_resolver);
|
||||
return service_manager_add(&loader_service_manifest, /*auto_start=*/true);
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
elf_set_symbol_resolver(nullptr);
|
||||
return service_manager_remove(loader_service_manifest.id);
|
||||
}
|
||||
|
||||
@@ -24,7 +38,7 @@ Module app_esp32_module = {
|
||||
.stop = stop,
|
||||
.drivers = nullptr,
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.internal = nullptr,
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user