tools/debugger: Fix PAGE_SIZE redefinition error
authorCostin Lupu <costin.lupu@cs.pub.ro>
Tue, 8 Jun 2021 12:35:25 +0000 (15:35 +0300)
committerJulien Grall <jgrall@amazon.com>
Fri, 9 Jul 2021 14:59:36 +0000 (15:59 +0100)
commit37588941a249a0b45a44a6385b187d7d10132e7d
tree56a815779b6d8d92a8838dc4e17d8eebcf9cb0bb
parentcf4aa8dfb201a7db3e9ec2d4a2ff56961c7719fb
tools/debugger: Fix PAGE_SIZE redefinition error

If PAGE_SIZE is already defined in the system (e.g. in /usr/include/limits.h
header) then gcc will trigger a redefinition error because of -Werror. This
patch replaces usage of PAGE_* macros with KDD_PAGE_* macros in order to avoid
confusion between control domain page granularity (PAGE_* definitions) and
guest domain page granularity (which is what we are dealing with here).

We chose to define the KDD_PAGE_* macros instead of using XC_PAGE_* macros
because (1) the code in kdd.c should not include any Xen headers and (2) to add
consistency for code in both kdd.c and kdd-xen.c.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Jackson <iwj@xenproject.org>
tools/debugger/kdd/kdd-xen.c
tools/debugger/kdd/kdd.c
tools/debugger/kdd/kdd.h