From d3babf4aa80058cdc6f9cd0a2e4e8364508120dc Mon Sep 17 00:00:00 2001 From: Chas Williams Date: Sat, 24 Dec 2005 01:09:52 +0000 Subject: [PATCH] STABLE14-solaris-uniqtime32-20051223 FIXES 24445 afs really wants the 32 bit timeval/uniqtime stuff (cherry picked from commit 5a238125533fc826e3e39250fbc02e59bf352ec4) --- src/afs/afs_osi.h | 5 +++-- src/config/param.sun4x_510.h | 13 +------------ src/config/param.sun4x_57.h | 13 +------------ src/config/param.sun4x_58.h | 13 +------------ src/config/param.sun4x_59.h | 13 +------------ src/config/param.sunx86_510.h | 13 +------------ src/config/param.sunx86_57.h | 2 +- src/config/param.sunx86_58.h | 2 +- src/config/param.sunx86_59.h | 2 +- src/rx/rx_clock.h | 2 +- src/util/uuid.c | 2 +- 11 files changed, 13 insertions(+), 67 deletions(-) diff --git a/src/afs/afs_osi.h b/src/afs/afs_osi.h index af2c03d01..c8228f12f 100644 --- a/src/afs/afs_osi.h +++ b/src/afs/afs_osi.h @@ -188,12 +188,13 @@ extern struct vnodeops *afs_ops; * In 64 bit HP-UX the timeval structure has a 64 bit member. */ - -#if defined(AFS_HPUX_ENV) || (defined(AFS_SUN57_ENV) && !defined(AFS_SUN510_ENV)) || defined(AFS_LINUX_64BIT_KERNEL) || (defined(AFS_SGI61_ENV) && defined(KERNEL) && defined(_K64U64)) +#if defined(AFS_HPUX_ENV) || defined(AFS_LINUX_64BIT_KERNEL) || (defined(AFS_SGI61_ENV) && defined(KERNEL) && defined(_K64U64)) typedef struct { afs_int32 tv_sec; afs_int32 tv_usec; } osi_timeval_t; +#elif defined(AFS_SUN57_ENV) +typedef struct timeval32 osi_timeval_t; #else typedef struct timeval osi_timeval_t; #endif /* AFS_SGI61_ENV */ diff --git a/src/config/param.sun4x_510.h b/src/config/param.sun4x_510.h index f21d2fe70..8a78eeb11 100644 --- a/src/config/param.sun4x_510.h +++ b/src/config/param.sun4x_510.h @@ -81,7 +81,7 @@ #define AFS_UIOUSER UIO_USERSPACE #define AFS_CLBYTES MCLBYTES #define AFS_MINCHANGE 2 -#define osi_GetTime(x) uniqtime(x) +#define osi_GetTime(x) uniqtime32(x) /** * These defines are for the 64 bit Solaris 7 port @@ -93,17 +93,6 @@ #define AFS_64BIT_INO 1 #endif -/** - * Solaris 7 64 bit has two versions of uniqtime. Since we consistently - * use 32 bit quantities for time in afs, we now use uniqtime32 - */ -#if defined(AFS_SUN57_64BIT_ENV) -#undef osi_GetTime -#define osi_GetTime(x) uniqtime32(x) -#endif - - - #define AFS_KALLOC(n) kmem_alloc(n, KM_SLEEP) #define AFS_KALLOC_NOSLEEP(n) kmem_alloc(n, KM_NOSLEEP) #define AFS_KFREE kmem_free diff --git a/src/config/param.sun4x_57.h b/src/config/param.sun4x_57.h index ef65da55b..11c2e207d 100644 --- a/src/config/param.sun4x_57.h +++ b/src/config/param.sun4x_57.h @@ -82,7 +82,7 @@ #define AFS_UIOUSER UIO_USERSPACE #define AFS_CLBYTES MCLBYTES #define AFS_MINCHANGE 2 -#define osi_GetTime(x) uniqtime(x) +#define osi_GetTime(x) uniqtime32(x) /** * These defines are for the 64 bit Solaris 7 port @@ -94,17 +94,6 @@ #define AFS_64BIT_INO 1 #endif -/** - * Solaris 7 64 bit has two versions of uniqtime. Since we consistently - * use 32 bit quantities for time in afs, we now use uniqtime32 - */ -#if defined(AFS_SUN57_64BIT_ENV) -#undef osi_GetTime -#define osi_GetTime(x) uniqtime32(x) -#endif - - - #define AFS_KALLOC(n) kmem_alloc(n, KM_SLEEP) #define AFS_KALLOC_NOSLEEP(n) kmem_alloc(n, KM_NOSLEEP) #define AFS_KFREE kmem_free diff --git a/src/config/param.sun4x_58.h b/src/config/param.sun4x_58.h index 03a002412..f205a5286 100644 --- a/src/config/param.sun4x_58.h +++ b/src/config/param.sun4x_58.h @@ -79,7 +79,7 @@ #define AFS_UIOUSER UIO_USERSPACE #define AFS_CLBYTES MCLBYTES #define AFS_MINCHANGE 2 -#define osi_GetTime(x) uniqtime(x) +#define osi_GetTime(x) uniqtime32(x) /** * These defines are for the 64 bit Solaris 7 port @@ -91,17 +91,6 @@ #define AFS_64BIT_INO 1 #endif -/** - * Solaris 7 64 bit has two versions of uniqtime. Since we consistently - * use 32 bit quantities for time in afs, we now use uniqtime32 - */ -#if defined(AFS_SUN57_64BIT_ENV) -#undef osi_GetTime -#define osi_GetTime(x) uniqtime32(x) -#endif - - - #define AFS_KALLOC(n) kmem_alloc(n, KM_SLEEP) #define AFS_KALLOC_NOSLEEP(n) kmem_alloc(n, KM_NOSLEEP) #define AFS_KFREE kmem_free diff --git a/src/config/param.sun4x_59.h b/src/config/param.sun4x_59.h index ba57e2a61..fed11bc92 100644 --- a/src/config/param.sun4x_59.h +++ b/src/config/param.sun4x_59.h @@ -80,7 +80,7 @@ #define AFS_UIOUSER UIO_USERSPACE #define AFS_CLBYTES MCLBYTES #define AFS_MINCHANGE 2 -#define osi_GetTime(x) uniqtime(x) +#define osi_GetTime(x) uniqtime32(x) /** * These defines are for the 64 bit Solaris 7 port @@ -92,17 +92,6 @@ #define AFS_64BIT_INO 1 #endif -/** - * Solaris 7 64 bit has two versions of uniqtime. Since we consistently - * use 32 bit quantities for time in afs, we now use uniqtime32 - */ -#if defined(AFS_SUN57_64BIT_ENV) -#undef osi_GetTime -#define osi_GetTime(x) uniqtime32(x) -#endif - - - #define AFS_KALLOC(n) kmem_alloc(n, KM_SLEEP) #define AFS_KALLOC_NOSLEEP(n) kmem_alloc(n, KM_NOSLEEP) #define AFS_KFREE kmem_free diff --git a/src/config/param.sunx86_510.h b/src/config/param.sunx86_510.h index e028f055f..a2ddf196c 100644 --- a/src/config/param.sunx86_510.h +++ b/src/config/param.sunx86_510.h @@ -91,7 +91,7 @@ #define AFS_UIOUSER UIO_USERSPACE #define AFS_CLBYTES MCLBYTES #define AFS_MINCHANGE 2 -#define osi_GetTime(x) uniqtime(x) +#define osi_GetTime(x) uniqtime32(x) /** * These defines are for the 64 bit Solaris 7 port @@ -103,17 +103,6 @@ #define AFS_64BIT_INO 1 #endif -/** - * Solaris 7 64 bit has two versions of uniqtime. Since we consistently - * use 32 bit quantities for time in afs, we now use uniqtime32 - */ -#if defined(AFS_SUN57_64BIT_ENV) -#undef osi_GetTime -#define osi_GetTime(x) uniqtime32(x) -#endif - - - #define AFS_KALLOC(n) kmem_alloc(n, KM_SLEEP) #define AFS_KALLOC_NOSLEEP(n) kmem_alloc(n, KM_NOSLEEP) #define AFS_KFREE kmem_free diff --git a/src/config/param.sunx86_57.h b/src/config/param.sunx86_57.h index 7597cfe36..809613ef0 100644 --- a/src/config/param.sunx86_57.h +++ b/src/config/param.sunx86_57.h @@ -85,7 +85,7 @@ #define AFS_UIOUSER UIO_USERSPACE #define AFS_CLBYTES MCLBYTES #define AFS_MINCHANGE 2 -#define osi_GetTime(x) uniqtime(x) +#define osi_GetTime(x) uniqtime32(x) #define AFS_KALLOC(n) kmem_alloc(n, KM_SLEEP) #define AFS_KALLOC_NOSLEEP(n) kmem_alloc(n, KM_NOSLEEP) diff --git a/src/config/param.sunx86_58.h b/src/config/param.sunx86_58.h index 8850aef33..dd59bf325 100644 --- a/src/config/param.sunx86_58.h +++ b/src/config/param.sunx86_58.h @@ -90,7 +90,7 @@ #define AFS_UIOUSER UIO_USERSPACE #define AFS_CLBYTES MCLBYTES #define AFS_MINCHANGE 2 -#define osi_GetTime(x) uniqtime(x) +#define osi_GetTime(x) uniqtime32(x) #define AFS_KALLOC(n) kmem_alloc(n, KM_SLEEP) #define AFS_KALLOC_NOSLEEP(n) kmem_alloc(n, KM_NOSLEEP) diff --git a/src/config/param.sunx86_59.h b/src/config/param.sunx86_59.h index d3d37dea1..a21ae17c7 100644 --- a/src/config/param.sunx86_59.h +++ b/src/config/param.sunx86_59.h @@ -91,7 +91,7 @@ #define AFS_UIOUSER UIO_USERSPACE #define AFS_CLBYTES MCLBYTES #define AFS_MINCHANGE 2 -#define osi_GetTime(x) uniqtime(x) +#define osi_GetTime(x) uniqtime32(x) #define AFS_KALLOC(n) kmem_alloc(n, KM_SLEEP) #define AFS_KALLOC_NOSLEEP(n) kmem_alloc(n, KM_NOSLEEP) diff --git a/src/rx/rx_clock.h b/src/rx/rx_clock.h index 01d1c54ed..9600e71bb 100644 --- a/src/rx/rx_clock.h +++ b/src/rx/rx_clock.h @@ -99,7 +99,7 @@ extern int clock_nUpdates; (cv)->usec = (afs_int32)tv.tv_usec; \ END #else /* defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL) */ -#define clock_GetTime(cv) osi_GetTime((struct timeval *)cv) +#define clock_GetTime(cv) osi_GetTime((osi_timeval_t *)(cv)) #endif /* defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL) */ #endif #define clock_Sec() osi_Time() diff --git a/src/util/uuid.c b/src/util/uuid.c index afc8b7a46..593a79a37 100644 --- a/src/util/uuid.c +++ b/src/util/uuid.c @@ -418,7 +418,7 @@ uuid_get_address(uuid_address_p_t addr) void uuid__get_os_time(uuid_time_t * os_time) { - struct timeval tp; + osi_timeval_t tp; osi_GetTime(&tp); os_time->hi = tp.tv_sec; -- 2.39.5