Re: Help porting newlib to a new CPU architecture (sorta)

Hans-Bernhard Bröker <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
Am 06.07.2021 um 21:04 schrieb Orlando Arias:

> Right, went back and looked at the standard. There is no description of
> what the abstract machine for the execution environment should be. I
> guess my confusion came from the second paragraph in [1]. Harvard
> architectures still have the thing that you have to define whether a
> pointer refers to something in program space or data space, and standard
> C has no way of signaling this. 

You're mixing thing up there.  Standard C has a perfectly fine 
distinction between program space and data space, including pointers 
thereto.  Function pointers and data pointers _are_ distinct.

What Standard C does lack is a standardized distinction between pointers 
into ROM data and RAM data.  const-qualified pointers may seem like they 
offer that, but ultimately they don't.

> This is what I meant by the von Neumann requirement: all pointers
> dereference to the same address space. 

That's stated broadly enough to be wrong.  The C virtual machine is, in 
fact, a Harvard architecture.  It assumes that const and non-const data 
live in the same address space, but that doesn't make it von-Neumann.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.