You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the advantages of Tock's supporting processes written in C is that you can take existing C code and (comparatively) easily port it into Tock. This has been fine so far for some simpler chunks of C (like the first RF233 stack). I'm porting a whole U2F application, however, and name collisions are becoming a problem. In particular, the fact that libtock-c defines names like "timer.h", "console.h", and "crc.h" causes name collisions for #include directives which are frustrating to track down (and then change many includes in many files).
Here are three options:
Continue as now and have process writers suck it up. This makes sense if we want to strongly prioritize greenfield process writing over porting, such that the benefits of simpler names to greenfield apps outweigh the costs to ports.
Change all of the tock include files to be tock_, e.g., tock_timer.h. This allows us to keep the current directory structure and include directives.
Change all of the tock include files to be included as #include tock/, e.g., #include tock/timer.h. This allows us to keep the current file names but will require a slightly different directory structure.
The second two options also relate to the syscall names themselves. For example, I'm running into a case when I need to run AES with different modes than what the current Tock syscalls provide. In this particular case, it's not too difficult to avoid conflicts because the AES functions are very descriptively named, but requiring different timer abstractions for 64 bit timestamps is a bit trickier.
The text was updated successfully, but these errors were encountered:
One of the advantages of Tock's supporting processes written in C is that you can take existing C code and (comparatively) easily port it into Tock. This has been fine so far for some simpler chunks of C (like the first RF233 stack). I'm porting a whole U2F application, however, and name collisions are becoming a problem. In particular, the fact that libtock-c defines names like "timer.h", "console.h", and "crc.h" causes name collisions for #include directives which are frustrating to track down (and then change many includes in many files).
Here are three options:
tock_
, e.g.,tock_timer.h
. This allows us to keep the current directory structure and include directives.#include tock/
, e.g.,#include tock/timer.h
. This allows us to keep the current file names but will require a slightly different directory structure.The second two options also relate to the syscall names themselves. For example, I'm running into a case when I need to run AES with different modes than what the current Tock syscalls provide. In this particular case, it's not too difficult to avoid conflicts because the AES functions are very descriptively named, but requiring different timer abstractions for 64 bit timestamps is a bit trickier.
The text was updated successfully, but these errors were encountered: