Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Aug 2019 14:29:17 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Ed Maste <emaste@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r351319 - in head/usr.sbin/makefs: ffs msdos
Message-ID:  <20190830140337.D1405@besplex.bde.org>
In-Reply-To: <201908210145.x7L1jU3x072180@repo.freebsd.org>
References:  <201908210145.x7L1jU3x072180@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 21 Aug 2019, Ed Maste wrote:

> Author: emaste
> Date: Wed Aug 21 01:45:29 2019
> New Revision: 351319
> URL: https://svnweb.freebsd.org/changeset/base/351319
>
> Log:
>  makefs: use `char *` not `void *` for buf b_data, drop casts in msdos
>
>  (The kernel uses caddr_t.)

This is much better than churning the copy of the working code.

However, the kernel type is still bogus.  caddr_t should not exist, and
should have been more like vm_offset_t to begin with.  void * is no good
as an opaque type for it, since void * is only good for C addresses within
a single address space, but caddr_t is supposed to be able to represent
anything in a (possibly multiple) "core" address space.  [u]intptr_t has
the same problem.  Bus space addresses are also withing a single address
space and in general need a tag for uniqueness.

caddr_t has been char * for too long, so too much code including buf b_data
depends on it being precisely char * or u_char * to work.  char * is an
honestly broken variant of void *.  It is similarly limited to a single
address space.  This is hard to fix.  It works for [Free]BSD since no arches
with more than a single address space are supported (i386 with PAE or
pae_mode=1 or pae_mode has a larger physical address space where addresses
aren't unique, but only the kernel can see this).

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190830140337.D1405>