diff options
Diffstat (limited to 'share')
-rw-r--r-- | share/docs/ideas/kport.txt | 5 | ||||
-rw-r--r-- | share/misc/contrib | 24 |
2 files changed, 28 insertions, 1 deletions
diff --git a/share/docs/ideas/kport.txt b/share/docs/ideas/kport.txt index b9ffc6d..de3a4b0 100644 --- a/share/docs/ideas/kport.txt +++ b/share/docs/ideas/kport.txt @@ -73,4 +73,7 @@ Description: KPORT facilitates seamless low-latency access to dedicated - The kport pool MUST have no low-level memory caching Notes: The shadow layer exists as a sandbox to isolate the backing resource - between itself and the kport layer. + between itself and the kport layer. It SHOULD contain a "shadow byte region" + (SBR), that is, an area reserved for shadow bytes used to detect clobbering + and allowing the kernel to respond accordingly (i.e., defer next write-back + and kill the process, among other things...) diff --git a/share/misc/contrib b/share/misc/contrib index 6f93fb7..a36c127 100644 --- a/share/misc/contrib +++ b/share/misc/contrib @@ -21,6 +21,22 @@ is_power_of_two(uint8_t n) return ((n & 0x01) == 0); } +-- +When defining local variables in functions, they +must be declared at the top: + +static void +foo(void) +{ + uint8_t byte; + uint16_t pair; + uint32_t quad; + uint64_t oct; + + ... +} +-- + When checking if an integer is 0 or not, *be explicit* unless it is a bool! Do not do this: @@ -87,6 +103,14 @@ a pointer, like, for example: uint8_t *ptr = NULL; ... +-- +The preferred pointer style is: + +void *p = ...; + +-- Not: + +void* p = ...; -- or if you have for example, some sort of counter value that must have a start: |