From owner-p4-projects@FreeBSD.ORG Wed Sep 2 18:55:06 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D01671065695; Wed, 2 Sep 2009 18:55:05 +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 946401065693 for ; Wed, 2 Sep 2009 18:55:05 +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 631678FC16 for ; Wed, 2 Sep 2009 18:55:05 +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 n82It5gV023612 for ; Wed, 2 Sep 2009 18:55:05 GMT (envelope-from mav@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n82It5EF023610 for perforce@freebsd.org; Wed, 2 Sep 2009 18:55:05 GMT (envelope-from mav@freebsd.org) Date: Wed, 2 Sep 2009 18:55:05 GMT Message-Id: <200909021855.n82It5EF023610@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 168084 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: Wed, 02 Sep 2009 18:55:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=168084 Change 168084 by mav@mav_mavbook on 2009/09/02 18:54:19 Revert rtc change. Lock need to be spinning as it is called in interrupt filter context. while it would be good to split locks, left it for later. Affected files ... .. //depot/projects/scottl-camlock/src/sys/amd64/amd64/machdep.c#29 edit .. //depot/projects/scottl-camlock/src/sys/i386/i386/machdep.c#27 edit .. //depot/projects/scottl-camlock/src/sys/isa/atrtc.c#4 edit .. //depot/projects/scottl-camlock/src/sys/isa/rtc.h#6 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/amd64/amd64/machdep.c#29 (text+ko) ==== @@ -1592,7 +1592,6 @@ * 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#27 (text+ko) ==== @@ -2580,7 +2580,6 @@ * initialization can use DELAY(). */ i8254_init(); - atrtc_init(); #endif /* @@ -2835,7 +2834,6 @@ * 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#4 (text+ko) ==== @@ -46,14 +46,11 @@ #include #endif -#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) +#define RTC_LOCK mtx_lock_spin(&clock_lock) +#define RTC_UNLOCK mtx_unlock_spin(&clock_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; @@ -62,12 +59,6 @@ * RTC support routines */ -void -atrtc_init(void) -{ - RTC_LOCK_INIT; -} - int rtcin(int reg) { ==== //depot/projects/scottl-camlock/src/sys/isa/rtc.h#6 (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);