Tested by making sure both eamiotest and aciotest with eamio-icca work with an ICCA I have, as well as sdvxio-kfca on a cab.
In GitLab by @xyen on Mar 10, 2021, 08:55
_Merges aciomgr -> master_
## Summary
Adds ACIO manager to BT
## Description
ACIO Manager, or aciomgr, is used to allow multiple separate DLLs in the same process access to the same ACIO bus.
ex: KFCA and ICCA.
This PR also updates the relevant io DLL's, and fixes some minor issues with eamiotest.
## Related Issue
#62
## How Has This Been Tested?
Tested by making sure both eamiotest and aciotest with eamio-icca work with an ICCA I have, as well as sdvxio-kfca on a cab.
In GitLab by @xyen on Mar 10, 2021, 09:19
added 1 commit
<ul><li>d3e98e41 - eamio-icca: fix config prefix</li></ul>
[Compare with previous version](/djhackers/bemanitools/-/merge_requests/83/diffs?diff_id=1525&start_sha=db27c58b9501055ec61435681b313485234b5e11)
Do we actually have to introduce deprecation? This is not part of any "public" API and all (known) dependencies are part of BT5.
Are there any disadvantages if we make all code use acio mgr even if they just use a single device?
Do we actually have to introduce deprecation? This is not part of any "public" API and all (known) dependencies are part of BT5.
Are there any disadvantages if we make all code use acio mgr even if they just use a single device?
Now seeing checking, is it binding it to the current thread? Not sure what's a good terminology here, alternatives: "acquire"/"release" (though this is rather used for locks/semaphores), "bind"/"unbind"?
Now seeing checking, is it binding it to the current thread? Not sure what's a good terminology here, alternatives: "acquire"/"release" (though this is rather used for locks/semaphores), "bind"/"unbind"?
That's a very non transparent DllMain that I would not expect there. I assume you want to achieve having aciomgr initialized/shutdown. Would it be possible to add this explicitly to the applications/DLLs that actually need it? This would break the way, we setup any kind of hooking/emulation code in the various hook libraries.
That's a very non transparent DllMain that I would not expect there. I assume you want to achieve having aciomgr initialized/shutdown. Would it be possible to add this explicitly to the applications/DLLs that actually need it? This would break the way, we setup any kind of hooking/emulation code in the various hook libraries.
dispatcher->references is not atomic, so depending on the timing, we might run into visibility issues here if not part of the critical section. Suggestion: Make that size_t references var an atomic_int?
`dispatcher->references` is not atomic, so depending on the timing, we might run into visibility issues here if not part of the critical section. Suggestion: Make that `size_t references` var an atomic_int?
Looking at the code, the function name might be somewhat misleading. Maybe a brief comment that the base functionality is identical on these models might be helpful.
Looking at the code, the function name might be somewhat misleading. Maybe a brief comment that the base functionality is identical on these models might be helpful.
Some more magic number nit: I would move these to some macros at the top of the file:
```
#define COM_PORT_ICCA_DEFAULT "COM1"
#define BAUD_RATE_ICCA_DEFAULT 57600
```
Nit code style: Empty line before and after control blocks (also in the code following this line).
Apply the clang code style on all source files: make code-format
Nit code style: Empty line before and after control blocks (also in the code following this line).
Apply the clang code style on all source files: `make code-format`
No, because the locks synchronizing everything must be setup before anything else can be called. Doing it here doesn't break how our hooks or emulation code works at all.
In GitLab by @xyen on Mar 14, 2021, 14:34
Commented on [src/main/aciomgr/manager.c line 205](https://github.com/djhackersdev/bemanitools/compare/d0dde39f31feb7dc7b745cbf2c5263bf6bb9eb34..d3e98e41078658038968b720306d9de57a73c58f#diff-a8a45181f6fd1b5e7c886482d90cfbe2R205)
No, because the locks synchronizing everything must be setup before anything else can be called. Doing it here doesn't break how our hooks or emulation code works at all.
In GitLab by @xyen on Mar 15, 2021, 24:53
Commented on [src/main/aciomgr/manager.c line 205](https://github.com/djhackersdev/bemanitools/compare/d0dde39f31feb7dc7b745cbf2c5263bf6bb9eb34..d3e98e41078658038968b720306d9de57a73c58f#diff-a8a45181f6fd1b5e7c886482d90cfbe2R205)
sounds good to me, will do
additional complexity, also I added this so that when new usages of this are added, it forces the dev to think about th e use-case, and be clear with which one they use.
In GitLab by @xyen on Mar 16, 2021, 01:32
Commented on [src/main/aciodrv/device.h line 23](https://github.com/djhackersdev/bemanitools/compare/5ae0ed21cd175c4d58156cea005dca34bd55fc94..3cc0f18bfcf79ccc7817f9d61a3f513384415763#diff-0544df3e9b766ee152cd4529e18f0318R23)
additional complexity, also I added this so that when new usages of this are added, it forces the dev to think about th e use-case, and be clear with which one they use.
In GitLab by @xyen on Mar 16, 2021, 01:36
Commented on [src/main/aciomgr/manager.h line 71](https://github.com/djhackersdev/bemanitools/compare/5ae0ed21cd175c4d58156cea005dca34bd55fc94..3cc0f18bfcf79ccc7817f9d61a3f513384415763#diff-0e512b20702fdb4330c91ee5b17f3fa8R71)
checkout the device handler from the manager
checkout/checkin sound fine to me, since yeah acquire/release is used for locks, bind/unbind sound more permanent.
In GitLab by @xyen on Mar 16, 2021, 01:37
Commented on [src/main/aciomgr/manager.h line 80](https://github.com/djhackersdev/bemanitools/compare/5ae0ed21cd175c4d58156cea005dca34bd55fc94..3cc0f18bfcf79ccc7817f9d61a3f513384415763#diff-0e512b20702fdb4330c91ee5b17f3fa8R80)
checkout/checkin sound fine to me, since yeah acquire/release is used for locks, bind/unbind sound more permanent.
internally they're all referred to as ICCA, but yeah, will add a comment.
In GitLab by @xyen on Mar 16, 2021, 02:39
Commented on [src/main/eamio-icca/eamio-icca.c line 59](https://github.com/djhackersdev/bemanitools/compare/d0dde39f31feb7dc7b745cbf2c5263bf6bb9eb34..d3e98e41078658038968b720306d9de57a73c58f#diff-53e2eb261a5378fe4793fbc0bd71499cR59)
internally they're all referred to as ICCA, but yeah, will add a comment.
calling that causes changes in over 100 files, will make a PR later that does this
In GitLab by @xyen on Mar 16, 2021, 02:52
Commented on [src/main/eamio-icca/eamio-icca.c line 112](https://github.com/djhackersdev/bemanitools/compare/5ae0ed21cd175c4d58156cea005dca34bd55fc94..3cc0f18bfcf79ccc7817f9d61a3f513384415763#diff-53e2eb261a5378fe4793fbc0bd71499cR112)
calling that causes changes in over 100 files, will make a PR later that does this
In GitLab by @xyen on Mar 16, 2021, 03:44
Commented on [src/main/aciomgr/manager.h line 51](https://github.com/djhackersdev/bemanitools/compare/d0dde39f31feb7dc7b745cbf2c5263bf6bb9eb34..d3e98e41078658038968b720306d9de57a73c58f#diff-0e512b20702fdb4330c91ee5b17f3fa8R51)
changed this line in [version 3 of the diff](/djhackers/bemanitools/-/merge_requests/83/diffs?diff_id=1533&start_sha=d3e98e41078658038968b720306d9de57a73c58f#adb41b23038640f018d259feb6f3e764c4a95890_51_57)
In GitLab by @xyen on Mar 16, 2021, 03:44
Commented on [src/main/sdvxio-kfca/sdvxio.c line 48](https://github.com/djhackersdev/bemanitools/compare/d0dde39f31feb7dc7b745cbf2c5263bf6bb9eb34..d3e98e41078658038968b720306d9de57a73c58f#diff-1fad6a256465ab0642a126f15ff7e64aR48)
changed this line in [version 3 of the diff](/djhackers/bemanitools/-/merge_requests/83/diffs?diff_id=1533&start_sha=d3e98e41078658038968b720306d9de57a73c58f#779511ed2fea18b42a3bc0197654e1d9a66abca5_48_48)
In GitLab by @xyen on Mar 16, 2021, 03:44
Commented on [src/main/eamio-icca/eamio-icca.c line 60](https://github.com/djhackersdev/bemanitools/compare/d0dde39f31feb7dc7b745cbf2c5263bf6bb9eb34..d3e98e41078658038968b720306d9de57a73c58f#diff-53e2eb261a5378fe4793fbc0bd71499cR60)
changed this line in [version 3 of the diff](/djhackers/bemanitools/-/merge_requests/83/diffs?diff_id=1533&start_sha=d3e98e41078658038968b720306d9de57a73c58f#866648f1348d45f4d7bf0e106345e35a7a5ae089_60_58)
In GitLab by @xyen on Mar 16, 2021, 03:44
Commented on [src/main/eamio-icca/eamio-icca.c line 52](https://github.com/djhackersdev/bemanitools/compare/d0dde39f31feb7dc7b745cbf2c5263bf6bb9eb34..d3e98e41078658038968b720306d9de57a73c58f#diff-53e2eb261a5378fe4793fbc0bd71499cR52)
changed this line in [version 3 of the diff](/djhackers/bemanitools/-/merge_requests/83/diffs?diff_id=1533&start_sha=d3e98e41078658038968b720306d9de57a73c58f#866648f1348d45f4d7bf0e106345e35a7a5ae089_52_53)
In GitLab by @xyen on Mar 16, 2021, 03:44
Commented on [src/main/aciomgr/manager.c line 77](https://github.com/djhackersdev/bemanitools/compare/d0dde39f31feb7dc7b745cbf2c5263bf6bb9eb34..d3e98e41078658038968b720306d9de57a73c58f#diff-a8a45181f6fd1b5e7c886482d90cfbe2R77)
changed this line in [version 3 of the diff](/djhackers/bemanitools/-/merge_requests/83/diffs?diff_id=1533&start_sha=d3e98e41078658038968b720306d9de57a73c58f#17c619d28711f2f67a6cf90ca237164e5dddf380_77_75)
In GitLab by @xyen on Mar 16, 2021, 03:44
Commented on [src/main/aciomgr/manager.c line 65](https://github.com/djhackersdev/bemanitools/compare/d0dde39f31feb7dc7b745cbf2c5263bf6bb9eb34..d3e98e41078658038968b720306d9de57a73c58f#diff-a8a45181f6fd1b5e7c886482d90cfbe2R65)
changed this line in [version 3 of the diff](/djhackers/bemanitools/-/merge_requests/83/diffs?diff_id=1533&start_sha=d3e98e41078658038968b720306d9de57a73c58f#17c619d28711f2f67a6cf90ca237164e5dddf380_65_63)
In GitLab by @xyen on Mar 16, 2021, 03:44
Commented on [src/main/aciomgr/manager.c line 205](https://github.com/djhackersdev/bemanitools/compare/d0dde39f31feb7dc7b745cbf2c5263bf6bb9eb34..d3e98e41078658038968b720306d9de57a73c58f#diff-a8a45181f6fd1b5e7c886482d90cfbe2R205)
changed this line in [version 3 of the diff](/djhackers/bemanitools/-/merge_requests/83/diffs?diff_id=1533&start_sha=d3e98e41078658038968b720306d9de57a73c58f#17c619d28711f2f67a6cf90ca237164e5dddf380_205_207)
In GitLab by @xyen on Mar 16, 2021, 03:44
Commented on [src/main/eamio-icca/eamio-icca.c line 59](https://github.com/djhackersdev/bemanitools/compare/d0dde39f31feb7dc7b745cbf2c5263bf6bb9eb34..d3e98e41078658038968b720306d9de57a73c58f#diff-53e2eb261a5378fe4793fbc0bd71499cR59)
changed this line in [version 3 of the diff](/djhackers/bemanitools/-/merge_requests/83/diffs?diff_id=1533&start_sha=d3e98e41078658038968b720306d9de57a73c58f#866648f1348d45f4d7bf0e106345e35a7a5ae089_59_58)
In GitLab by @xyen on Mar 16, 2021, 03:44
Commented on [src/main/eamio-icca/eamio-icca.c line 111](https://github.com/djhackersdev/bemanitools/compare/d0dde39f31feb7dc7b745cbf2c5263bf6bb9eb34..d3e98e41078658038968b720306d9de57a73c58f#diff-53e2eb261a5378fe4793fbc0bd71499cR111)
changed this line in [version 3 of the diff](/djhackers/bemanitools/-/merge_requests/83/diffs?diff_id=1533&start_sha=d3e98e41078658038968b720306d9de57a73c58f#866648f1348d45f4d7bf0e106345e35a7a5ae089_111_113)
In GitLab by @xyen on Mar 16, 2021, 03:44
added 1 commit
<ul><li>b341b6e3 - aciomgr: cleanup and address comments</li></ul>
[Compare with previous version](/djhackers/bemanitools/-/merge_requests/83/diffs?diff_id=1533&start_sha=d3e98e41078658038968b720306d9de57a73c58f)
More a personal taste question, but I would avoid having these in the "public API" header file for the module. Maybe a better solution would be to have another header file manager-init.h (feel free to come up with a better name) that just exposes those "internal" functions to be used in dllmain.c. I think this adds some clarity regarding the usage and also keeps the public header clean.
More a personal taste question, but I would avoid having these in the "public API" header file for the module. Maybe a better solution would be to have another header file `manager-init.h` (feel free to come up with a better name) that just exposes those "internal" functions to be used in `dllmain.c`. I think this adds some clarity regarding the usage and also keeps the public header clean.
Nit: We could re-use the already defined macro (I think it's somewhere in those acio node related headers...) to avoid duplication. However, feel free to leave it as is for now.
Nit: We could re-use the already defined macro (I think it's somewhere in those acio node related headers...) to avoid duplication. However, feel free to leave it as is for now.
I wanted to avoid having the manager interface depend on aciodrv, ie. I should be able to use aciomgr, with the dll and header alone.
In GitLab by @xyen on Mar 16, 2021, 20:49
Commented on [src/main/aciomgr/manager.h line 8](https://github.com/djhackersdev/bemanitools/compare/5ae0ed21cd175c4d58156cea005dca34bd55fc94..3cc0f18bfcf79ccc7817f9d61a3f513384415763#diff-0e512b20702fdb4330c91ee5b17f3fa8R8)
I wanted to avoid having the manager interface depend on aciodrv, ie. I should be able to use aciomgr, with the dll and header alone.
In GitLab by @xyen on Mar 16, 2021, 23:05
Commented on [src/main/aciomgr/manager.h line 16](https://github.com/djhackersdev/bemanitools/compare/d0dde39f31feb7dc7b745cbf2c5263bf6bb9eb34..b341b6e33e86c7943a15569b50dcf20b9db57b27#diff-0e512b20702fdb4330c91ee5b17f3fa8R16)
changed this line in [version 4 of the diff](/djhackers/bemanitools/-/merge_requests/83/diffs?diff_id=1536&start_sha=b341b6e33e86c7943a15569b50dcf20b9db57b27#adb41b23038640f018d259feb6f3e764c4a95890_16_14)
In GitLab by @xyen on Mar 16, 2021, 23:05
added 1 commit
<ul><li>37118e0a - aciomgr: move internal init stuff to manager-init.h</li></ul>
[Compare with previous version](/djhackers/bemanitools/-/merge_requests/83/diffs?diff_id=1536&start_sha=b341b6e33e86c7943a15569b50dcf20b9db57b27)
In GitLab by @xyen on Mar 16, 2021, 23:06
added 7 commits
<ul><li>5ae0ed21 - 1 commit from branch <code>master</code></li><li>e23661ae - aciodrv: fix build warnings for logging format strings</li><li>47336855 - aciomgr: Add acio manager dll</li><li>a2d396f4 - eamio-icca: add config to allow port to be set</li><li>f7dc5f1f - eamio-icca: fix config prefix</li><li>c3ed8990 - aciomgr: cleanup and address comments</li><li>3cc0f18b - aciomgr: move internal init stuff to manager-init.h</li></ul>
[Compare with previous version](/djhackers/bemanitools/-/merge_requests/83/diffs?diff_id=1538&start_sha=37118e0aa33d839814faae66a4e9541d5b4552e4)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
In GitLab by @xyen on Mar 10, 2021, 08:55
Merges aciomgr -> master
Summary
Adds ACIO manager to BT
Description
ACIO Manager, or aciomgr, is used to allow multiple separate DLLs in the same process access to the same ACIO bus.
ex: KFCA and ICCA.
This PR also updates the relevant io DLL's, and fixes some minor issues with eamiotest.
Related Issue
#62
How Has This Been Tested?
Tested by making sure both eamiotest and aciotest with eamio-icca work with an ICCA I have, as well as sdvxio-kfca on a cab.
In GitLab by @xyen on Mar 10, 2021, 09:19
added 1 commit
Compare with previous version
Do we actually have to introduce deprecation? This is not part of any "public" API and all (known) dependencies are part of BT5.
Are there any disadvantages if we make all code use acio mgr even if they just use a single device?
Nit: Avoid magic number on
char product[4]->char product[ACIO_NODE_PRODUCT_CODE_LEN]What does "checkout" mean here?
Now seeing checking, is it binding it to the current thread? Not sure what's a good terminology here, alternatives: "acquire"/"release" (though this is rather used for locks/semaphores), "bind"/"unbind"?
That's a very non transparent DllMain that I would not expect there. I assume you want to achieve having aciomgr initialized/shutdown. Would it be possible to add this explicitly to the applications/DLLs that actually need it? This would break the way, we setup any kind of hooking/emulation code in the various hook libraries.
Nit: Code style, empty line after control block.
// warn?Same here. Did you want to to do some logging here?
I see a few more of these ahead, not repeating my comments to avoid more noise.
dispatcher->referencesis not atomic, so depending on the timing, we might run into visibility issues here if not part of the critical section. Suggestion: Make thatsize_t referencesvar an atomic_int?👍 for the explanation here.
Nit: What you are stating in the comment is quote obvious imo.
Same here.
Nit: Magic number 4 (also further down). Replace with defined macro (see previous comment).
Looking at the code, the function name might be somewhat misleading. Maybe a brief comment that the base functionality is identical on these models might be helpful.
Some more magic number nit: I would move these to some macros at the top of the file:
Nit code style: Empty line before and after control blocks (also in the code following this line).
Apply the clang code style on all source files:
make code-formatNit: Another magic number with -1 ->
#define INVALID_NODE_ID -1improves readability imo (also further down).In GitLab by @xyen on Mar 14, 2021, 14:34
Commented on src/main/aciomgr/manager.c line 205
No, because the locks synchronizing everything must be setup before anything else can be called. Doing it here doesn't break how our hooks or emulation code works at all.
Ok, then this would be just about increased visibilty of that: I suggest to move the
DllMainfunction to a separatedllmain.cmodule if possible.In GitLab by @xyen on Mar 15, 2021, 24:53
Commented on src/main/aciomgr/manager.c line 205
sounds good to me, will do
In GitLab by @xyen on Mar 16, 2021, 01:32
Commented on src/main/aciodrv/device.h line 23
additional complexity, also I added this so that when new usages of this are added, it forces the dev to think about th e use-case, and be clear with which one they use.
In GitLab by @xyen on Mar 16, 2021, 01:36
Commented on src/main/aciomgr/manager.h line 71
checkout the device handler from the manager
In GitLab by @xyen on Mar 16, 2021, 01:37
Commented on src/main/aciomgr/manager.h line 80
checkout/checkin sound fine to me, since yeah acquire/release is used for locks, bind/unbind sound more permanent.
In GitLab by @xyen on Mar 16, 2021, 02:39
Commented on src/main/eamio-icca/eamio-icca.c line 59
internally they're all referred to as ICCA, but yeah, will add a comment.
In GitLab by @xyen on Mar 16, 2021, 02:52
Commented on src/main/eamio-icca/eamio-icca.c line 112
calling that causes changes in over 100 files, will make a PR later that does this
In GitLab by @xyen on Mar 16, 2021, 03:42
resolved all threads
In GitLab by @xyen on Mar 16, 2021, 03:44
Commented on src/main/aciomgr/manager.h line 51
changed this line in version 3 of the diff
In GitLab by @xyen on Mar 16, 2021, 03:44
Commented on src/main/sdvxio-kfca/sdvxio.c line 48
changed this line in version 3 of the diff
In GitLab by @xyen on Mar 16, 2021, 03:44
Commented on src/main/eamio-icca/eamio-icca.c line 60
changed this line in version 3 of the diff
In GitLab by @xyen on Mar 16, 2021, 03:44
Commented on src/main/eamio-icca/eamio-icca.c line 52
changed this line in version 3 of the diff
In GitLab by @xyen on Mar 16, 2021, 03:44
Commented on src/main/aciomgr/manager.c line 77
changed this line in version 3 of the diff
In GitLab by @xyen on Mar 16, 2021, 03:44
Commented on src/main/aciomgr/manager.c line 65
changed this line in version 3 of the diff
In GitLab by @xyen on Mar 16, 2021, 03:44
Commented on src/main/aciomgr/manager.c line 205
changed this line in version 3 of the diff
In GitLab by @xyen on Mar 16, 2021, 03:44
Commented on src/main/eamio-icca/eamio-icca.c line 59
changed this line in version 3 of the diff
In GitLab by @xyen on Mar 16, 2021, 03:44
Commented on src/main/eamio-icca/eamio-icca.c line 111
changed this line in version 3 of the diff
In GitLab by @xyen on Mar 16, 2021, 03:44
added 1 commit
Compare with previous version
Sounds good, thanks for clarifying.
resolved all threads
More a personal taste question, but I would avoid having these in the "public API" header file for the module. Maybe a better solution would be to have another header file
manager-init.h(feel free to come up with a better name) that just exposes those "internal" functions to be used indllmain.c. I think this adds some clarity regarding the usage and also keeps the public header clean.Nit: We could re-use the already defined macro (I think it's somewhere in those acio node related headers...) to avoid duplication. However, feel free to leave it as is for now.
Other than the interface thing above, lgtm. Feel free to merge it once you addressed this.
approved this merge request
In GitLab by @xyen on Mar 16, 2021, 20:49
Commented on src/main/aciomgr/manager.h line 8
I wanted to avoid having the manager interface depend on aciodrv, ie. I should be able to use aciomgr, with the dll and header alone.
In GitLab by @xyen on Mar 16, 2021, 22:55
resolved all threads
In GitLab by @xyen on Mar 16, 2021, 23:05
Commented on src/main/aciomgr/manager.h line 16
changed this line in version 4 of the diff
In GitLab by @xyen on Mar 16, 2021, 23:05
added 1 commit
Compare with previous version
In GitLab by @xyen on Mar 16, 2021, 23:06
added 7 commits
5ae0ed21- 1 commit from branchmastere23661ae- aciodrv: fix build warnings for logging format strings47336855- aciomgr: Add acio manager dlla2d396f4- eamio-icca: add config to allow port to be setf7dc5f1f- eamio-icca: fix config prefixc3ed8990- aciomgr: cleanup and address comments3cc0f18b- aciomgr: move internal init stuff to manager-init.hCompare with previous version