Architecture 8.0.0 Migration

This chapter describes the steps to migrate a VEE Port from Architecture 8.0.0 to Architecture 8.1.0.

As a reminder, refer to the Architecture 8.1.0 Changelog section for the complete list of changes and updates.

Migrate Core Engine Capability Configuration

The selection of the Core Engine capability is now done via the property com.microej.runtime.capability. Refer to one of the sections below depending on your desired capability.

If you use the property com.microej.platformbuilder.module.multi.enabled, update your Platform Configuration Additions to the version 2.1.0 or higher. It is also recommended to delete the property com.microej.platformbuilder.module.multi.enabled and to use the property com.microej.runtime.capability instead.

Mono-Sandbox

Mono-Sandbox remains the default capability and no changes are required to your VEE Port configuration.

Multi-Sandbox

In the Platform Editor, the Multi Applications (kf) module now appears in gray:

../_images/architecture8_removed_modules.png

Unselect the kf module and follow the instructions from the Multi-Sandbox installation section.

Tiny-Sandbox

The property mjvm.standalone.configuration used to select the Tiny-Sandbox capability is now deprecated. It is recommended to remove the definition of this property from the configuration.xml file and follow the instructions from the Tiny-Sandbox installation section.

Migrate Your LLKERNEL Implementation

This section only applies if your LLKERNEL was based on legacy In-Place Installation mode. The Kernel Working Buffer no longer exists. The functions LLKERNEL_IMPL_allocateWorkingBuffer() and LLKERNEL_IMPL_freeWorkingBuffer() are no more called and can be simply removed from your implementation.

Memory allocation for the Features will now use the function LLKERNEL_IMPL_allocateFeature(). The following code is a LLKERNEL_impl.c template for migrating your current implementation using this API. The code logic based on a malloc/free implementation does not need to be changed.

#include <stdlib.h>
#include <string.h>

#include "LLKERNEL_impl.h"

// Your implementation of malloc()
#define KERNEL_MALLOC(size) malloc((size_t)(size))

// Your implementation of free()
#define KERNEL_FREE(addr) free((void*)(addr))

// Your implementation of 'ASSERT(0)'
#define KERNEL_ASSERT_FAIL() while(1)

// Utility macros for allocating RAM and ROM areas with required alignment constraints
#define KERNEL_AREA_GET_MAX_SIZE(size, alignment) ((size)+((alignment)-1))
#define KERNEL_AREA_GET_START_ADDRESS(addr, alignment) ((void*)((((int32_t)(addr))+(alignment)-1)&~((alignment)-1)))

typedef struct installed_feature{
   void* ROM_area;
   void* RAM_area;
} installed_feature_t;

int32_t LLKERNEL_IMPL_allocateFeature(int32_t size_ROM, int32_t size_RAM) {
   int32_t ret = 0;
   int total_size = sizeof(installed_feature_t);
   total_size += KERNEL_AREA_GET_MAX_SIZE(size_ROM, LLKERNEL_ROM_AREA_ALIGNMENT);
   total_size += KERNEL_AREA_GET_MAX_SIZE(size_RAM, LLKERNEL_RAM_AREA_ALIGNMENT);

   void* total_area = KERNEL_MALLOC(total_size);
   if(NULL != total_area){
      installed_feature_t* f = (installed_feature_t*)total_area;
      f->ROM_area = KERNEL_AREA_GET_START_ADDRESS((void*)(((int32_t)f)+((int32_t)sizeof(installed_feature_t))), LLKERNEL_ROM_AREA_ALIGNMENT);
      f->RAM_area = KERNEL_AREA_GET_START_ADDRESS((void*)(((int32_t)f->ROM_area)+size_ROM), LLKERNEL_RAM_AREA_ALIGNMENT);
      ret = (int32_t)f;
   } // else out of memory

   return ret;
}

void LLKERNEL_IMPL_freeFeature(int32_t handle) {
   KERNEL_FREE(handle);
}

int32_t LLKERNEL_IMPL_getAllocatedFeaturesCount(void) {
   // No persistency support
   return 0;
}

int32_t LLKERNEL_IMPL_getFeatureHandle(int32_t allocation_index) {
   // No persistency support
   KERNEL_ASSERT_FAIL();
}

void* LLKERNEL_IMPL_getFeatureAddressRAM(int32_t handle) {
   return ((installed_feature_t*)handle)->RAM_area;
}

void* LLKERNEL_IMPL_getFeatureAddressROM(int32_t handle) {
   return ((installed_feature_t*)handle)->ROM_area;
}

int32_t LLKERNEL_IMPL_copyToROM(void* dest_address_ROM, void* src_address, int32_t size) {
   memcpy(dest_address_ROM, src_address, size);
   return LLKERNEL_OK;
}

int32_t LLKERNEL_IMPL_flushCopyToROM(void) {
   return LLKERNEL_OK;
}

int32_t LLKERNEL_IMPL_onFeatureInitializationError(int32_t handle, int32_t error_code) {
   // No persistency support
   KERNEL_ASSERT_FAIL();
   return 0;
}