Skip to content
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

Eliminate kernel object API anomalies #2423

Closed
zephyrbot opened this issue Sep 16, 2016 · 2 comments
Closed

Eliminate kernel object API anomalies #2423

zephyrbot opened this issue Sep 16, 2016 · 2 comments
Labels
area: Kernel Enhancement Changes/Updates/Additions to existing features priority: high High impact/importance bug
Milestone

Comments

@zephyrbot
Copy link
Collaborator

zephyrbot commented Sep 16, 2016

Reported by Benjamin Walsh:

Most of this is already done, but keep for reference until this list is gone through with a fine comb:

A potpourri of API inconsistencies that should be fixed:

  • Complete elimination of K_type_OBJ_DEFINE() macros.
    

** These still exist for mutex and thread types.

  • Complete elimination of kernel object typdefs that aren't wanted.
    

** These still exist for mutex and memory pool.
** May also want to get rid of for timer?
** May also want to get rid of for thread? (I think Ben has a good argument for keeping this one, but I'm not sure ...)

  • Add missing delay argument support for K_THREAD_DEFINE().
    

** Currently can specify delay via k_thread_spawn() only ...

  • Ensure kernel object init API arguments match what's specified in the Kernel Primer (v2).
    

** In some cases you may need to change the code -- in other cases you may need to change the documentation.
** Should review all kernel object types, but at one point there were issues with thread, memory map, stack, message queue, and pipe.
** Issues to watch for:
*** Missing arguments; extra arguments; arguments in the wrong order.
*** Should try to have consistency when specifying "related" arguments. One thing in particular to try and ensure is that whenever an object is passed a pointer to a memory region and a size for that region, the pointer should be first and the size (or, in some cases, sizes) should be second. Right now we seem to have cases where the pointer comes last ...

  • ... other anomalies? ...
    

(Imported from Jira ZEP-916)

@zephyrbot
Copy link
Collaborator Author

by Peter Mitsis:

I believe that all these have been done.

  • K_type_OBJ_DEFINE() macros have been eliminated
  • Unwanted kernel object typedefs have been eliminated
  • K_THREAD_DEFINE() now supports a delay argument
  • Unified kernel object APIs match across headers and documentation and source
  • Arguments should now be in a consistent order

@zephyrbot
Copy link
Collaborator Author

by Sharron LIU:

I use below command to list all K_ macros defined in "kernel.h", and verified the above statements.

$ grep -n -e "^#define K_\w*(" include/kernel.h

Closing this. Thanks.

@zephyrbot zephyrbot added priority: high High impact/importance bug area: Kernel Enhancement Changes/Updates/Additions to existing features labels Sep 23, 2017
@zephyrbot zephyrbot added this to the v1.6.0 milestone Sep 23, 2017
@zephyrbot zephyrbot mentioned this issue Sep 23, 2017
49 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Kernel Enhancement Changes/Updates/Additions to existing features priority: high High impact/importance bug
Projects
None yet
Development

No branches or pull requests

1 participant