diff mbox series

[2/3] mini-os: remove some not needed stuff from arch/x86/time.c

Message ID 20240722121643.18116-3-jgross@suse.com (mailing list archive)
State New
Headers show
Series Mini-OS: tidy up arch/x86/time.c | expand

Commit Message

Jürgen Groß July 22, 2024, 12:16 p.m. UTC
Remove unused or not needed stuff from arch/x86/time.c.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/time.c | 16 ----------------
 1 file changed, 16 deletions(-)

Comments

Samuel Thibault July 22, 2024, 9:45 p.m. UTC | #1
Juergen Gross, le lun. 22 juil. 2024 14:16:42 +0200, a ecrit:
> Remove unused or not needed stuff from arch/x86/time.c.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  arch/x86/time.c | 16 ----------------
>  1 file changed, 16 deletions(-)
> 
> diff --git a/arch/x86/time.c b/arch/x86/time.c
> index a473a9e1..7fd7abef 100644
> --- a/arch/x86/time.c
> +++ b/arch/x86/time.c
> @@ -48,7 +48,6 @@ struct shadow_time_info {
>      uint64_t tsc_timestamp;     /* TSC at last update of time vals.  */
>      uint64_t system_timestamp;  /* Time, in nanosecs, since boot.    */
>      uint32_t tsc_to_nsec_mul;
> -    uint32_t tsc_to_usec_mul;
>      int tsc_shift;
>      uint32_t version;
>  };
> @@ -57,19 +56,6 @@ static uint32_t shadow_ts_version;
>  
>  static struct shadow_time_info shadow;
>  
> -#ifndef rmb
> -#define rmb()  __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory")
> -#endif
> -
> -#define HANDLE_USEC_OVERFLOW(_tv)           \
> -    do {                                    \
> -        while ( (_tv)->tv_usec >= 1000000 ) \
> -        {                                   \
> -            (_tv)->tv_usec -= 1000000;      \
> -            (_tv)->tv_sec++;                \
> -        }                                   \
> -    } while ( 0 )
> -
>  static inline int time_values_up_to_date(void)
>  {
>      struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time;
> @@ -143,8 +129,6 @@ static void get_time_values_from_xen(void)
>          shadow.tsc_shift         = src->tsc_shift;
>          rmb();
>      } while ( (src->version & 1) | (shadow.version ^ src->version) );
> -
> -    shadow.tsc_to_usec_mul = shadow.tsc_to_nsec_mul / 1000;
>  }
>  
>  /*
> -- 
> 2.43.0
>
diff mbox series

Patch

diff --git a/arch/x86/time.c b/arch/x86/time.c
index a473a9e1..7fd7abef 100644
--- a/arch/x86/time.c
+++ b/arch/x86/time.c
@@ -48,7 +48,6 @@  struct shadow_time_info {
     uint64_t tsc_timestamp;     /* TSC at last update of time vals.  */
     uint64_t system_timestamp;  /* Time, in nanosecs, since boot.    */
     uint32_t tsc_to_nsec_mul;
-    uint32_t tsc_to_usec_mul;
     int tsc_shift;
     uint32_t version;
 };
@@ -57,19 +56,6 @@  static uint32_t shadow_ts_version;
 
 static struct shadow_time_info shadow;
 
-#ifndef rmb
-#define rmb()  __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory")
-#endif
-
-#define HANDLE_USEC_OVERFLOW(_tv)           \
-    do {                                    \
-        while ( (_tv)->tv_usec >= 1000000 ) \
-        {                                   \
-            (_tv)->tv_usec -= 1000000;      \
-            (_tv)->tv_sec++;                \
-        }                                   \
-    } while ( 0 )
-
 static inline int time_values_up_to_date(void)
 {
     struct vcpu_time_info *src = &HYPERVISOR_shared_info->vcpu_info[0].time;
@@ -143,8 +129,6 @@  static void get_time_values_from_xen(void)
         shadow.tsc_shift         = src->tsc_shift;
         rmb();
     } while ( (src->version & 1) | (shadow.version ^ src->version) );
-
-    shadow.tsc_to_usec_mul = shadow.tsc_to_nsec_mul / 1000;
 }
 
 /*