summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2023-07-31 01:33:58 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2023-07-31 01:33:58 +0000
commit3cf9361b0320910c0548d575ba37cdd7532ad0b7 (patch)
tree95dfaaad37541ea4c9c38bfec57f4056ddd16eaf /sys/arch/amd64
parent89d1aee3704db1d34d8c523604aac62ea802c1d2 (diff)
The replacement code passed to codepatch_replace() can usefully be
const. suggested by bluhm@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/codepatch.c4
-rw-r--r--sys/arch/amd64/include/codepatch.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/amd64/amd64/codepatch.c b/sys/arch/amd64/amd64/codepatch.c
index ec32b44119c..1ed1dd993e2 100644
--- a/sys/arch/amd64/amd64/codepatch.c
+++ b/sys/arch/amd64/amd64/codepatch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: codepatch.c,v 1.9 2020/09/11 09:27:09 mpi Exp $ */
+/* $OpenBSD: codepatch.c,v 1.10 2023/07/31 01:33:57 guenther Exp $ */
/*
* Copyright (c) 2014-2015 Stefan Fritsch <sf@sfritsch.de>
*
@@ -126,7 +126,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/amd64/include/codepatch.h b/sys/arch/amd64/include/codepatch.h
index 71fe9475710..6401dab9f2f 100644
--- a/sys/arch/amd64/include/codepatch.h
+++ b/sys/arch/amd64/include/codepatch.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: codepatch.h,v 1.16 2023/07/28 06:18:35 guenther Exp $ */
+/* $OpenBSD: codepatch.h,v 1.17 2023/07/31 01:33:57 guenther Exp $ */
/*
* Copyright (c) 2014-2015 Stefan Fritsch <sf@sfritsch.de>
*
@@ -29,7 +29,7 @@ __cptext void *codepatch_maprw(vaddr_t *nva, vaddr_t dest);
__cptext void codepatch_unmaprw(vaddr_t nva);
__cptext void codepatch_fill_nop(void *caddr, uint16_t len);
__cptext void codepatch_nop(uint16_t tag);
-__cptext void codepatch_replace(uint16_t tag, void *code, size_t len);
+__cptext void codepatch_replace(uint16_t tag, const void *code, size_t len);
__cptext void codepatch_call(uint16_t _tag, void *_func);
__cptext void codepatch_jmp(uint16_t _tag, void *_func);
void codepatch_disable(void);