Skip to content

Moving around a few items within \rtos #13264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 20, 2020
Merged

Conversation

ashok-rao
Copy link
Contributor

@ashok-rao ashok-rao commented Jul 9, 2020

Summary of changes

Refactoring \rtos as per directory structure proposal.
Mbed OS will soon be changing directory structure to the below:

[component name]
├── mbed_lib.json 
├── CMakeList.txt
├── README.md
├── include 
│   └── [component name]
│       └── internal              
├── source
└── tests
    ├── <framework>  
    │   └── <test suite one> 
    ├── UNITTESTS               
    │   └── <unit test suite one>   
    └── TESTS       
        └── <greentea test suite one> 

This PR implements the above new directory structure for the current \rtos directory.

Impact of changes

Migration actions required

Documentation


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[x] Tests / results supplied as part of this PR

Successfully compiled all MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-* tests for NUCLEO_F429ZI using ARMC6 and GCC.


Reviewers


@0xc0170 @LDong-Arm @rajkan01

@ashok-rao
Copy link
Contributor Author

Build successes:
  * NUCLEO_F429ZI::ARMC6::MBED-BUILD
  * NUCLEO_F429ZI::ARMC6::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-BASIC
  * NUCLEO_F429ZI::ARMC6::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-CONDITION_VARIABLE
  * NUCLEO_F429ZI::ARMC6::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-EVENT_FLAGS
  * NUCLEO_F429ZI::ARMC6::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-HEAP_AND_STACK
  * NUCLEO_F429ZI::ARMC6::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-KERNEL_TICK_COUNT
  * NUCLEO_F429ZI::ARMC6::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-MAIL
  * NUCLEO_F429ZI::ARMC6::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-MALLOC
  * NUCLEO_F429ZI::ARMC6::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-MEMORYPOOL
  * NUCLEO_F429ZI::ARMC6::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-MUTEX
  * NUCLEO_F429ZI::ARMC6::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-QUEUE
  * NUCLEO_F429ZI::ARMC6::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-SEMAPHORE
  * NUCLEO_F429ZI::ARMC6::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-SIGNALS
  * NUCLEO_F429ZI::ARMC6::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-SYSTIMER
  * NUCLEO_F429ZI::ARMC6::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-THREADS


Build successes:
  * NUCLEO_F429ZI::GCC_ARM::MBED-BUILD
  * NUCLEO_F429ZI::GCC_ARM::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-BASIC
  * NUCLEO_F429ZI::GCC_ARM::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-CONDITION_VARIABLE
  * NUCLEO_F429ZI::GCC_ARM::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-EVENT_FLAGS
  * NUCLEO_F429ZI::GCC_ARM::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-HEAP_AND_STACK
  * NUCLEO_F429ZI::GCC_ARM::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-KERNEL_TICK_COUNT
  * NUCLEO_F429ZI::GCC_ARM::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-MAIL
  * NUCLEO_F429ZI::GCC_ARM::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-MALLOC
  * NUCLEO_F429ZI::GCC_ARM::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-MEMORYPOOL
  * NUCLEO_F429ZI::GCC_ARM::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-MUTEX
  * NUCLEO_F429ZI::GCC_ARM::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-QUEUE
  * NUCLEO_F429ZI::GCC_ARM::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-SEMAPHORE
  * NUCLEO_F429ZI::GCC_ARM::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-SIGNALS
  * NUCLEO_F429ZI::GCC_ARM::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-SYSTIMER
  * NUCLEO_F429ZI::GCC_ARM::MBED-OS-RTOS-TESTS-TESTS-MBEDMICRO-RTOS-MBED-THREADS

Copy link
Contributor

@LDong-Arm LDong-Arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ashok-rao, it looks totally good to me.

One thing completely unrelated to this PR: Currently rtos_idle.h is in source/ but its rtos_attach_idle_hook() is a semi-public API to override the default idle task. It's used by a couple of targets (if we grep targets for it). In my opinion it should be either a public header or in internal, depending on whether we allow applications to use it.

Update: Okay, it's the C version (and underlying implementation) of Kernel::attach_idle_hook() which is public and C++. But target drivers are written in C mostly.

Anyway this shouldn't block the PR in my opinion.

@ciarmcom ciarmcom requested review from 0xc0170, LDong-Arm, rajkan01 and a team July 9, 2020 17:00
@ciarmcom
Copy link
Member

ciarmcom commented Jul 9, 2020

@ashok-rao, thank you for your changes.
@0xc0170 @rajkan01 @LDong-Arm @ARMmbed/mbed-os-core @ARMmbed/mbed-os-maintainers please review.

@kjbracey
Copy link
Contributor

Currently rtos_idle.h is in source/ but its rtos_attach_idle_hook() is a semi-public API to override the default idle task.

rtos_attach_idle_hook is marked as non-public by the Doxygen. Kernel::attach_idle_hook remains public, but it's a bit specialised since tickless was placed into the default hook. Replacing the hook loses a load of system bits from tickless, and there's no public way to put them back.

In my opinion it should be either a public header or in internal, depending on whether we allow applications to use it.

The concept was that headers in source could not be on the path at all for applications, and wouldn't need to be provided in a binary library drop. Unless you're changing the build system to remove that distinction, it's in the right place for a totally internal header. Only headers that need to be on the path for applications and provided in binary builds would go into include/internal.

whether we allow applications to use it.

target drivers are written in C mostly

Confusion over application versus target hook there. It's documented as an application hook, which means targets should not be using it.

@LDong-Arm
Copy link
Contributor

LDong-Arm commented Jul 10, 2020

@kjbracey-arm Totally agreed.

Confusion over application versus target hook there. It's documented as an application hook, which means targets should not be using it.

Idle hooks are used by (or, present in the code bases of) a few targets. I should've raised an issue earlier, and now it's time to do it.

In this case this PR looks totally good to me.

@LDong-Arm
Copy link
Contributor

@kjbracey-arm
#13265 created

evedon
evedon previously requested changes Jul 14, 2020
Copy link
Contributor

@evedon evedon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In mbed_rtos_types.h, osThreadFlagsSet is declared as a public API. This is used in the bare metal profile to set flags on the main thread (flags can be set from IRQ). Perhaps this function should be declared in a different header, for example ThisThread.h. And you need to udate the doxygen comment in mbed_rtos_types.h.
Alternatively, I would not move the three headers to rtos/internal in this PR and do this separately.

@ashok-rao ashok-rao requested a review from evedon July 15, 2020 12:55
@mergify mergify bot dismissed evedon’s stale review July 15, 2020 12:56

Pull request has been modified.

@evedon
Copy link
Contributor

evedon commented Jul 15, 2020

Could you also simplify the path for greentea tests as we don't need the extra mbedmicro-rtos-mbed. So we can have rtos/tests/TESTS/mutex/main.cpp directly.

It seems that our build tools don't support this and require a parent directory under TESTS so we don't do this now.

evedon
evedon previously approved these changes Jul 16, 2020
@mergify mergify bot added needs: CI and removed needs: work labels Jul 16, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Jul 16, 2020

@ashok-rao Before we run CI, can you extend the first commit message - add a reason why are we moving ? Copy-paste from PR description would be good.

@adbridge adbridge added release-type: patch Indentifies a PR as containing just a patch and removed needs: CI labels Jul 17, 2020
@adbridge
Copy link
Contributor

CI started

@mbed-ci
Copy link

mbed-ci commented Jul 17, 2020

Test run: FAILED

Summary: 1 of 3 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_unittests

@mergify mergify bot dismissed evedon’s stale review July 19, 2020 17:03

Pull request has been modified.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 20, 2020

CI restarted

@mbed-ci
Copy link

mbed-ci commented Jul 20, 2020

Test run: SUCCESS

Summary: 6 of 6 test jobs passed
Build number : 2
Build artifacts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants