Module Name: src Committed By: kre Date: Wed Feb 8 18:50:52 UTC 2017
Modified Files: src/sys/arch/amd64/amd64: gdt.c Log Message: All bow down before the Great Code Compiler. Specifically, it has been commanded that unused-functions is a warning, and, as all should know, all warnings be errors. Hence, since XEN kernels do not call set_sys_gdt(), that function may not be included (and the XEN kernel saves a few tens of bytes.) An alternate fix would be to just remove "static" - but that would be the equivalent to just giving the compiler the finger ... hmm, maybe that would have been a better fix... To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/arch/amd64/amd64/gdt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/amd64/amd64/gdt.c diff -u src/sys/arch/amd64/amd64/gdt.c:1.36 src/sys/arch/amd64/amd64/gdt.c:1.37 --- src/sys/arch/amd64/amd64/gdt.c:1.36 Wed Feb 8 10:08:26 2017 +++ src/sys/arch/amd64/amd64/gdt.c Wed Feb 8 18:50:51 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: gdt.c,v 1.36 2017/02/08 10:08:26 maxv Exp $ */ +/* $NetBSD: gdt.c,v 1.37 2017/02/08 18:50:51 kre Exp $ */ /*- * Copyright (c) 1996, 1997, 2009 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.36 2017/02/08 10:08:26 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.37 2017/02/08 18:50:51 kre Exp $"); #include "opt_multiprocessor.h" #include "opt_xen.h" @@ -63,7 +63,9 @@ int gdt_dynavail; int gdt_next; /* next available slot for sweeping */ int gdt_free; /* next free slot; terminated with GNULL_SEL */ +#if defined(USER_LDT) || !defined(XEN) static void set_sys_gdt(int, void *, size_t, int, int, int); +#endif void gdt_init(void); void @@ -85,6 +87,7 @@ update_descriptor(void *tp, void *ep) #endif } +#if defined(USER_LDT) || !defined(XEN) /* * Called on a newly-allocated GDT slot, so no race between CPUs. */ @@ -107,6 +110,7 @@ set_sys_gdt(int slot, void *base, size_t update_descriptor(&ci->ci_gdt[idx + 1], &d.bits[1]); } } +#endif /* USER_LDT || !XEN */ /* * Initialize the GDT. We already have a gdtstore, which was temporarily used