I'm working on getting kfd_proces.c working, and it uses quite a few functions from mmu_notifier in the LinuxKPI. I have added them in to allow the file to compile. I will note that I did not fully implement them, and have left a warning to expect issues if you execute the file.
https://github.com/ROCm/amdgpu/blob/8fa1981194836936acd57c4cf4b3fd694af47cc3/drivers/gpu/drm/amd/amdkfd/kfd_process.c
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
I have https://reviews.freebsd.org/D58169 open in case you want to see a pr_debug() example file with a lot more stubbed only functions.
| sys/compat/linuxkpi/common/include/linux/mmu_notifier.h | ||
|---|---|---|
| 30 | #include <linux/kernel.h> /* for pr_debug */ | |
| 37 | While clear, the #warning is not needed. We have temporary placeholders in a lot of places in LinuxKPI. The important bit is that if return values are required, that they signal an error according to the API. | |
| 57 | Where function arguments are no used, we could annotate them with __unused | |
| 59 | Add before return: pr_debug("%s TODO\n", __func__);here and for all the functions below. | |
| 59 | return (0); return values get () | |
| sys/compat/linuxkpi/common/include/linux/mmu_notifier.h | ||
|---|---|---|
| 37 | Sounds good, I'll remove the warning and make the other changes | |
| sys/compat/linuxkpi/common/include/linux/mmu_notifier.h | ||
|---|---|---|
| 37 | Well, all you return is 0 and NULL so far. I'll comment on those two below. If a driver is bugged beyond expectations then bugs need to be fixed but that is for that code and not this one here ;-) I know of nothing else to add beyond pr_debug(). | |
| 59 | -EINVAL is a valid return value for the function a driver needs to deal with, so you could use that. | |
| 70 | ops != NULL && ... != NULL return () | |
| 73 | return (ERR_PTR(-EINVAL)); should be fine here. | |
| 79 | Same here. != NULL checks for style. | |
| sys/compat/linuxkpi/common/include/linux/mmu_notifier.h | ||
|---|---|---|
| 37 | Alright then, sounds good, I'll make the changes and add in pr_debug() | |