CVS commit: src/sys/arch/usermode/usermode

2023-04-03 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Mon Apr  3 17:58:41 UTC 2023

Modified Files:
src/sys/arch/usermode/usermode: syscall.c

Log Message:
usermode/syscall.c: s/fall trough/FALLTHROUGH/ (KNF)


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/usermode/usermode/syscall.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/usermode/usermode/syscall.c
diff -u src/sys/arch/usermode/usermode/syscall.c:1.25 src/sys/arch/usermode/usermode/syscall.c:1.26
--- src/sys/arch/usermode/usermode/syscall.c:1.25	Sat Apr  6 11:54:21 2019
+++ src/sys/arch/usermode/usermode/syscall.c	Mon Apr  3 17:58:41 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: syscall.c,v 1.25 2019/04/06 11:54:21 kamil Exp $ */
+/* $NetBSD: syscall.c,v 1.26 2023/04/03 17:58:41 gutteridge Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.25 2019/04/06 11:54:21 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.26 2023/04/03 17:58:41 gutteridge Exp $");
 
 #include 
 #include 
@@ -137,10 +137,10 @@ syscall(void)
 //out:
 	switch (error) {
 	default:
-		/* fall trough */
+		/* FALLTHROUGH */
 	case 0:
 		md_syscall_set_returnargs(l, ucp, error, rval);
-		/* fall trough */
+		/* FALLTHROUGH */
 	case EJUSTRETURN:
 		break;
 	case ERESTART:



CVS commit: src/sys/arch/usermode/usermode

2023-04-03 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Mon Apr  3 17:58:41 UTC 2023

Modified Files:
src/sys/arch/usermode/usermode: syscall.c

Log Message:
usermode/syscall.c: s/fall trough/FALLTHROUGH/ (KNF)


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/usermode/usermode/syscall.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/usermode/usermode

2022-03-20 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Mar 20 18:56:29 UTC 2022

Modified Files:
src/sys/arch/usermode/usermode: pmap.c

Log Message:
fix typos in debug/panic messages: isued->issued, initialiased->initialised.


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/arch/usermode/usermode/pmap.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/usermode/usermode/pmap.c
diff -u src/sys/arch/usermode/usermode/pmap.c:1.116 src/sys/arch/usermode/usermode/pmap.c:1.117
--- src/sys/arch/usermode/usermode/pmap.c:1.116	Sat Jul 24 21:31:36 2021
+++ src/sys/arch/usermode/usermode/pmap.c	Sun Mar 20 18:56:29 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.116 2021/07/24 21:31:36 andvar Exp $ */
+/* $NetBSD: pmap.c,v 1.117 2022/03/20 18:56:29 andvar Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.116 2021/07/24 21:31:36 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.117 2022/03/20 18:56:29 andvar Exp $");
 
 #include "opt_memsize.h"
 #include "opt_kmempages.h"
@@ -328,7 +328,7 @@ pmap_bootstrap(void)
 
 	memset(pv_table, 0, pv_table_size);	/* test and clear */
 
-	thunk_printf_debug("pv_table initialiased correctly, mmap works\n");
+	thunk_printf_debug("pv_table initialised correctly, mmap works\n");
 
 	/* advance */
 	kmem_kvm_cur_start += pv_table_size;
@@ -369,7 +369,7 @@ pmap_bootstrap(void)
 
 	memset(pmap->pm_l1, 0, pm_l1_size);	/* test and clear */
 
-	thunk_printf_debug("kernel pmap l1 table initialiased correctly\n");
+	thunk_printf_debug("kernel pmap l1 table initialised correctly\n");
 
 	/* advance for l1 tables */
 	kmem_kvm_cur_start += round_page(pm_l1_size);
@@ -895,7 +895,7 @@ pmap_do_enter(pmap_t pmap, vaddr_t va, p
 	lpn = atop(va - VM_MIN_ADDRESS);	/* V->L */
 #ifdef DIAGNOSTIC
 	if ((va < VM_MIN_ADDRESS) || (va > VM_MAX_KERNEL_ADDRESS))
-		panic("pmap_do_enter: invalid va isued\n");
+		panic("pmap_do_enter: invalid va issued\n");
 #endif
 
 	/* raise interrupt level */
@@ -1121,7 +1121,7 @@ pmap_extract(pmap_t pmap, vaddr_t va, pa
 	thunk_printf_debug("pmap_extract: extracting va %p\n", (void *) va);
 #ifdef DIAGNOSTIC
 	if ((va < VM_MIN_ADDRESS) || (va > VM_MAX_KERNEL_ADDRESS)) {
-		thunk_printf_debug("pmap_extract: invalid va isued\n");
+		thunk_printf_debug("pmap_extract: invalid va issued\n");
 		thunk_printf("%p not in [%p, %p]\n", (void *) va,
 		(void *) VM_MIN_ADDRESS, (void *) VM_MAX_KERNEL_ADDRESS);
 		return false;



CVS commit: src/sys/arch/usermode/usermode

2022-03-20 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Mar 20 18:56:29 UTC 2022

Modified Files:
src/sys/arch/usermode/usermode: pmap.c

Log Message:
fix typos in debug/panic messages: isued->issued, initialiased->initialised.


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/arch/usermode/usermode/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/usermode/usermode

2019-11-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Nov 13 09:47:37 UTC 2019

Modified Files:
src/sys/arch/usermode/usermode: db_memrw.c

Log Message:
Switch to the new PTE naming.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/usermode/usermode/db_memrw.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/usermode/usermode/db_memrw.c
diff -u src/sys/arch/usermode/usermode/db_memrw.c:1.5 src/sys/arch/usermode/usermode/db_memrw.c:1.6
--- src/sys/arch/usermode/usermode/db_memrw.c:1.5	Sat Mar  9 08:42:26 2019
+++ src/sys/arch/usermode/usermode/db_memrw.c	Wed Nov 13 09:47:37 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_memrw.c,v 1.5 2019/03/09 08:42:26 maxv Exp $	*/
+/*	$NetBSD: db_memrw.c,v 1.6 2019/11/13 09:47:37 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 2000 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.5 2019/03/09 08:42:26 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.6 2019/11/13 09:47:37 maxv Exp $");
 
 #include 
 #include 
@@ -162,7 +162,7 @@ db_write_text(vaddr_t addr, size_t size,
 		 * with this mapping and subtract it from the
 		 * total size.
 		 */
-		if (pte & PG_PS)
+		if (pte & PTE_PS)
 			limit = NBPD_L2 - (addr & (NBPD_L2 - 1));
 		else
 			limit = PAGE_SIZE - (addr & PGOFSET);



CVS commit: src/sys/arch/usermode/usermode

2019-11-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Nov 13 09:47:37 UTC 2019

Modified Files:
src/sys/arch/usermode/usermode: db_memrw.c

Log Message:
Switch to the new PTE naming.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/usermode/usermode/db_memrw.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/sys/arch/usermode/usermode

2011-12-30 Thread Christos Zoulas
In article 20111230110002.c960817...@cvs.netbsd.org,
Reinoud Zandijk source-changes-d@NetBSD.org wrote:
-=-=-=-=-=-

Module Name:   src
Committed By:  reinoud
Date:  Fri Dec 30 11:00:02 UTC 2011

Modified Files:
   src/sys/arch/usermode/usermode: thunk.c

Log Message:
Use a wrapper around the send() to make sure it will transmit EVERYTHING and
not just a part of the data


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/usermode/usermode/thunk.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/usermode/usermode/thunk.c
diff -u src/sys/arch/usermode/usermode/thunk.c:1.57
src/sys/arch/usermode/usermode/thunk.c:1.58
--- src/sys/arch/usermode/usermode/thunk.c:1.57Fri Dec 30 09:36:02 2011
+++ src/sys/arch/usermode/usermode/thunk.c Fri Dec 30 11:00:01 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: thunk.c,v 1.57 2011/12/30 09:36:02 jmcneill Exp $ */
+/* $NetBSD: thunk.c,v 1.58 2011/12/30 11:00:01 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill
jmcne...@invisible.ca
@@ -28,7 +28,7 @@
 
 #include sys/cdefs.h
 #ifdef __NetBSD__
-__RCSID($NetBSD: thunk.c,v 1.57 2011/12/30 09:36:02 jmcneill Exp $);
+__RCSID($NetBSD: thunk.c,v 1.58 2011/12/30 11:00:01 reinoud Exp $);
 #endif
 
 #include sys/types.h
@@ -896,6 +896,25 @@ thunk_rfb_open(thunk_rfb_t *rfb, uint16_
 }
 
 static int
+safe_send(int s, const void *msg, size_t len)
+{
+  const uint8_t *p;
+  int sent_len;
+
+  p = msg;
+  while (len) {
+  assert(len = 0);
+  sent_len = send(s, p, len, MSG_NOSIGNAL);
+  if (sent_len  0) 
+  return -1;
+  
+  p   += sent_len;
+  len -= sent_len;
+  }
+  return 0;
+}

- Send returns ssize_t not int
- you should handle EAGAIN/EINTR.

christos



Re: CVS commit: src/sys/arch/usermode/usermode

2011-08-27 Thread Jean-Yves Migeon
On 27.08.2011 19:57, Reinoud Zandijk wrote:
 Fix copystring routines to NOT just copy all since not all space might be
 writable. This can be fixed by implementing/importing strnlen(3) in the kernel

Any reason no to? If there's none, I can do it.

At first sight it's straightforward to add to common/, and I am more at
peace knowing that we have a valid strnlen() in kernel rather than a
bogus macro that may spread elsewhere...

-- 
Jean-Yves Migeon
jeanyves.mig...@free.fr


Re: CVS commit: src/sys/arch/usermode/usermode

2011-08-27 Thread Joerg Sonnenberger
On Sat, Aug 27, 2011 at 08:13:28PM +0200, Jean-Yves Migeon wrote:
 On 27.08.2011 19:57, Reinoud Zandijk wrote:
  Fix copystring routines to NOT just copy all since not all space might be
  writable. This can be fixed by implementing/importing strnlen(3) in the 
  kernel
 
 Any reason no to? If there's none, I can do it.
 
 At first sight it's straightforward to add to common/, and I am more at
 peace knowing that we have a valid strnlen() in kernel rather than a
 bogus macro that may spread elsewhere...

Or it could use memchr for that same purpose.

Joerg


Re: CVS commit: src/sys/arch/usermode/usermode

2011-08-27 Thread Jean-Yves Migeon
On 27.08.2011 20:28, Joerg Sonnenberger wrote:
 On Sat, Aug 27, 2011 at 08:13:28PM +0200, Jean-Yves Migeon wrote:
 On 27.08.2011 19:57, Reinoud Zandijk wrote:
 Fix copystring routines to NOT just copy all since not all space might be
 writable. This can be fixed by implementing/importing strnlen(3) in the 
 kernel

 Any reason no to? If there's none, I can do it.

 At first sight it's straightforward to add to common/, and I am more at
 peace knowing that we have a valid strnlen() in kernel rather than a
 bogus macro that may spread elsewhere...
 
 Or it could use memchr for that same purpose.

Right; note that the question about strnlen(3) remains valid though:
strlen/strnlen appear in the same man page. So one's could expect to
have both accessible, even in kernel.

-- 
Jean-Yves Migeon
jeanyves.mig...@free.fr