How To Migrate From PSSW PikeOS 4.0 or 4.1 To PikeOS 4.1 or 4.2

General

PikeOS 4.1 and 4.2 change several APIs to make them more consistent and also to add new features. Most changes are either trivial, or remove very rarely used functionality, or adds functionality without affecting API source compatibility. 4.1 and 4.2 try not to introduce any non-trivial API changes.

Please also check the release notes for API changes, particularly for removal of rarely used features.

Removal of Redundant Identifiers Requires Renaming

To reduce redundancy, some identifiers have been removed, and thus require some renaming:

Changes from 4.0 to 4.1:

DRV_TEST_* -> VM_TEST_*
DRV_AF_* -> VM_AF_*
DRV_STATUS_* -> VM_STATUS_*
DRV_ACCESS_NONE -> 0
DRV_ACCESS_R* -> VM_O_*

drv_mode_t -> vm_part_operating_mode_t
drv_open_opt_t -> vm_file_access_mode_t
drv_access_t -> vm_file_access_mode_t
drv_test_mode_t -> vm_test_mode_t
drv_sa_family_t -> vm_sa_family_t
drv_status_cond_t -> vm_status_cond_t

Changes from 4.1 to 4.2:

drv_sleep -> p4_sleep
drv_get_time -> p4_get_time
drv_get_ts -> p4_get_ts
drv_flush_icache_range -> p4_inval_icache_range
drv_flush_dcache_range -> p4_flush_dcache_range
drv_sync_dcache_range -> p4_sync_dcache_range
P4_FEATURE_CACHE_SYNC -> P4_NEED_ICACHE_COHERENCY
P4_CACHE_SYNC -> P4_ICACHE_COHERENCY

VM_PROP_T_* -> P4_PROP_T_*
VM_PROP_T_DIR -> P4_PROP_T_NODE

VM_E_BUSY -> P4_E_BUSY

VM_E_SYS -> P4_E_SYS

Automatic Updating

There is a script that contains sed expressions for all trivial changes: 'pikeos-upgrade-source'. It can be used to patch files as follows:

/opt/pikeos-4.2/bin/pikeos-upgrade-source FILE [FILE [...]]

To apply only minimal changes (e.g., no full renaming from VM_E to P4_E), use:

/opt/pikeos-4.2/bin/pikeos-upgrade-source --minimal FILE(S)

This script by default upgrades from 3.x to 4.2. To only apply changes from 4.1 to 4.2, use:

/opt/pikeos-4.2/bin/pikeos-upgrade-source --only=4.2 FILE(S)

To only apply changes from 4.0 to 4.1, use:

/opt/pikeos-4.2/bin/pikeos-upgrade-source --only=4.1 FILE(S)

To only apply changes from 3.x to 4.0, use:

/opt/pikeos-4.2/bin/pikeos-upgrade-source --only=4.0 FILE(S)

Project files (project.xml) can be updated from 4.0 and 4.1 to 4.2 using

/opt/pikeos-4.2/bin/pikeos-upgrade-project