From: bluhm Date: Mon, 31 Jul 2023 17:10:31 +0000 (+0000) Subject: Mark code parameter of codepatch_replace() constant also on i386. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=758370f9b4b9ae70cbde195e176612bb0bacfcde;p=openbsd Mark code parameter of codepatch_replace() constant also on i386. OK guenther@ --- diff --git a/sys/arch/i386/i386/codepatch.c b/sys/arch/i386/i386/codepatch.c index 0865c8262f8..224fbe82370 100644 --- a/sys/arch/i386/i386/codepatch.c +++ b/sys/arch/i386/i386/codepatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: codepatch.c,v 1.5 2020/09/11 09:27:10 mpi Exp $ */ +/* $OpenBSD: codepatch.c,v 1.6 2023/07/31 17:10:31 bluhm Exp $ */ /* * Copyright (c) 2014-2015 Stefan Fritsch * @@ -147,7 +147,7 @@ codepatch_nop(uint16_t tag) /* Patch with alternative code */ void -codepatch_replace(uint16_t tag, void *code, size_t len) +codepatch_replace(uint16_t tag, const void *code, size_t len) { struct codepatch *patch; unsigned char *rwaddr; diff --git a/sys/arch/i386/include/codepatch.h b/sys/arch/i386/include/codepatch.h index 89791f46d8b..a8cccf5bd0d 100644 --- a/sys/arch/i386/include/codepatch.h +++ b/sys/arch/i386/include/codepatch.h @@ -1,4 +1,4 @@ -/* $OpenBSD: codepatch.h,v 1.2 2017/07/01 19:42:59 sf Exp $ */ +/* $OpenBSD: codepatch.h,v 1.3 2023/07/31 17:10:31 bluhm Exp $ */ /* * Copyright (c) 2014-2015 Stefan Fritsch * @@ -26,7 +26,7 @@ void *codepatch_maprw(vaddr_t *nva, vaddr_t dest); void codepatch_unmaprw(vaddr_t nva); void codepatch_fill_nop(void *caddr, uint16_t len); void codepatch_nop(uint16_t tag); -void codepatch_replace(uint16_t tag, void *code, size_t len); +void codepatch_replace(uint16_t tag, const void *code, size_t len); void codepatch_call(uint16_t tag, void *func); #endif /* !_LOCORE */