Skip to content

Commit

Permalink
FreeBSD: support charp module_params like hw.amdgpu.virtual_display, f…
Browse files Browse the repository at this point in the history
  • Loading branch information
valpackett committed May 5, 2023
1 parent e101ea9 commit d379950
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,6 @@ module_param_named(pg_mask, amdgpu_pg_mask, uint, 0444);
MODULE_PARM_DESC(sdma_phase_quantum, "SDMA context switch phase quantum (x 1K GPU clock cycles, 0 = no change (default 32))");
module_param_named(sdma_phase_quantum, amdgpu_sdma_phase_quantum, uint, 0444);

#ifdef __linux__
/**
* DOC: disable_cu (charp)
* Set to disable CUs (It's set like se.sh.cu,...). The default is NULL.
Expand All @@ -526,7 +525,6 @@ module_param_named(disable_cu, amdgpu_disable_cu, charp, 0444);
MODULE_PARM_DESC(virtual_display,
"Enable virtual display feature (the virtual_display will be set like xxxx:xx:xx.x,x;xxxx:xx:xx.x,x)");
module_param_named(virtual_display, amdgpu_virtual_display, charp, 0444);
#endif

/**
* DOC: job_hang_limit (int)
Expand Down
11 changes: 11 additions & 0 deletions linuxkpi/bsd/include/linux/moduleparam.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@

#include <linux/types.h>

extern int lkpi_sysctl_handle_charp(SYSCTL_HANDLER_ARGS);

#ifndef LINUXKPI_PARAM_PARENT
#define LINUXKPI_PARAM_PARENT _compat_linuxkpi
#endif
Expand Down Expand Up @@ -148,6 +150,15 @@ SYSCTL_DECL(_dev_drm);
name, LINUXKPI_PARAM_PERM(perm), &(var), 0,\
LINUXKPI_PARAM_DESC(name)))

#define LINUXKPI_PARAM_charp(name, var, perm) \
extern const char LINUXKPI_PARAM_DESC(name)[]; \
LINUXKPI_PARAM_PASS(SYSCTL_PROC(LINUXKPI_PARAM_PARENT, OID_AUTO, \
LINUXKPI_PARAM_NAME(name), LINUXKPI_PARAM_PERM(perm) | CTLTYPE_STRING | CTLFLAG_MPSAFE, \
&(var), 0, lkpi_sysctl_handle_charp, "A", LINUXKPI_PARAM_DESC(name))); \
LINUXKPI_PARAM_PASS(SYSCTL_PROC(DRM_PARAM_NAME, OID_AUTO, \
name, LINUXKPI_PARAM_PERM(perm) | CTLTYPE_STRING | CTLFLAG_MPSAFE, \
&(var), 0, lkpi_sysctl_handle_charp, "A", LINUXKPI_PARAM_DESC(name)))

#define module_param_string(name, str, len, perm) \
extern const char LINUXKPI_PARAM_DESC(name)[]; \
LINUXKPI_PARAM_PASS(SYSCTL_STRING(LINUXKPI_PARAM_PARENT, OID_AUTO,\
Expand Down

0 comments on commit d379950

Please sign in to comment.