[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 2/9] pc-bios: s390x: Consolidate timing functions into tim
From: |
Thomas Huth |
Subject: |
Re: [PATCH v4 2/9] pc-bios: s390x: Consolidate timing functions into time.h |
Date: |
Mon, 22 Jun 2020 12:02:27 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
On 22/06/2020 09.42, Janosch Frank wrote:
> Let's consolidate timing related functions into one header.
>
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> ---
> pc-bios/s390-ccw/menu.c | 1 +
> pc-bios/s390-ccw/netmain.c | 15 +++------------
> pc-bios/s390-ccw/s390-ccw.h | 8 ++++----
> pc-bios/s390-ccw/s390-time.h | 23 +++++++++++++++++++++++
> pc-bios/s390-ccw/virtio-net.c | 1 +
> pc-bios/s390-ccw/virtio-scsi.c | 1 +
> pc-bios/s390-ccw/virtio.c | 18 +++---------------
> 7 files changed, 36 insertions(+), 31 deletions(-)
> create mode 100644 pc-bios/s390-ccw/s390-time.h
>
> diff --git a/pc-bios/s390-ccw/menu.c b/pc-bios/s390-ccw/menu.c
> index ce3815b201..de8260a5d6 100644
> --- a/pc-bios/s390-ccw/menu.c
> +++ b/pc-bios/s390-ccw/menu.c
> @@ -12,6 +12,7 @@
> #include "libc.h"
> #include "s390-ccw.h"
> #include "sclp.h"
> +#include "s390-time.h"
You could maybe drop these additional includes...
> diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
> index 21f27e7990..fae1de363f 100644
> --- a/pc-bios/s390-ccw/s390-ccw.h
> +++ b/pc-bios/s390-ccw/s390-ccw.h
> @@ -74,8 +74,6 @@ unsigned long virtio_load_direct(ulong rec_list1, ulong
> rec_list2,
> bool virtio_is_supported(SubChannelId schid);
> void virtio_blk_setup_device(SubChannelId schid);
> int virtio_read(ulong sector, void *load_addr);
> -u64 get_clock(void);
> -ulong get_second(void);
>
> /* bootmap.c */
> void zipl_load(void);
> @@ -153,11 +151,13 @@ static inline void yield(void)
>
> #define MAX_SECTOR_SIZE 4096
>
> +#include "s390-time.h"
... since you already include s390-time.h here in this central header
file...
> static inline void sleep(unsigned int seconds)
> {
> - ulong target = get_second() + seconds;
> + ulong target = get_time_seconds() + seconds;
>
> - while (get_second() < target) {
> + while (get_time_seconds() < target) {
> yield();
> }
> }
... or you could move the sleep() function into s390-time.h, too?
Anyway, both ways are fine for me, so:
Acked-by: Thomas Huth <thuth@redhat.com>
- [PATCH v4 0/9] pc-bios: s390x: Cleanup part 1, Janosch Frank, 2020/06/22
- [PATCH v4 1/9] pc-bios: s390x: cio.c cleanup and compile fix, Janosch Frank, 2020/06/22
- [PATCH v4 4/9] pc-bios: s390x: Get rid of magic offsets into the lowcore, Janosch Frank, 2020/06/22
- [PATCH v4 3/9] pc-bios: s390x: Move sleep and yield to helper.h, Janosch Frank, 2020/06/22
- [PATCH v4 2/9] pc-bios: s390x: Consolidate timing functions into time.h, Janosch Frank, 2020/06/22
- Re: [PATCH v4 2/9] pc-bios: s390x: Consolidate timing functions into time.h,
Thomas Huth <=
- [PATCH v4 7/9] pc-bios: s390x: Move panic() into header and add infinite loop, Janosch Frank, 2020/06/22
- [PATCH v4 6/9] pc-bios: s390x: Use PSW masks where possible and introduce PSW_MASK_SHORT_ADDR, Janosch Frank, 2020/06/22
- [PATCH v4 8/9] pc-bios: s390x: Use ebcdic2ascii table, Janosch Frank, 2020/06/22
- [PATCH v4 9/9] pc-bios: s390x: Make u32 ptr check explicit, Janosch Frank, 2020/06/22
- [PATCH v4 5/9] pc-bios: s390x: Rename and use PSW_MASK_ZMODE constant, Janosch Frank, 2020/06/22
- Re: [PATCH v4 0/9] pc-bios: s390x: Cleanup part 1, no-reply, 2020/06/22