* [Adeos-main] [PATCH] [arm] user space tsc emulation support for s3c24xx
@ 2007-07-20 12:57 Sebastian Smolorz
2007-07-20 13:15 ` Gilles Chanteperdrix
0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Smolorz @ 2007-07-20 12:57 UTC (permalink / raw)
To: adeos-main
[-- Attachment #1: Type: text/plain, Size: 183 bytes --]
Hi,
On s3c24xx user space tsc emulation is now supported with this patch. Note
that the patch for time.c is made against the patch I sent on Wednesday to
this list.
--
Sebastian
[-- Attachment #2: ipipe_s3c24xx_tsc_emu.patch --]
[-- Type: text/x-diff, Size: 2782 bytes --]
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index bffabf4..cae449a 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -730,8 +730,8 @@ ENTRY(__switch_to)
.align 5
.globl __ipipe_tsc_area_start
-__ipipe_tsc_area_start:
- .rep 8
+__ipipe_tsc_area_start:
+ .rep 12
.word 0
.endr
#endif /* CONFIG_IPIPE */
diff --git a/arch/arm/mach-s3c2410/time.c b/arch/arm/mach-s3c2410/time.c
index 622ed34..b1b4a86 100644
--- a/arch/arm/mach-s3c2410/time.c
+++ b/arch/arm/mach-s3c2410/time.c
@@ -73,7 +73,7 @@ EXPORT_SYMBOL(__ipipe_mach_ticks_per_jiffy);
int __ipipe_mach_timerint = IRQ_TIMER4;
EXPORT_SYMBOL(__ipipe_mach_timerint);
-static unsigned long long __ipipe_mach_tsc = 0;
+static unsigned long long *tsc;
static unsigned long timer_ackval = 1UL << (IRQ_TIMER4 - IRQ_EINT0);
static IPIPE_DEFINE_SPINLOCK(timer_lock);
@@ -82,7 +82,11 @@ EXPORT_SYMBOL(__ipipe_mach_timerstolen);
void __ipipe_mach_get_tscinfo(struct __ipipe_tscinfo *info)
{
- info->type = IPIPE_TSC_TYPE_NONE;
+ info->type = IPIPE_TSC_TYPE_DECREMENTER;
+ info->u.fr.counter = (unsigned *)0x51000038;
+ info->u.fr.mask = 0xffff;
+ info->u.fr.last_cnt = (unsigned *)(tsc + 1); /* means: +8 bytes */
+ info->u.fr.tsc = tsc;
}
#endif /* CONFIG_IPIPE */
@@ -146,7 +150,8 @@ static inline unsigned long getticksoffset_tscupdate(void)
tval = timer_freerunning_getvalue();
ticks = timer_freerunning_getticksoffset(tval);
last_free_running_tcnt = tval;
- __ipipe_mach_tsc += ticks;
+ *tsc += ticks;
+ *(unsigned *)(tsc + 1) = last_free_running_tcnt;
return ticks;
}
#endif /* CONFIG_IPIPE */
@@ -256,6 +261,9 @@ static void s3c2410_timer_setup (void)
}
#ifdef CONFIG_IPIPE
+ tsc = (unsigned long long *)__ipipe_tsc_area;
+ barrier();
+
__ipipe_mach_ticks_per_jiffy = tcnt;
#endif /* CONFIG_IPIPE */
@@ -334,7 +342,7 @@ notrace unsigned long long __ipipe_mach_get_tsc(void)
local_irq_save_hw_notrace(flags);
spin_lock(&timer_lock);
- result = __ipipe_mach_tsc + getticksoffset();
+ result = *tsc + getticksoffset();
spin_unlock(&timer_lock);
local_irq_restore_hw_notrace(flags);
return result;
diff --git a/include/asm-arm/ipipe.h b/include/asm-arm/ipipe.h
index b3d62bf..2f31f04 100644
--- a/include/asm-arm/ipipe.h
+++ b/include/asm-arm/ipipe.h
@@ -100,6 +100,9 @@ struct __ipipe_tscinfo {
struct {
unsigned *counter; /* Hw counter physical address */
unsigned mask; /* Significant bits in the hw counter. */
+ unsigned *last_cnt; /* Only for decrementing counter:
+ counter value when updating
+ tsc value. */
unsigned long long *tsc; /* 64 bits tsc value. */
} fr;
struct {
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Adeos-main] [PATCH] [arm] user space tsc emulation support for s3c24xx
2007-07-20 12:57 [Adeos-main] [PATCH] [arm] user space tsc emulation support for s3c24xx Sebastian Smolorz
@ 2007-07-20 13:15 ` Gilles Chanteperdrix
2007-07-20 14:26 ` Sebastian Smolorz
0 siblings, 1 reply; 3+ messages in thread
From: Gilles Chanteperdrix @ 2007-07-20 13:15 UTC (permalink / raw)
To: Sebastian Smolorz; +Cc: adeos-main
On 7/20/07, Sebastian Smolorz <ssm@domain.hid> wrote:
> Hi,
>
> On s3c24xx user space tsc emulation is now supported with this patch. Note
> that the patch for time.c is made against the patch I sent on Wednesday to
> this list.
Same remark for __ipipe_tscinfo as for __xn_tscinfo.
I would also vote for creating another variable initialized with tsc + 1
--
Gilles Chanteperdrix
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Adeos-main] [PATCH] [arm] user space tsc emulation support for s3c24xx
2007-07-20 13:15 ` Gilles Chanteperdrix
@ 2007-07-20 14:26 ` Sebastian Smolorz
0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Smolorz @ 2007-07-20 14:26 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: adeos-main
[-- Attachment #1: Type: text/plain, Size: 447 bytes --]
Gilles Chanteperdrix wrote:
> On 7/20/07, Sebastian Smolorz <ssm@domain.hid> wrote:
> > Hi,
> >
> > On s3c24xx user space tsc emulation is now supported with this patch.
> > Note that the patch for time.c is made against the patch I sent on
> > Wednesday to this list.
>
> Same remark for __ipipe_tscinfo as for __xn_tscinfo.
> I would also vote for creating another variable initialized with tsc + 1
Ok, reworked. See attachment.
--
Sebastian
[-- Attachment #2: ipipe_s3c24xx_tsc_emu_2.patch --]
[-- Type: text/x-diff, Size: 2817 bytes --]
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index bffabf4..cae449a 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -730,8 +730,8 @@ ENTRY(__switch_to)
.align 5
.globl __ipipe_tsc_area_start
-__ipipe_tsc_area_start:
- .rep 8
+__ipipe_tsc_area_start:
+ .rep 12
.word 0
.endr
#endif /* CONFIG_IPIPE */
diff --git a/arch/arm/mach-s3c2410/time.c b/arch/arm/mach-s3c2410/time.c
index 622ed34..9210456 100644
--- a/arch/arm/mach-s3c2410/time.c
+++ b/arch/arm/mach-s3c2410/time.c
@@ -73,7 +73,8 @@ EXPORT_SYMBOL(__ipipe_mach_ticks_per_jiffy);
int __ipipe_mach_timerint = IRQ_TIMER4;
EXPORT_SYMBOL(__ipipe_mach_timerint);
-static unsigned long long __ipipe_mach_tsc = 0;
+static unsigned long long *tsc;
+static unsigned *last_cnt;
static unsigned long timer_ackval = 1UL << (IRQ_TIMER4 - IRQ_EINT0);
static IPIPE_DEFINE_SPINLOCK(timer_lock);
@@ -82,7 +83,11 @@ EXPORT_SYMBOL(__ipipe_mach_timerstolen);
void __ipipe_mach_get_tscinfo(struct __ipipe_tscinfo *info)
{
- info->type = IPIPE_TSC_TYPE_NONE;
+ info->type = IPIPE_TSC_TYPE_DECREMENTER;
+ info->u.dec.counter = (unsigned *)0x51000038;
+ info->u.dec.mask = 0xffff;
+ info->u.dec.last_cnt = last_cnt;
+ info->u.dec.tsc = tsc;
}
#endif /* CONFIG_IPIPE */
@@ -146,7 +151,8 @@ static inline unsigned long getticksoffset_tscupdate(void)
tval = timer_freerunning_getvalue();
ticks = timer_freerunning_getticksoffset(tval);
last_free_running_tcnt = tval;
- __ipipe_mach_tsc += ticks;
+ *tsc += ticks;
+ *last_cnt = last_free_running_tcnt;
return ticks;
}
#endif /* CONFIG_IPIPE */
@@ -256,6 +262,10 @@ static void s3c2410_timer_setup (void)
}
#ifdef CONFIG_IPIPE
+ tsc = (unsigned long long *)__ipipe_tsc_area;
+ last_cnt = (unsigned *)(tsc + 1); /* means: +8 bytes */
+ barrier();
+
__ipipe_mach_ticks_per_jiffy = tcnt;
#endif /* CONFIG_IPIPE */
@@ -334,7 +344,7 @@ notrace unsigned long long __ipipe_mach_get_tsc(void)
local_irq_save_hw_notrace(flags);
spin_lock(&timer_lock);
- result = __ipipe_mach_tsc + getticksoffset();
+ result = *tsc + getticksoffset();
spin_unlock(&timer_lock);
local_irq_restore_hw_notrace(flags);
return result;
diff --git a/include/asm-arm/ipipe.h b/include/asm-arm/ipipe.h
index b3d62bf..aa864fa 100644
--- a/include/asm-arm/ipipe.h
+++ b/include/asm-arm/ipipe.h
@@ -103,6 +103,11 @@ struct __ipipe_tscinfo {
unsigned long long *tsc; /* 64 bits tsc value. */
} fr;
struct {
+ unsigned *counter; /* Hw counter physical address */
+ unsigned mask; /* Significant bits in the hw counter. */
+ unsigned *last_cnt; /* Counter value when updating
+ tsc value. */
+ unsigned long long *tsc; /* 64 bits tsc value. */
} dec;
} u;
};
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-07-20 14:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-20 12:57 [Adeos-main] [PATCH] [arm] user space tsc emulation support for s3c24xx Sebastian Smolorz
2007-07-20 13:15 ` Gilles Chanteperdrix
2007-07-20 14:26 ` Sebastian Smolorz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.