Help porting newlib to a new CPU architecture (sorta)
Tue Jul 6 20:01:06 GMT 2021
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 . 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.
More information about the Newlib