mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-08-28 03:19:35 +00:00

Zero-length arrays are deprecated[1] and are being replaced with flexible array members in support of the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy(), correctly instrument array indexing with UBSAN_BOUNDS, and to globally enable -fstrict-flex-arrays=3. Replace zero-length array with flexible-array member. This results in no differences in binary output. [1] https://github.com/KSPP/linux/issues/78 Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Karol Herbst <kherbst@redhat.com> Cc: Lyude Paul <lyude@redhat.com> Cc: David Airlie <airlied@gmail.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Gourav Samaiya <gsamaiya@nvidia.com> Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org> Cc: dri-devel@lists.freedesktop.org Cc: nouveau@lists.freedesktop.org Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org> Reviewed-by: Karol Herbst <kherbst@redhat.com> Signed-off-by: Karol Herbst <kherbst@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230103234835.never.378-kees@kernel.org
60 lines
1.2 KiB
C
60 lines
1.2 KiB
C
/* SPDX-License-Identifier: MIT */
|
|
#ifndef __NVFW_HS_H__
|
|
#define __NVFW_HS_H__
|
|
#include <core/os.h>
|
|
struct nvkm_subdev;
|
|
|
|
struct nvfw_hs_header {
|
|
u32 sig_dbg_offset;
|
|
u32 sig_dbg_size;
|
|
u32 sig_prod_offset;
|
|
u32 sig_prod_size;
|
|
u32 patch_loc;
|
|
u32 patch_sig;
|
|
u32 hdr_offset;
|
|
u32 hdr_size;
|
|
};
|
|
|
|
const struct nvfw_hs_header *nvfw_hs_header(struct nvkm_subdev *, const void *);
|
|
|
|
struct nvfw_hs_header_v2 {
|
|
u32 sig_prod_offset;
|
|
u32 sig_prod_size;
|
|
u32 patch_loc;
|
|
u32 patch_sig;
|
|
u32 meta_data_offset;
|
|
u32 meta_data_size;
|
|
u32 num_sig;
|
|
u32 header_offset;
|
|
u32 header_size;
|
|
};
|
|
|
|
const struct nvfw_hs_header_v2 *nvfw_hs_header_v2(struct nvkm_subdev *, const void *);
|
|
|
|
struct nvfw_hs_load_header {
|
|
u32 non_sec_code_off;
|
|
u32 non_sec_code_size;
|
|
u32 data_dma_base;
|
|
u32 data_size;
|
|
u32 num_apps;
|
|
u32 apps[];
|
|
};
|
|
|
|
const struct nvfw_hs_load_header *
|
|
nvfw_hs_load_header(struct nvkm_subdev *, const void *);
|
|
|
|
struct nvfw_hs_load_header_v2 {
|
|
u32 os_code_offset;
|
|
u32 os_code_size;
|
|
u32 os_data_offset;
|
|
u32 os_data_size;
|
|
u32 num_apps;
|
|
struct {
|
|
u32 offset;
|
|
u32 size;
|
|
} app[];
|
|
};
|
|
|
|
const struct nvfw_hs_load_header_v2 *nvfw_hs_load_header_v2(struct nvkm_subdev *, const void *);
|
|
#endif
|