Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 20 Apr 2001 07:19:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 20 Apr 2001 07:19:40 -0400 Received: from [202.54.26.202] ([202.54.26.202]:10440 "EHLO hindon.hss.co.in") by vger.kernel.org with ESMTP id ; Fri, 20 Apr 2001 07:19:13 -0400 X-Lotus-FromDomain: HSS From: npunmia@hss.hns.com To: linux-kernel@vger.kernel.org Message-ID: <65256A34.003CDC69.00@sandesh.hss.hns.com> Date: Fri, 20 Apr 2001 16:48:46 +0530 Subject: RTC ! Mime-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=EfR7i37cNW39tMKovOZBU3NLTfszJjXapJ7cAbT37vEE57KoQuJUqtcj" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org --0__=EfR7i37cNW39tMKovOZBU3NLTfszJjXapJ7cAbT37vEE57KoQuJUqtcj Content-type: text/plain; charset=us-ascii Content-Disposition: inline Hi, When i compiled the following program , (taken from /usr/src/linux/Documentation/rtc.txt ) (See attached file: rtc2.c) it gave me the following error: [root@msatuts1 timer1]# gcc -s -Wall -Wstrict-prototypes rtc2.c -o rtc2 In file included from rtc2.c:17: /usr/include/linux/mc146818rtc.h:29: parse error before `rtc_lock' /usr/include/linux/mc146818rtc.h:29: warning: data definition has no type or storage class rtc2.c:25: warning: return type of `main' is not `int' [root@msatuts1 timer1]# Is this a bug?Can anyone tell me how to remove this parse error ? With Regards, --Niraj ---------------------- Forwarded by Niraj Punmia/HSS on 04/20/2001 04:31 PM --------------------------- Niraj Punmia 04/12/2001 02:50 PM To: linux-kernel@vger.kernel.org cc: Subject: RTC !! Hi , The RTC interrupt is programmable from 2 Hz to 8192 Hz, in powers of 2. So the interrupts that you could get are one of the following: 0.122ms, .244ms, .488ms, .977ms, 1.953ms, 3.906ms, 7.813ms, and so on. Is there any workaround , so that i can use RTC for meeting my requirement of an interrupt every 1.666..ms!! ( I know that i can use UTIME or #define HZ 600, but i want to know if i can use RTC for this purpose ) With Regards, --Niraj ---------------------- Forwarded by Niraj Punmia/HSS on 04/12/2001 02:33 PM --------------------------- James Stevenson on 04/09/2001 06:42:44 PM Please respond to mistral@stev.org To: Niraj Punmia/HSS@HSS cc: Subject: Re: 1.6666.... ms interrupts needed!! Hi instead of modifing the time irq freq you could try using the realt time clock (rtc) it will generate irqs with better timing and you also wont hit system performance as much by modifing the timer ever time the timer send an irq some code is run to see it schedule need to be called the more times schedule is called a second the worse the system performance is because of the task switching overhead. In local.linux-kernel-list, you wrote: > > > >Hi. > >We are simulating air interface of GPRS on LAN. A TDMA(time division multiple >access) frame duration is 40ms. Each TDMA frame consists of 24 timeslots. Each >timeslot is of 40/24 ms (i.e 1.66666.......ms) . To know what current >timeslot it is, we need a timer interrupt after every 1.6666... ms . Since we >are implementing this on LAN, minor jitters once in a while can be tolerated >(say 0.2 ms more or less once a while would be OK). > As of now, we are modifying the HZ value in param.h to 600. This gives us >a CPU tick of 1.6666.... ms. (i.e 1/600sec). I want to know if it would affect >the perfomance of the CPU. > Is there a better way to achieve the granularity of 1.666...ms . Would the >UTIME patch be a better way from performance or any other point of view than >this method? > >With Regards, >Niraj Punmia > > > >- >To unsubscribe from this list: send the line "unsubscribe linux-kernel" in >the body of a message to majordomo@vger.kernel.org >More majordomo info at http://vger.kernel.org/majordomo-info.html >Please read the FAQ at http://www.tux.org/lkml/ > -- --------------------------------------------- Check Out: http://stev.org E-Mail: mistral@stev.org 1:10pm up 13 days, 21:05, 5 users, load average: 0.45, 0.45, 0.47 --0__=EfR7i37cNW39tMKovOZBU3NLTfszJjXapJ7cAbT37vEE57KoQuJUqtcj Content-type: application/octet-stream; name="rtc2.c" Content-Disposition: attachment; filename="rtc2.c" Content-transfer-encoding: base64 DQovKg0KICoJUmVhbCBUaW1lIENsb2NrIERyaXZlciBUZXN0L0V4YW1wbGUgUHJvZ3JhbQ0KICoN CiAqCUNv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vY3RsKGZkLCBSVENfUElFX09O LCAwKTsNCglpZiAocmV0dmFsID09IC0xKSB7DQoJCXBlcnJvcigiaW9jdGwiKTsNCgkJZXhpdChl cnJubyk7DQoJfQ0KDQoJZm9yIChpPTE7IGk8MjE7IGkrKykgew0KCQkvKiBUaGlzIGJsb2NrcyAq Lw0KCQlyZXR2YWwgPSByZWFkKGZkLCAmZGF0YSwgc2l6ZW9mKHVuc2lnbmVkIGxvbmcpKTsNCgkJ aWYgKHJldHZhbCA9PSAtMSkgew0KCQkJcGVycm9yKCJyZWFkIik7DQoJCQlleGl0KGVycm5vKTsN CgkJfQ0KCQlmcHJpbnRmKHN0ZGVyciwgIiAlZCIsaSk7DQoJCWZmbHVzaChzdGRlcnIpOw0KCQlp cnFjb3VudCsrOw0KCX0NCg0KCS8qIERpc2FibGUgcGVyaW9kaWMgaW50ZXJydXB0cyAqLw0KCXJl dHZhbCA9IGlvY3RsKGZkLCBSVENfUElFX09GRiwgMCk7DQoJaWYgKHJldHZhbCA9PSAtMSkgew0K CQlwZXJyb3IoImlvY3RsIik7DQoJCWV4aXQoZXJybm8pOw0KCX0NCn0NCg0KZnByaW50ZihzdGRl cnIsICJcblxuXHRcdFx0ICoqKiBUZXN0IGNvbXBsZXRlICoqKlxuIik7DQpmcHJpbnRmKHN0ZGVy ciwgIlxuVHlwaW5nIFwiY2F0IC9wcm9jL2ludGVycnVwdHNcIiB3aWxsIHNob3cgJWQgbW9yZSBl dmVudHMgb24gSVJRIDguXG5cbiIsDQoJCQkJCQkJCSBpcnFjb3VudCk7DQoNCmNsb3NlKGZkKTsN Cg0KfSAvKiBlbmQgbWFpbiAqLw0K --0__=EfR7i37cNW39tMKovOZBU3NLTfszJjXapJ7cAbT37vEE57KoQuJUqtcj-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/