* [PATCH] x86/boot: Use <xen/types.h>
@ 2024-09-02 11:59 Andrew Cooper
2024-09-02 12:07 ` Jan Beulich
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cooper @ 2024-09-02 11:59 UTC (permalink / raw)
To: Xen-devel
Cc: Andrew Cooper, Jan Beulich, Roger Pau Monné, Frediano Ziglio
... rather than defining them locally. This also covers NULL and *_MAX.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Frediano Ziglio <frediano.ziglio@cloud.com>
---
xen/arch/x86/boot/cmdline.c | 2 ++
xen/arch/x86/boot/defs.h | 17 -----------------
xen/arch/x86/boot/reloc.c | 2 ++
3 files changed, 4 insertions(+), 17 deletions(-)
diff --git a/xen/arch/x86/boot/cmdline.c b/xen/arch/x86/boot/cmdline.c
index b8ad7f3a144a..28a47da7ab02 100644
--- a/xen/arch/x86/boot/cmdline.c
+++ b/xen/arch/x86/boot/cmdline.c
@@ -31,6 +31,8 @@ asm (
);
#include <xen/kconfig.h>
+#include <xen/types.h>
+
#include "defs.h"
#include "video.h"
diff --git a/xen/arch/x86/boot/defs.h b/xen/arch/x86/boot/defs.h
index ee1a4da6af03..cf9a80d116f3 100644
--- a/xen/arch/x86/boot/defs.h
+++ b/xen/arch/x86/boot/defs.h
@@ -20,14 +20,10 @@
#ifndef __BOOT_DEFS_H__
#define __BOOT_DEFS_H__
-#include <xen/stdbool.h>
-
#define __maybe_unused __attribute__((__unused__))
#define __packed __attribute__((__packed__))
#define __stdcall __attribute__((__stdcall__))
-#define NULL ((void *)0)
-
#define ALIGN_UP(arg, align) \
(((arg) + (align) - 1) & ~((typeof(arg))(align) - 1))
@@ -47,17 +43,4 @@
#define tolower(c) ((c) | 0x20)
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned int u32;
-typedef unsigned long long u64;
-typedef unsigned int size_t;
-typedef u8 uint8_t;
-typedef u16 uint16_t;
-typedef u32 uint32_t;
-typedef u64 uint64_t;
-
-#define UINT16_MAX ((uint16_t)(~0U))
-#define UINT_MAX (~0U)
-
#endif /* __BOOT_DEFS_H__ */
diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c
index 589e026ff9fb..ac8b58b69581 100644
--- a/xen/arch/x86/boot/reloc.c
+++ b/xen/arch/x86/boot/reloc.c
@@ -26,6 +26,8 @@ asm (
" jmp reloc \n"
);
+#include <xen/types.h>
+
#include "defs.h"
#include <xen/kconfig.h>
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/boot: Use <xen/types.h>
2024-09-02 11:59 [PATCH] x86/boot: Use <xen/types.h> Andrew Cooper
@ 2024-09-02 12:07 ` Jan Beulich
2024-09-02 12:12 ` Andrew Cooper
0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2024-09-02 12:07 UTC (permalink / raw)
To: Andrew Cooper; +Cc: Roger Pau Monné, Frediano Ziglio, Xen-devel
On 02.09.2024 13:59, Andrew Cooper wrote:
> --- a/xen/arch/x86/boot/cmdline.c
> +++ b/xen/arch/x86/boot/cmdline.c
> @@ -31,6 +31,8 @@ asm (
> );
>
> #include <xen/kconfig.h>
> +#include <xen/types.h>
And why not include the file centrally ...
> --- a/xen/arch/x86/boot/defs.h
> +++ b/xen/arch/x86/boot/defs.h
> @@ -20,14 +20,10 @@
> #ifndef __BOOT_DEFS_H__
> #define __BOOT_DEFS_H__
>
> -#include <xen/stdbool.h>
... here? Both above and ...
> --- a/xen/arch/x86/boot/reloc.c
> +++ b/xen/arch/x86/boot/reloc.c
> @@ -26,6 +26,8 @@ asm (
> " jmp reloc \n"
> );
>
> +#include <xen/types.h>
> +
> #include "defs.h"
... here you have the inclusion ahead of that of defs.h, so there aren't
any other dependencies (unless something subtle is going on).
Jan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/boot: Use <xen/types.h>
2024-09-02 12:07 ` Jan Beulich
@ 2024-09-02 12:12 ` Andrew Cooper
2024-09-02 12:27 ` Jan Beulich
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cooper @ 2024-09-02 12:12 UTC (permalink / raw)
To: Jan Beulich; +Cc: Roger Pau Monné, Frediano Ziglio, Xen-devel
On 02/09/2024 1:07 pm, Jan Beulich wrote:
> On 02.09.2024 13:59, Andrew Cooper wrote:
>> --- a/xen/arch/x86/boot/cmdline.c
>> +++ b/xen/arch/x86/boot/cmdline.c
>> @@ -31,6 +31,8 @@ asm (
>> );
>>
>> #include <xen/kconfig.h>
>> +#include <xen/types.h>
> And why not include the file centrally ...
>
>> --- a/xen/arch/x86/boot/defs.h
>> +++ b/xen/arch/x86/boot/defs.h
>> @@ -20,14 +20,10 @@
>> #ifndef __BOOT_DEFS_H__
>> #define __BOOT_DEFS_H__
>>
>> -#include <xen/stdbool.h>
> ... here? Both above and ...
>
>> --- a/xen/arch/x86/boot/reloc.c
>> +++ b/xen/arch/x86/boot/reloc.c
>> @@ -26,6 +26,8 @@ asm (
>> " jmp reloc \n"
>> );
>>
>> +#include <xen/types.h>
>> +
>> #include "defs.h"
> ... here you have the inclusion ahead of that of defs.h, so there aren't
> any other dependencies (unless something subtle is going on).
Because I intend to delete defs.h entirely.
I've had a bit of fun unpicking __stdcall (looking to remove it
entirely, and replace with fastcall), and we need to shuffle a couple
more macros into macros.h, but all of defs.h can be replaced with
types.h, compiler.h and macros.h
The other problem right now (forcing the order of inclusion here), is
that multiboot*.h implicitly use types.h.
~Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/boot: Use <xen/types.h>
2024-09-02 12:12 ` Andrew Cooper
@ 2024-09-02 12:27 ` Jan Beulich
0 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2024-09-02 12:27 UTC (permalink / raw)
To: Andrew Cooper; +Cc: Roger Pau Monné, Frediano Ziglio, Xen-devel
On 02.09.2024 14:12, Andrew Cooper wrote:
> On 02/09/2024 1:07 pm, Jan Beulich wrote:
>> On 02.09.2024 13:59, Andrew Cooper wrote:
>>> --- a/xen/arch/x86/boot/cmdline.c
>>> +++ b/xen/arch/x86/boot/cmdline.c
>>> @@ -31,6 +31,8 @@ asm (
>>> );
>>>
>>> #include <xen/kconfig.h>
>>> +#include <xen/types.h>
>> And why not include the file centrally ...
>>
>>> --- a/xen/arch/x86/boot/defs.h
>>> +++ b/xen/arch/x86/boot/defs.h
>>> @@ -20,14 +20,10 @@
>>> #ifndef __BOOT_DEFS_H__
>>> #define __BOOT_DEFS_H__
>>>
>>> -#include <xen/stdbool.h>
>> ... here? Both above and ...
>>
>>> --- a/xen/arch/x86/boot/reloc.c
>>> +++ b/xen/arch/x86/boot/reloc.c
>>> @@ -26,6 +26,8 @@ asm (
>>> " jmp reloc \n"
>>> );
>>>
>>> +#include <xen/types.h>
>>> +
>>> #include "defs.h"
>> ... here you have the inclusion ahead of that of defs.h, so there aren't
>> any other dependencies (unless something subtle is going on).
>
> Because I intend to delete defs.h entirely.
Oh, okay.
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Jan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-09-02 12:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-02 11:59 [PATCH] x86/boot: Use <xen/types.h> Andrew Cooper
2024-09-02 12:07 ` Jan Beulich
2024-09-02 12:12 ` Andrew Cooper
2024-09-02 12:27 ` Jan Beulich
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.