tegra_hv: stop compiling unused APIs for prod kernel

- stop compiling unused APIs for prod kernel
- remove APIs having just function declaration

Jira ESLC-8593

Change-Id: I8acd01a88e0ea4c3792d7080f685bcac9c9cf559
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3363569
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
This commit is contained in:
Manish Bhardwaj
2025-05-13 21:03:48 +00:00
committed by Jon Hunter
parent d6ef2a4201
commit 9c6469ff98
3 changed files with 10 additions and 30 deletions

View File

@@ -4,6 +4,10 @@
# #
# Makefile for Hypervisor interface # Makefile for Hypervisor interface
# #
ifeq ($(CONFIG_LOCALVERSION), -prod)
ccflags-y += -DCONFIG_BUILD_PROD
endif
ifneq ($(NV_OOT_TEGRA_HV_SKIP_BUILD),y) ifneq ($(NV_OOT_TEGRA_HV_SKIP_BUILD),y)
obj-m += tegra_hv.o obj-m += tegra_hv.o
else else

View File

@@ -819,6 +819,7 @@ int tegra_hv_ivc_read_user(struct tegra_hv_ivc_cookie *ivck, void __user *buf, i
} }
EXPORT_SYMBOL(tegra_hv_ivc_read_user); EXPORT_SYMBOL(tegra_hv_ivc_read_user);
#ifndef CONFIG_BUILD_PROD
int tegra_hv_ivc_read_peek(struct tegra_hv_ivc_cookie *ivck, void *buf, int tegra_hv_ivc_read_peek(struct tegra_hv_ivc_cookie *ivck, void *buf,
int off, int count) int off, int count)
{ {
@@ -827,6 +828,7 @@ int tegra_hv_ivc_read_peek(struct tegra_hv_ivc_cookie *ivck, void *buf,
return tegra_ivc_read_peek(&ivc->ivc, NULL, buf, off, count); return tegra_ivc_read_peek(&ivc->ivc, NULL, buf, off, count);
} }
EXPORT_SYMBOL(tegra_hv_ivc_read_peek); EXPORT_SYMBOL(tegra_hv_ivc_read_peek);
#endif
int tegra_hv_ivc_can_read(struct tegra_hv_ivc_cookie *ivck) int tegra_hv_ivc_can_read(struct tegra_hv_ivc_cookie *ivck)
{ {
@@ -844,6 +846,7 @@ int tegra_hv_ivc_can_write(struct tegra_hv_ivc_cookie *ivck)
} }
EXPORT_SYMBOL(tegra_hv_ivc_can_write); EXPORT_SYMBOL(tegra_hv_ivc_can_write);
#ifndef CONFIG_BUILD_PROD
int tegra_hv_ivc_tx_empty(struct tegra_hv_ivc_cookie *ivck) int tegra_hv_ivc_tx_empty(struct tegra_hv_ivc_cookie *ivck)
{ {
struct hv_ivc *ivc = cookie_to_ivc_dev(ivck); struct hv_ivc *ivc = cookie_to_ivc_dev(ivck);
@@ -874,6 +877,7 @@ int tegra_hv_ivc_dump(struct tegra_hv_ivc_cookie *ivck)
return ivc_dump(ivc); return ivc_dump(ivc);
} }
EXPORT_SYMBOL(tegra_hv_ivc_dump); EXPORT_SYMBOL(tegra_hv_ivc_dump);
#endif
void *tegra_hv_ivc_read_get_next_frame(struct tegra_hv_ivc_cookie *ivck) void *tegra_hv_ivc_read_get_next_frame(struct tegra_hv_ivc_cookie *ivck)
{ {

View File

@@ -132,6 +132,7 @@ int tegra_hv_ivc_can_read(struct tegra_hv_ivc_cookie *ivck);
*/ */
int tegra_hv_ivc_can_write(struct tegra_hv_ivc_cookie *ivck); int tegra_hv_ivc_can_write(struct tegra_hv_ivc_cookie *ivck);
#ifndef CONFIG_BUILD_PROD
/** /**
* tegra_ivc_tx_frames_available - gets number of free entries in tx queue * tegra_ivc_tx_frames_available - gets number of free entries in tx queue
* @ivc/@ivck IVC channel or cookie * @ivc/@ivck IVC channel or cookie
@@ -153,21 +154,6 @@ uint32_t tegra_hv_ivc_tx_frames_available(struct tegra_hv_ivc_cookie *ivck);
*/ */
int tegra_hv_ivc_tx_empty(struct tegra_hv_ivc_cookie *ivck); int tegra_hv_ivc_tx_empty(struct tegra_hv_ivc_cookie *ivck);
/**
* ivc_hv_ivc_loopback - Sets (or clears) loopback mode
* @ivck IVC cookie of the queue
* @mode Set loopback on/off (1 = on, 0 = off)
*
* Sets or clears loopback mode accordingly.
*
* When loopback is active any writes are ignored, while
* reads do not return data.
* Incoming data are copied immediately to the tx queue.
*
* Returns 0 on success, a negative error code otherwise
*/
int tegra_hv_ivc_set_loopback(struct tegra_hv_ivc_cookie *ivck, int mode);
/* debugging aid */ /* debugging aid */
int tegra_hv_ivc_dump(struct tegra_hv_ivc_cookie *ivck); int tegra_hv_ivc_dump(struct tegra_hv_ivc_cookie *ivck);
@@ -186,6 +172,7 @@ int tegra_hv_ivc_dump(struct tegra_hv_ivc_cookie *ivck);
int tegra_hv_ivc_read_peek(struct tegra_hv_ivc_cookie *ivck, int tegra_hv_ivc_read_peek(struct tegra_hv_ivc_cookie *ivck,
void *buf, int off, int count); void *buf, int off, int count);
#endif
/** /**
* ivc_hv_ivc_read_get_next_frame - Peek at the next frame to receive * ivc_hv_ivc_read_get_next_frame - Peek at the next frame to receive
* @ivck IVC cookie of the queue * @ivck IVC cookie of the queue
@@ -207,21 +194,6 @@ void *tegra_hv_ivc_read_get_next_frame(struct tegra_hv_ivc_cookie *ivck);
*/ */
int tegra_hv_ivc_read_advance(struct tegra_hv_ivc_cookie *ivck); int tegra_hv_ivc_read_advance(struct tegra_hv_ivc_cookie *ivck);
/**
* ivc_hv_ivc_write_poke - Poke data to a frame to be transmitted
* @ivck IVC cookie of the queue
* @buf Buffer to the data
* @off Offset in the frame
* @count Count of bytes to copy
*
* Copy data to a transmit frame, copying from buf, without advancing
* the the transmit queue.
*
* Returns 0 on success, a negative error code otherwise
*/
int tegra_hv_ivc_write_poke(struct tegra_hv_ivc_cookie *ivck,
const void *buf, int off, int count);
/** /**
* ivc_hv_ivc_write_get_next_frame - Poke at the next frame to transmit * ivc_hv_ivc_write_get_next_frame - Poke at the next frame to transmit
* @ivck IVC cookie of the queue * @ivck IVC cookie of the queue