From owner-svn-src-head@freebsd.org Thu Aug 10 13:05:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21498DD20D8; Thu, 10 Aug 2017 13:05:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F18A083882; Thu, 10 Aug 2017 13:05:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7AD5fT6096021; Thu, 10 Aug 2017 13:05:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7AD5eK3096017; Thu, 10 Aug 2017 13:05:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708101305.v7AD5eK3096017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 10 Aug 2017 13:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322357 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 322357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Aug 2017 13:05:42 -0000 Author: hselasky Date: Thu Aug 10 13:05:40 2017 New Revision: 322357 URL: https://svnweb.freebsd.org/changeset/base/322357 Log: Use integer type to pass around jiffies and/or ticks values in the LinuxKPI because in FreeBSD ticks are 32-bit. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/completion.h head/sys/compat/linuxkpi/common/include/linux/jiffies.h head/sys/compat/linuxkpi/common/include/linux/timer.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/completion.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/completion.h Thu Aug 10 13:01:19 2017 (r322356) +++ head/sys/compat/linuxkpi/common/include/linux/completion.h Thu Aug 10 13:05:40 2017 (r322357) @@ -61,8 +61,8 @@ struct completion { linux_completion_done(c) extern void linux_complete_common(struct completion *, int); -extern long linux_wait_for_common(struct completion *, int); -extern long linux_wait_for_timeout_common(struct completion *, long, int); +extern int linux_wait_for_common(struct completion *, int); +extern int linux_wait_for_timeout_common(struct completion *, int, int); extern int linux_try_wait_for_completion(struct completion *); extern int linux_completion_done(struct completion *); Modified: head/sys/compat/linuxkpi/common/include/linux/jiffies.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/jiffies.h Thu Aug 10 13:01:19 2017 (r322356) +++ head/sys/compat/linuxkpi/common/include/linux/jiffies.h Thu Aug 10 13:05:40 2017 (r322357) @@ -141,7 +141,7 @@ get_jiffies_64(void) } static inline int -linux_timer_jiffies_until(unsigned long expires) +linux_timer_jiffies_until(int expires) { int delta = expires - jiffies; /* guard against already expired values */ Modified: head/sys/compat/linuxkpi/common/include/linux/timer.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/timer.h Thu Aug 10 13:01:19 2017 (r322356) +++ head/sys/compat/linuxkpi/common/include/linux/timer.h Thu Aug 10 13:05:40 2017 (r322357) @@ -41,7 +41,7 @@ struct timer_list { struct callout timer_callout; void (*function) (unsigned long); unsigned long data; - unsigned long expires; + int expires; }; extern unsigned long linux_timer_hz_mask; @@ -65,7 +65,7 @@ extern unsigned long linux_timer_hz_mask; callout_init(&(timer)->timer_callout, 1); \ } while (0) -extern void mod_timer(struct timer_list *, unsigned long); +extern void mod_timer(struct timer_list *, int); extern void add_timer(struct timer_list *); extern void add_timer_on(struct timer_list *, int cpu); @@ -73,7 +73,7 @@ extern void add_timer_on(struct timer_list *, int cpu) #define del_timer_sync(timer) callout_drain(&(timer)->timer_callout) #define timer_pending(timer) callout_pending(&(timer)->timer_callout) #define round_jiffies(j) \ - ((unsigned long)(((j) + linux_timer_hz_mask) & ~linux_timer_hz_mask)) + ((int)(((j) + linux_timer_hz_mask) & ~linux_timer_hz_mask)) #define round_jiffies_relative(j) round_jiffies(j) #define round_jiffies_up(j) round_jiffies(j) #define round_jiffies_up_relative(j) round_jiffies_up(j) Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Thu Aug 10 13:01:19 2017 (r322356) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Thu Aug 10 13:05:40 2017 (r322357) @@ -1598,7 +1598,7 @@ linux_timer_callback_wrapper(void *context) } void -mod_timer(struct timer_list *timer, unsigned long expires) +mod_timer(struct timer_list *timer, int expires) { timer->expires = expires; @@ -1660,10 +1660,10 @@ linux_complete_common(struct completion *c, int all) /* * Indefinite wait for done != 0 with or without signals. */ -long +int linux_wait_for_common(struct completion *c, int flags) { - long error; + int error; if (SCHEDULER_STOPPED()) return (0); @@ -1700,10 +1700,11 @@ intr: /* * Time limited wait for done != 0 with or without signals. */ -long -linux_wait_for_timeout_common(struct completion *c, long timeout, int flags) +int +linux_wait_for_timeout_common(struct completion *c, int timeout, int flags) { - long end = jiffies + timeout, error; + int end = jiffies + timeout; + int error; int ret; if (SCHEDULER_STOPPED())