Skip to content

Commit

Permalink
alias jiffies to jiffies_64
Browse files Browse the repository at this point in the history
this is done via a linker script normally,
but since we don't have one, #define it instead
  • Loading branch information
tombl committed Jun 10, 2024
1 parent 19953ad commit a3a21c5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion arch/wasm/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ static inline cycles_t get_cycles(void)
return wasm_get_now_nsec();
}

#endif
#define jiffies (*(unsigned long *)(&jiffies_64))

#endif
2 changes: 0 additions & 2 deletions arch/wasm/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include <linux/screen_info.h>
#include <linux/start_kernel.h>

unsigned long volatile jiffies = INITIAL_JIFFIES;

unsigned long init_stack[THREAD_SIZE / sizeof(unsigned long)] = { 0 };
unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)] = { 0 };

Expand Down
4 changes: 3 additions & 1 deletion include/linux/jiffies.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ extern int register_refined_jiffies(long clock_tick_rate);
* get_jiffies_64() will do this for you as appropriate.
*/
extern u64 __cacheline_aligned_in_smp jiffies_64;
#ifndef jiffies
extern unsigned long volatile __cacheline_aligned_in_smp __jiffy_arch_data jiffies;
#endif

#if (BITS_PER_LONG < 64)
u64 get_jiffies_64(void);
Expand Down Expand Up @@ -419,7 +421,7 @@ static __always_inline unsigned long usecs_to_jiffies(const unsigned int u)
}

extern unsigned long timespec64_to_jiffies(const struct timespec64 *value);
extern void jiffies_to_timespec64(const unsigned long jiffies,
extern void jiffies_to_timespec64(const unsigned long jiffies_,
struct timespec64 *value);
extern clock_t jiffies_to_clock_t(unsigned long x);
static inline clock_t jiffies_delta_to_clock_t(long delta)
Expand Down
2 changes: 1 addition & 1 deletion include/linux/phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -1695,7 +1695,7 @@ int phy_drivers_register(struct phy_driver *new_driver, int n,
struct module *owner);
void phy_error(struct phy_device *phydev);
void phy_state_machine(struct work_struct *work);
void phy_queue_state_machine(struct phy_device *phydev, unsigned long jiffies);
void phy_queue_state_machine(struct phy_device *phydev, unsigned long jiffies_);
void phy_trigger_machine(struct phy_device *phydev);
void phy_mac_interrupt(struct phy_device *phydev);
void phy_start_machine(struct phy_device *phydev);
Expand Down
2 changes: 1 addition & 1 deletion include/linux/semaphore.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extern void down(struct semaphore *sem);
extern int __must_check down_interruptible(struct semaphore *sem);
extern int __must_check down_killable(struct semaphore *sem);
extern int __must_check down_trylock(struct semaphore *sem);
extern int __must_check down_timeout(struct semaphore *sem, long jiffies);
extern int __must_check down_timeout(struct semaphore *sem, long jiffies_);
extern void up(struct semaphore *sem);

#endif /* __LINUX_SEMAPHORE_H */
4 changes: 2 additions & 2 deletions kernel/time/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,14 +602,14 @@ timespec64_to_jiffies(const struct timespec64 *value)
EXPORT_SYMBOL(timespec64_to_jiffies);

void
jiffies_to_timespec64(const unsigned long jiffies, struct timespec64 *value)
jiffies_to_timespec64(const unsigned long jiffies_, struct timespec64 *value)
{
/*
* Convert jiffies to nanoseconds and separate with
* one divide.
*/
u32 rem;
value->tv_sec = div_u64_rem((u64)jiffies * TICK_NSEC,
value->tv_sec = div_u64_rem((u64)jiffies_ * TICK_NSEC,
NSEC_PER_SEC, &rem);
value->tv_nsec = rem;
}
Expand Down

0 comments on commit a3a21c5

Please sign in to comment.