mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[ion] Move KallaxInfo to SoftwareVersion renamed in PlatformInfo
This commit is contained in:
committed by
EmilieNumworks
parent
f9656fd94f
commit
3c0adfe918
@@ -14,13 +14,13 @@ include ion/src/shared/tools/Makefile
|
||||
# char test[4]= "ab"; is valid and should initialize test to 'a','b',0,0).
|
||||
# Older versions of GCC are not conformant so we resort to an initializer list.
|
||||
initializer_list = $(shell echo $(1) | sed "s/\(.\)/'\1',/g")0
|
||||
ion/src/shared/software_version.o: SFLAGS += -DPATCH_LEVEL="$(call initializer_list,$(PATCH_LEVEL))" -DEPSILON_VERSION="$(call initializer_list,$(EPSILON_VERSION))"
|
||||
ion/src/shared/platform_info.o: SFLAGS += -DPATCH_LEVEL="$(call initializer_list,$(PATCH_LEVEL))" -DEPSILON_VERSION="$(call initializer_list,$(EPSILON_VERSION))"
|
||||
|
||||
objs += $(addprefix ion/src/shared/, \
|
||||
events.o \
|
||||
kallax.o \
|
||||
record.o \
|
||||
software_version.o \
|
||||
platform_info.o \
|
||||
)
|
||||
|
||||
tests += $(addprefix ion/test/,\
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
include ion/src/device/boot/Makefile
|
||||
include ion/src/device/bench/Makefile
|
||||
|
||||
ion/src/device/kallax_info.o: SFLAGS += -DHEADER_SECTION="__attribute__((section(\".header\")))" -DFORCE_LINK="__attribute__((used))"
|
||||
|
||||
ion/src/shared/software_version.o: SFLAGS += -DHEADER_SECTION="__attribute__((section(\".header\")))"
|
||||
ion/src/shared/platform_info.o: SFLAGS += -DHEADER_SECTION="__attribute__((section(\".header\")))" -DFORCE_LINK="__attribute__((used))"
|
||||
|
||||
objs += $(addprefix ion/src/shared/, \
|
||||
console_line.o \
|
||||
@@ -21,7 +19,6 @@ objs += $(addprefix ion/src/device/, \
|
||||
display.o\
|
||||
events_keyboard.o\
|
||||
fcc_id.o\
|
||||
kallax_info.o\
|
||||
keyboard.o\
|
||||
led.o\
|
||||
power.o\
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#include "kallax_info.h"
|
||||
|
||||
#ifndef HEADER_SECTION
|
||||
#define HEADER_SECTION
|
||||
#endif
|
||||
|
||||
#ifndef FORCE_LINK
|
||||
#define FORCE_LINK
|
||||
#endif
|
||||
|
||||
namespace Ion {
|
||||
namespace Device {
|
||||
|
||||
extern Kallax f;
|
||||
constexpr KallaxInfo HEADER_SECTION FORCE_LINK kallax_infos((uint32_t)(&f));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
#ifndef ION_DEVICE_KALLAX_INFO_H
|
||||
#define ION_DEVICE_KALLAX_INFO_H
|
||||
|
||||
#include <ion/kallax.h>
|
||||
|
||||
namespace Ion {
|
||||
namespace Device {
|
||||
|
||||
class KallaxInfo {
|
||||
public:
|
||||
constexpr KallaxInfo(uint32_t address) :
|
||||
m_header(Magic),
|
||||
m_address(address),
|
||||
m_footer(Magic) { }
|
||||
private:
|
||||
constexpr static uint32_t Magic = 0xDECB0DF0;
|
||||
uint32_t m_header;
|
||||
uint32_t m_address;
|
||||
uint32_t m_footer;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,18 +2,10 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifndef HEADER_SECTION
|
||||
#define HEADER_SECTION
|
||||
#endif
|
||||
|
||||
#ifndef FORCE_LINK
|
||||
#define FORCE_LINK
|
||||
#endif
|
||||
Ion::Kallax kallax;
|
||||
|
||||
namespace Ion {
|
||||
|
||||
Kallax f;
|
||||
|
||||
Kallax::Kallax() :
|
||||
m_dataHeader(Magic),
|
||||
m_data(),
|
||||
@@ -24,7 +16,7 @@ Kallax::Kallax() :
|
||||
}
|
||||
|
||||
Kallax * Kallax::sharedKallax() {
|
||||
return &f;
|
||||
return &kallax;
|
||||
}
|
||||
|
||||
int Kallax::numberOfRecordOfType(Record::Type type) {
|
||||
|
||||
@@ -16,12 +16,19 @@
|
||||
#define HEADER_SECTION
|
||||
#endif
|
||||
|
||||
class VersionInfo {
|
||||
#ifndef FORCE_LINK
|
||||
#define FORCE_LINK
|
||||
#endif
|
||||
|
||||
extern Ion::Kallax kallax;
|
||||
|
||||
class PlatformInfo {
|
||||
public:
|
||||
constexpr VersionInfo() :
|
||||
constexpr PlatformInfo() :
|
||||
m_header(Magic),
|
||||
m_version{EPSILON_VERSION},
|
||||
m_patchLevel{PATCH_LEVEL},
|
||||
m_storageAddress(&kallax),
|
||||
m_footer(Magic) { }
|
||||
const char * version() const {
|
||||
assert(m_header == Magic);
|
||||
@@ -38,15 +45,16 @@ private:
|
||||
uint32_t m_header;
|
||||
const char m_version[8];
|
||||
const char m_patchLevel[8];
|
||||
void * m_storageAddress;
|
||||
uint32_t m_footer;
|
||||
};
|
||||
|
||||
constexpr VersionInfo HEADER_SECTION version_infos;
|
||||
constexpr PlatformInfo HEADER_SECTION platform_infos;
|
||||
|
||||
const char * Ion::softwareVersion() {
|
||||
return version_infos.version();
|
||||
return platform_infos.version();
|
||||
}
|
||||
|
||||
const char * Ion::patchLevel() {
|
||||
return version_infos.patchLevel();
|
||||
return platform_infos.patchLevel();
|
||||
}
|
||||
Reference in New Issue
Block a user