Wentao Guan 066a25975f cache: fix no previous prototype for ‘grub_arch_sync_dma_caches’ in loonarch64
log :
gcc -DHAVE_CONFIG_H -I. -I..  -Wall -W  -DGRUB_MACHINE_EFI=1 -DGRUB_MACHINE=LOONGARCH64_EFI -nostdinc -isystem /usr/lib/gcc/loongarch64-linux-gnu/12/include -I../include -I../include -DGRUB_FILE=\"kern/loongarch64/cache.c\" -I. -I. -I.. -I.. -I../include -I../include -I../grub-core/lib/libgcrypt-grub/src/   -DGRUB_KERNEL=1  -D_FILE_OFFSET_BITS=64 -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -freg-struct-return -mno-explicit-relocs -fno-plt -Wa,-mla-global-with-abs -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -fno-unwind-tables -mcmodel=large -fno-stack-protector -Wtrampolines -Werror   -ffreestanding -fshort-wchar   -MT kern/loongarch64/kernel_exec-cache.o -MD -MP -MF kern/loongarch64/.deps-core/kernel_exec-cache.Tpo -c -o kern/loongarch64/kernel_exec-cache.o `test -f 'kern/loongarch64/cache.c' || echo './'`kern/loongarch64/cache.c
kern/loongarch64/cache.c:35:1: error: no previous prototype for ‘grub_arch_sync_dma_caches’ [-Werror=missing-prototypes]
   35 | grub_arch_sync_dma_caches (volatile void *address __attribute__((unused)),
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
mv -f kern/loongarch64/.deps-core/kernel_exec-cache_flush.Tpo kern/loongarch64/.deps-core/kernel_exec-cache_flush.Po
gcc -E -DGRUB_LST_GENERATOR -Dgrub_fs_register=FS_LIST_MARKER -Dgrub_video_register=VIDEO_LIST_MARKER -Dgrub_parttool_register=PARTTOOL_LIST_MARKER -Dgrub_partition_map_register=PARTMAP_LIST_MARKER '-Dgrub_term_register_input(...)=INPUT_TERMINAL_LIST_MARKER(__VA_ARGS__)' '-Dgrub_term_register_output(...)=OUTPUT_TERMINAL_LIST_MARKER(__VA_ARGS__)' '-Dgrub_register_command(...)=COMMAND_LIST_MARKER(__VA_ARGS__)' '-Dgrub_register_extcmd(...)=EXTCOMMAND_LIST_MARKER(__VA_ARGS__)' '-Dgrub_register_command_p1(...)=P1COMMAND_LIST_MARKER(__VA_ARGS__)' '-Dgrub_fdtbus_register(...)=FDT_DRIVER_LIST_MARKER(__VA_ARGS__)' -DHAVE_CONFIG_H -I. -I..  -Wall -W  -DGRUB_MACHINE_EFI=1 -DGRUB_MACHINE=LOONGARCH64_EFI -nostdinc -isystem /usr/lib/gcc/loongarch64-linux-gnu/12/include -I../include -I../include -DGRUB_FILE=\"lib/efi/halt.c\" -I. -I. -I.. -I.. -I../include -I../include -I../grub-core/lib/libgcrypt-grub/src/    -D_FILE_OFFSET_BITS=64 lib/efi/halt.c commands/halt.c > halt.marker.new || (rm -f halt.marker; exit 1)
cc1: all warnings being treated as errors
make[3]: *** [Makefile:40251:kern/loongarch64/kernel_exec-cache.o] 错误 1

Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00

59 lines
1.8 KiB
C

/* cache.h - Flush the processor's cache. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2004,2007 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRUB_CACHE_H
#define GRUB_CACHE_H 1
#include <grub/symbol.h>
#include <grub/types.h>
#if defined (__i386__) || defined (__x86_64__)
static inline void
grub_arch_sync_caches (void *address __attribute__ ((unused)),
grub_size_t len __attribute__ ((unused)))
{
}
#else
void EXPORT_FUNC(grub_arch_sync_caches) (void *address, grub_size_t len);
#endif
#ifndef GRUB_MACHINE_EMU
#if defined (__aarch64__) || defined (__ia64__) || defined (__powerpc__) || \
defined (__sparc__)
#elif defined (__i386__) || defined (__x86_64__)
static inline void
grub_arch_sync_dma_caches (volatile void *address __attribute__ ((unused)),
grub_size_t len __attribute__ ((unused)))
{
}
#elif defined(__mips__) && (_MIPS_SIM != _ABI64)
void EXPORT_FUNC(grub_arch_sync_dma_caches) (volatile void *address, grub_size_t len);
#else
void EXPORT_FUNC(grub_arch_sync_dma_caches) (volatile void *address, grub_size_t len);
#endif
#endif
#ifdef __arm__
void
grub_arm_cache_enable (void);
#endif
#endif /* ! GRUB_CACHE_HEADER */