From owner-p4-projects@FreeBSD.ORG Sun Aug 30 07:52:32 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7EB451065670; Sun, 30 Aug 2009 07:52:32 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43469106566B for ; Sun, 30 Aug 2009 07:52:32 +0000 (UTC) (envelope-from mav@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 194488FC0C for ; Sun, 30 Aug 2009 07:52:32 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n7U7qVcT048643 for ; Sun, 30 Aug 2009 07:52:31 GMT (envelope-from mav@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n7U7qVcc048641 for perforce@freebsd.org; Sun, 30 Aug 2009 07:52:31 GMT (envelope-from mav@freebsd.org) Date: Sun, 30 Aug 2009 07:52:31 GMT Message-Id: <200908300752.n7U7qVcc048641@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mav@freebsd.org using -f From: Alexander Motin To: Perforce Change Reviews Cc: Subject: PERFORCE change 167965 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Aug 2009 07:52:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=167965 Change 167965 by mav@mav_mavbook on 2009/08/30 07:51:34 Separate rtc_lock from clock_lock and make it not spinning. Affected files ... .. //depot/projects/scottl-camlock/src/sys/amd64/amd64/machdep.c#28 edit .. //depot/projects/scottl-camlock/src/sys/i386/i386/machdep.c#26 edit .. //depot/projects/scottl-camlock/src/sys/isa/atrtc.c#3 edit .. //depot/projects/scottl-camlock/src/sys/isa/rtc.h#5 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/amd64/amd64/machdep.c#28 (text+ko) ==== @@ -1592,6 +1592,7 @@ * initialization can use DELAY(). */ i8254_init(); + atrtc_init(); /* * Initialize the console before we print anything out. ==== //depot/projects/scottl-camlock/src/sys/i386/i386/machdep.c#26 (text+ko) ==== @@ -2580,6 +2580,7 @@ * initialization can use DELAY(). */ i8254_init(); + atrtc_init(); #endif /* @@ -2834,6 +2835,7 @@ * initialization can use DELAY(). */ i8254_init(); + atrtc_init(); /* * Initialize the console before we print anything out. ==== //depot/projects/scottl-camlock/src/sys/isa/atrtc.c#3 (text+ko) ==== @@ -46,11 +46,14 @@ #include #endif -#define RTC_LOCK mtx_lock_spin(&clock_lock) -#define RTC_UNLOCK mtx_unlock_spin(&clock_lock) +#define RTC_LOCK_INIT \ + mtx_init(&rtc_lock, "rtc", NULL, MTX_NOPROFILE) +#define RTC_LOCK mtx_lock(&rtc_lock) +#define RTC_UNLOCK mtx_unlock(&rtc_lock) int atrtcclock_disable = 0; +static struct mtx rtc_lock; static int rtc_reg = -1; static u_char rtc_statusa = RTCSA_DIVIDER | RTCSA_NOPROF; static u_char rtc_statusb = RTCSB_24HR; @@ -59,6 +62,12 @@ * RTC support routines */ +void +atrtc_init(void) +{ + RTC_LOCK_INIT; +} + int rtcin(int reg) { ==== //depot/projects/scottl-camlock/src/sys/isa/rtc.h#5 (text+ko) ==== @@ -112,9 +112,9 @@ #define RTC_CENTURY 0x32 /* current century */ #ifdef _KERNEL -extern struct mtx clock_lock; extern int atrtcclock_disable; int atrtc_setup_clock(void); +void atrtc_init(void); int rtcin(int reg); void atrtc_start(void); void atrtc_rate(unsigned rate);