On 12/12/23 11:15, Philippe Mathieu-Daudé wrote:
On 12/12/23 00:29, Richard Henderson wrote:
On 12/11/23 13:19, Philippe Mathieu-Daudé wrote:
First, "exec/user/abitypes.h" is missing the following
includes (they are included by "cpu.h"):
- "exec/target_long.h"
- "exec/cpu-all.h"
- "exec/tswap.h"
Second, it only requires the definitions from "cpu-param.h",
not the huge "cpu.h".
In order to avoid "cpu.h", pick the minimum required headers.
Assert this user-specific header is only included from user
emulation.
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
Why is cpu-all.h required?
include/exec/user/abitypes.h:85:12: error: implicit declaration of
function ‘tswapl’; did you mean ‘tswapal’?
[-Werror=implicit-function-declaration]
85 | return tswapl(v);
| ^~~~~~
| tswapal
$ git grep -w tswapl include
include/exec/cpu-all.h:40:#define tswapl(s) tswap32(s)
include/exec/cpu-all.h:44:#define tswapl(s) tswap64(s)
include/exec/user/abitypes.h:85: return tswapl(v);
OK, I'll move tswapl() declarations to exec/user/abitypes.h.
Better, to a new header.