* [PATCH 3/4] cobalt/kernel: fix compile error for incompatible pointer type
@ 2020-09-18 6:32 Fino Meng
2020-09-18 13:05 ` Jan Kiszka
0 siblings, 1 reply; 5+ messages in thread
From: Fino Meng @ 2020-09-18 6:32 UTC (permalink / raw)
To: xenomai, jan.kiszka, fino.meng
Signed-off-by: Fino Meng <fino.meng@linux.intel.com>
Signed-off-by: Mingliang Hu <mingliang.hu@intel.com>
---
include/cobalt/kernel/stat.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/cobalt/kernel/stat.h b/include/cobalt/kernel/stat.h
index b857cd19f..be529ad72 100644
--- a/include/cobalt/kernel/stat.h
+++ b/include/cobalt/kernel/stat.h
@@ -58,7 +58,7 @@ do { \
#define xnstat_exectime_set_current(sched, new_account) \
({ \
xnstat_exectime_t *__prev; \
- __prev = (xnstat_exectime_t *)atomic_long_xchg(&(sched)->current_account, (long)(new_account)); \
+ __prev = (xnstat_exectime_t *)atomic_long_xchg((atomic_long_t *)&(sched)->current_account, (long)(new_account)); \
__prev; \
})
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 3/4] cobalt/kernel: fix compile error for incompatible pointer type
2020-09-18 6:32 [PATCH 3/4] cobalt/kernel: fix compile error for incompatible pointer type Fino Meng
@ 2020-09-18 13:05 ` Jan Kiszka
2020-09-21 11:32 ` Meng, Fino
0 siblings, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2020-09-18 13:05 UTC (permalink / raw)
To: Fino Meng, xenomai, fino.meng
<no commit message>
On 18.09.20 08:32, Fino Meng wrote:
> Signed-off-by: Fino Meng <fino.meng@linux.intel.com>
> Signed-off-by: Mingliang Hu <mingliang.hu@intel.com>
> ---
> include/cobalt/kernel/stat.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/cobalt/kernel/stat.h b/include/cobalt/kernel/stat.h
> index b857cd19f..be529ad72 100644
> --- a/include/cobalt/kernel/stat.h
> +++ b/include/cobalt/kernel/stat.h
> @@ -58,7 +58,7 @@ do { \
> #define xnstat_exectime_set_current(sched, new_account) \
> ({ \
> xnstat_exectime_t *__prev; \
> - __prev = (xnstat_exectime_t *)atomic_long_xchg(&(sched)->current_account, (long)(new_account)); \
> + __prev = (xnstat_exectime_t *)atomic_long_xchg((atomic_long_t *)&(sched)->current_account, (long)(new_account)); \
Which upstream change made this necessary? Was the issue hidden behind
too relaxed compiler warnings, or was there a real type change? If the
latter, why is that cast OK?
Jan
> __prev; \
> })
>
>
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 3/4] cobalt/kernel: fix compile error for incompatible pointer type
2020-09-18 13:05 ` Jan Kiszka
@ 2020-09-21 11:32 ` Meng, Fino
0 siblings, 0 replies; 5+ messages in thread
From: Meng, Fino @ 2020-09-21 11:32 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai
On Fri, Sep 18, 2020 at 03:05:28PM +0200, Jan Kiszka wrote:
> <no commit message>
>
> On 18.09.20 08:32, Fino Meng wrote:
> > Signed-off-by: Fino Meng <fino.meng@linux.intel.com>
> > Signed-off-by: Mingliang Hu <mingliang.hu@intel.com>
> > ---
> > include/cobalt/kernel/stat.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/cobalt/kernel/stat.h b/include/cobalt/kernel/stat.h
> > index b857cd19f..be529ad72 100644
> > --- a/include/cobalt/kernel/stat.h
> > +++ b/include/cobalt/kernel/stat.h
> > @@ -58,7 +58,7 @@ do { \
> > #define xnstat_exectime_set_current(sched, new_account) \
> > ({ \
> > xnstat_exectime_t *__prev; \
> > - __prev = (xnstat_exectime_t *)atomic_long_xchg(&(sched)->current_account, (long)(new_account)); \
> > + __prev = (xnstat_exectime_t *)atomic_long_xchg((atomic_long_t *)&(sched)->current_account, (long)(new_account)); \
>
> Which upstream change made this necessary? Was the issue hidden behind too
> relaxed compiler warnings, or was there a real type change? If the latter,
> why is that cast OK?
>
> Jan
due to this commit, atomic_long_xchg lost the force type conversion in
macro:
commit b5d47ef9ea5c5fe31d7eabeb79f697629bd9e2cb
Refs: v4.19-rc6-94-gb5d47ef9ea5c
Author: Mark Rutland <mark.rutland@arm.com>
AuthorDate: Tue Sep 4 11:48:27 2018 +0100
Commit: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu Nov 1 11:00:55 2018 +0100
locking/atomics: Switch to generated atomic-long
As a step towards ensuring the atomic* APIs are consistent, let's switch
to wrappers generated by gen-atomic-long.h, using the same table that
gen-atomic-fallbacks.h uses to fill in gaps in the atomic_* and
atomic64_* APIs.
...
include/asm-generic/atomic-long.h
in 4.19 kernel:
#define atomic_long_xchg(v, new) \
(ATOMIC_LONG_PFX(_xchg)((ATOMIC_LONG_PFX(_t) *)(v), (new)))
#define ATOMIC_LONG_PFX(x) atomic ## x
in 5.4 kernel:
static inline long
atomic_long_xchg(atomic_long_t *v, long i)
{
return atomic_xchg(v, i);
}
BR fino
>
> > __prev; \
> > })
> >
>
> --
> Siemens AG, Corporate Technology, CT RDA IOT SES-DE
> Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/4] cobalt/x86: adapt fpu code with Linux kernel upstream
@ 2020-09-18 5:56 Fino Meng
2020-09-18 5:56 ` [PATCH 3/4] cobalt/kernel: fix compile error for incompatible pointer type Fino Meng
0 siblings, 1 reply; 5+ messages in thread
From: Fino Meng @ 2020-09-18 5:56 UTC (permalink / raw)
To: xenomai
Signed-off-by: Fino Meng <fino.meng@linux.intel.com>
Signed-off-by: Mingliang Hu <mingliang.hu@intel.com>
---
kernel/cobalt/arch/x86/thread.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/kernel/cobalt/arch/x86/thread.c b/kernel/cobalt/arch/x86/thread.c
index ba807ac1e..c33ad832f 100644
--- a/kernel/cobalt/arch/x86/thread.c
+++ b/kernel/cobalt/arch/x86/thread.c
@@ -26,6 +26,10 @@
#include <asm/mmu_context.h>
#include <asm/processor.h>
+#ifdef IPIPE_X86_FPU_EAGER
+extern void fpu__initialize(struct fpu *fpu);
+#endif
+
static struct kmem_cache *xstate_cache;
#ifdef IPIPE_X86_FPU_EAGER
@@ -472,7 +476,7 @@ void xnarch_leave_root(struct xnthread *root)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)
/* restore current's fpregs */
__cpu_invalidate_fpregs_state();
- switch_fpu_finish(¤t->thread.fpu, smp_processor_id());
+ switch_fpu_finish(¤t->thread.fpu);
#else
/* mark current thread as not owning the FPU anymore */
if (fpregs_active())
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/4] cobalt/kernel: fix compile error for incompatible pointer type
2020-09-18 5:56 [PATCH 1/4] cobalt/x86: adapt fpu code with Linux kernel upstream Fino Meng
@ 2020-09-18 5:56 ` Fino Meng
0 siblings, 0 replies; 5+ messages in thread
From: Fino Meng @ 2020-09-18 5:56 UTC (permalink / raw)
To: xenomai
Signed-off-by: Fino Meng <fino.meng@linux.intel.com>
Signed-off-by: Mingliang Hu <mingliang.hu@intel.com>
---
include/cobalt/kernel/stat.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/cobalt/kernel/stat.h b/include/cobalt/kernel/stat.h
index b857cd19f..be529ad72 100644
--- a/include/cobalt/kernel/stat.h
+++ b/include/cobalt/kernel/stat.h
@@ -58,7 +58,7 @@ do { \
#define xnstat_exectime_set_current(sched, new_account) \
({ \
xnstat_exectime_t *__prev; \
- __prev = (xnstat_exectime_t *)atomic_long_xchg(&(sched)->current_account, (long)(new_account)); \
+ __prev = (xnstat_exectime_t *)atomic_long_xchg((atomic_long_t *)&(sched)->current_account, (long)(new_account)); \
__prev; \
})
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/4] cobalt/kernel: fix compile error for incompatible pointer type
@ 2020-09-17 16:56 Fino Meng
0 siblings, 0 replies; 5+ messages in thread
From: Fino Meng @ 2020-09-17 16:56 UTC (permalink / raw)
To: xenomai
Signed-off-by: Fino Meng <fino.meng@linux.intel.com>
---
include/cobalt/kernel/stat.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/cobalt/kernel/stat.h b/include/cobalt/kernel/stat.h
index b857cd19f..be529ad72 100644
--- a/include/cobalt/kernel/stat.h
+++ b/include/cobalt/kernel/stat.h
@@ -58,7 +58,7 @@ do { \
#define xnstat_exectime_set_current(sched, new_account) \
({ \
xnstat_exectime_t *__prev; \
- __prev = (xnstat_exectime_t *)atomic_long_xchg(&(sched)->current_account, (long)(new_account)); \
+ __prev = (xnstat_exectime_t *)atomic_long_xchg((atomic_long_t *)&(sched)->current_account, (long)(new_account)); \
__prev; \
})
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-09-21 11:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-18 6:32 [PATCH 3/4] cobalt/kernel: fix compile error for incompatible pointer type Fino Meng
2020-09-18 13:05 ` Jan Kiszka
2020-09-21 11:32 ` Meng, Fino
-- strict thread matches above, loose matches on Subject: below --
2020-09-18 5:56 [PATCH 1/4] cobalt/x86: adapt fpu code with Linux kernel upstream Fino Meng
2020-09-18 5:56 ` [PATCH 3/4] cobalt/kernel: fix compile error for incompatible pointer type Fino Meng
2020-09-17 16:56 Fino Meng
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.