Skip to content

Instantly share code, notes, and snippets.

View a-rin's full-sized avatar

Akihiko HAYASHI/ 林 昭彦 a-rin

  • Gifu, Japan
View GitHub Profile
@a-rin
a-rin / dmesg_pciconf.txt
Created June 19, 2023 15:57
FreeBSD 13.2R dmesg, pciconf @ TRIGKEY G5 Mini PC 16GB DDR5 500GB M.2 NVME SSD
# dmesg
Copyright (c) 1992-2021 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC amd64
FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c)
VT(efifb): resolution 1920x1080
CPU: Intel(R) N100 (806.40-MHz K8-class CPU)
Origin="GenuineIntel" Id=0xb06e0 Family=0x6 Model=0xbe Stepping=0
@a-rin
a-rin / ippicv.diff
Created September 26, 2021 05:52
FreeBSD 11/stable ports/graphics/opencv patch.
--- 3rdparty/ippicv/ippicv_lnx/iw/src/iw_core.c.orig 2019-10-19 03:01:22.000000000 +0900
+++ 3rdparty/ippicv/ippicv_lnx/iw/src/iw_core.c 2021-07-20 18:02:05.822472000 +0900
@@ -59,7 +59,7 @@
#pragma message("Atomic operations are not supported by this compiler. Some features my not be thread-safe.")
#endif
#endif
- #ifndef __APPLE__
+ #if !(defined (__APPLE__) || defined(__FreeBSD__))
#include <malloc.h>
#endif
@a-rin
a-rin / tmux_control.c.patch
Last active April 20, 2021 02:59
add attribute to static printflike function for clang: external/bsd/tmux/dist/control.c, tmux.h
--- src/external/bsd/tmux/dist/control.c.orig 2021-04-18 17:09:13.715018000 +0900
+++ src/external/bsd/tmux/dist/control.c 2021-04-20 01:42:45.223456000 +0900
@@ -385,7 +385,7 @@
}
/* Write a line. */
-static void
+static void printflike(2, 0)
control_vwrite(struct client *c, const char *fmt, va_list ap)
{
@a-rin
a-rin / subr_evcnt.c.patch
Last active April 15, 2021 14:48
NetBSD src/sys/kern/subr_evcnt.c patch
--- src/sys/kern/subr_evcnt.c.orig 2021-04-15 19:11:30.833915000 +0900
+++ src/sys/kern/subr_evcnt.c 2021-04-15 23:44:28.332293000 +0900
@@ -214,13 +214,14 @@
mutex_exit(&evcnt_lock);
}
-struct xevcnt_sysctl {
+union xevcnt_sysctl {
struct evcnt_sysctl evs;
- char ev_strings[2*EVCNT_STRING_MAX];
@a-rin
a-rin / vim_makefile.patch
Created April 12, 2021 06:49
FreeBSD ports/editors/vim/Makefile patch
--- Makefile.orig 2021-04-12 15:42:10.693662000 +0900
+++ Makefile 2021-04-12 15:20:52.315688000 +0900
@@ -172,7 +172,7 @@
post-configure:
# Needed when devel/libsysinfo is installed:
- ${REINPLACE_CMD} -e '/#define HAVE_SYSINFO 1/ d' ${WRKSRC}/src/auto/config.h
+ ${REINPLACE_CMD} -e '/#define HAVE_SYSINFO[_A-Z]* 1/ d' ${WRKSRC}/src/auto/config.h
post-install-DEFAULT_VIMRC-on:
@a-rin
a-rin / sys.turnstile0.patch
Created November 24, 2019 00:50
NetBSD patch variable turnstile0: added __cacheline_aligned attribute
--- src/sys/sys/sleepq.h.orig 2019-11-23 16:55:25.712963000 +0900
+++ src/sys/sys/sleepq.h 2019-11-23 19:37:30.573774000 +0900
@@ -178,7 +178,7 @@
void turnstile_changepri(lwp_t *, pri_t);
extern pool_cache_t turnstile_cache;
-extern turnstile_t turnstile0;
+extern turnstile_t turnstile0 __cacheline_aligned;
#endif /* _KERNEL */
@a-rin
a-rin / sysinst.patch
Created June 20, 2019 03:02
NetBSD usr.sbin/sysinst clang patch
--- src/usr.sbin/sysinst/Makefile.inc.orig 2019-06-18 03:36:39.000000000 +0900
+++ src/usr.sbin/sysinst/Makefile.inc 2019-06-19 23:32:23.034442000 +0900
@@ -119,6 +119,7 @@
.endif
COPTS.msg_defs.c+= -Wno-format-nonliteral
+COPTS.configmenu.c+= -Wno-format-nonliteral -Wno-format-security
.if (!defined(SMALLPROG) || defined(SMALLPROG_INET6)) && (${USE_INET6} != "no")
CPPFLAGS+=-DINET6
@a-rin
a-rin / cmpci.patch
Created May 12, 2019 06:33
patch for llvm build: attribute police & unused function police
--- src/sys/dev/pci/cmpci.c.orig 2019-05-10 16:38:07.447428000 +0900
+++ src/sys/dev/pci/cmpci.c 2019-05-11 11:34:10.177755000 +0900
@@ -92,7 +92,9 @@
static inline void cmpci_reg_set_reg_misc(struct cmpci_softc *, uint32_t);
static inline void cmpci_reg_clear_reg_misc(struct cmpci_softc *, uint32_t);
static int cmpci_rate_to_index(int);
+#if UNUSED_FUNCTION
static inline int cmpci_index_to_rate(int);
+#endif
static inline int cmpci_index_to_divider(int);
@a-rin
a-rin / openssh.patch
Created April 23, 2019 06:21
NetBSD openssh patch for llvm-build
--- src/crypto/external/bsd/openssh/Makefile.inc.orig 2018-04-07 19:08:05.869339000 +0900
+++ src/crypto/external/bsd/openssh/Makefile.inc 2019-04-23 12:03:37.709493000 +0900
@@ -46,3 +46,5 @@
CPPFLAGS+=-DSUPPORT_UTMP -DSUPPORT_UTMPX
CPPFLAGS+=-DLIBWRAP
+CWARNFLAGS.clang+= -Wno-format-nonliteral
+
--- src/crypto/external/bsd/openssh/dist/packet.h.orig 2019-04-22 17:43:07.146526000 +0900
+++ src/crypto/external/bsd/openssh/dist/packet.h 2019-04-23 12:56:47.351230000 +0900
@a-rin
a-rin / sup_done.patch
Created February 14, 2019 07:41
usr.sbin/sup: done() is not __dead. and add /* NOTREACHED *//* FALLTHROUGH */ comment
--- src/usr.sbin/sup/source/supextern.h.orig 2019-02-04 16:05:22.099507000 +0900
+++ src/usr.sbin/sup/source/supextern.h 2019-02-07 11:34:58.420600000 +0900
@@ -133,7 +133,7 @@
int copyfile(char *, char *);
void finishup(int);
void done(int, const char *, ...)
- __attribute__((__format__(__printf__, 2, 3))) __dead;
+ __attribute__((__format__(__printf__, 2, 3)));
void goaway(const char *, ...)
__attribute__((__format__(__printf__, 1, 2)));