Re: Removing architectures without upstream gcc support

2018-03-09 Thread Xuetao Guan

> * unicore32 was a research project at Peking University with a SoC
>   based on the Intel PXA design. No gcc source code has ever been
>   published, the only toolchain available is a set of binaries that
> include
>   a gcc-4.4 compiler. The project page at
>   http://mprc.pku.edu.cn/~guanxuetao/linux/ has a TODO list that has
>   not been modified since 2011. The maintainer still Acks patches
>   and has last sent a pull request in 2014 and last sent a patch of
>   his own in 2012 when the project appears to have stalled.
>   I would suggest removing this one.
>
Hi, Arnd.
I am really sorry to reply so late, since I seldom use this email account
in recent years. I will add my new email account to related bits.

Let me clarify the status of UniCore. It's a real cpu-core product,
integrated into PKUnity SoC, and sold in a large amount of embedded boxes,
such as cloud terminals and set top boxes. Surely, we still use the port
internally and keep doing developments in other projects. So, I really
appreciate having unicore32 port in the tree.

As to gnu toolchain of UniCore, I have already discussed it in my group,
and I'll do my best to propel it forward.

Thanks,
Guan Xuetao


Re: Removing architectures without upstream gcc support

2018-03-09 Thread Xuetao Guan

> * unicore32 was a research project at Peking University with a SoC
>   based on the Intel PXA design. No gcc source code has ever been
>   published, the only toolchain available is a set of binaries that
> include
>   a gcc-4.4 compiler. The project page at
>   http://mprc.pku.edu.cn/~guanxuetao/linux/ has a TODO list that has
>   not been modified since 2011. The maintainer still Acks patches
>   and has last sent a pull request in 2014 and last sent a patch of
>   his own in 2012 when the project appears to have stalled.
>   I would suggest removing this one.
>
Hi, Arnd.
I am really sorry to reply so late, since I seldom use this email account
in recent years. I will add my new email account to related bits.

Let me clarify the status of UniCore. It's a real cpu-core product,
integrated into PKUnity SoC, and sold in a large amount of embedded boxes,
such as cloud terminals and set top boxes. Surely, we still use the port
internally and keep doing developments in other projects. So, I really
appreciate having unicore32 port in the tree.

As to gnu toolchain of UniCore, I have already discussed it in my group,
and I'll do my best to propel it forward.

Thanks,
Guan Xuetao


Re: [PATCH] unicore32/time: set ->min_delta_ticks and ->max_delta_ticks

2017-03-30 Thread Xuetao Guan
> In preparation for making the clockevents core NTP correction aware,
> all clockevent device drivers must set ->min_delta_ticks and
> ->max_delta_ticks rather than ->min_delta_ns and ->max_delta_ns: a
> clockevent device's rate is going to change dynamically and thus, the
> ratio of ns to ticks ceases to stay invariant.
>
> Make the unicore32 arch's clockevent driver initialize these fields
> properly.
>
> This patch alone doesn't introduce any change in functionality as the
> clockevents core still looks exclusively at the (untouched) ->min_delta_ns
> and ->max_delta_ns. As soon as this has changed, a followup patch will
> purge the initialization of ->min_delta_ns and ->max_delta_ns from this
> driver.
>
> Signed-off-by: Nicolai Stange 

Thanks,
Acked-by: Guan Xuetao 

> ---
>
> Notes:
> This prerequisite patch is part of a larger effort to feed NTP
> corrections into the clockevent devices' frequencies and thus
> avoiding their notion of time to diverge from the system's
> one. If you're interested, the current state of the whole series
> can be found at [1].
>
> If you haven't got any objections and these prerequisites get
> merged by 4.12 everywhere, I'll proceed with the remainder of
> this series in 4.13.
>
> Applicable to next-20170324 as well as to John' Stultz tree [2].
>
> [1]
>   git://nicst.de/linux.git cev-freq-adj.v10.fortglx-4.12-time
>   
> https://nicst.de/git/?p=linux.git;a=shortlog;h=refs/heads/cev-freq-adj.v10.fortglx-4.12-time
>
> [2]
>   https://git.linaro.org/people/john.stultz/linux.git
> fortglx/4.12/time
>
>  arch/unicore32/kernel/time.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/unicore32/kernel/time.c b/arch/unicore32/kernel/time.c
> index fceaa673f861..c6b3fa3ee0b6 100644
> --- a/arch/unicore32/kernel/time.c
> +++ b/arch/unicore32/kernel/time.c
> @@ -91,8 +91,10 @@ void __init time_init(void)
>
>   ckevt_puv3_osmr0.max_delta_ns =
>   clockevent_delta2ns(0x7fff, _puv3_osmr0);
> + ckevt_puv3_osmr0.max_delta_ticks = 0x7fff;
>   ckevt_puv3_osmr0.min_delta_ns =
>   clockevent_delta2ns(MIN_OSCR_DELTA * 2, _puv3_osmr0) + 1;
> + ckevt_puv3_osmr0.min_delta_ticks = MIN_OSCR_DELTA * 2;
>   ckevt_puv3_osmr0.cpumask = cpumask_of(0);
>
>   setup_irq(IRQ_TIMER0, _timer_irq);
> --
> 2.12.0
>



Re: [PATCH] unicore32/time: set ->min_delta_ticks and ->max_delta_ticks

2017-03-30 Thread Xuetao Guan
> In preparation for making the clockevents core NTP correction aware,
> all clockevent device drivers must set ->min_delta_ticks and
> ->max_delta_ticks rather than ->min_delta_ns and ->max_delta_ns: a
> clockevent device's rate is going to change dynamically and thus, the
> ratio of ns to ticks ceases to stay invariant.
>
> Make the unicore32 arch's clockevent driver initialize these fields
> properly.
>
> This patch alone doesn't introduce any change in functionality as the
> clockevents core still looks exclusively at the (untouched) ->min_delta_ns
> and ->max_delta_ns. As soon as this has changed, a followup patch will
> purge the initialization of ->min_delta_ns and ->max_delta_ns from this
> driver.
>
> Signed-off-by: Nicolai Stange 

Thanks,
Acked-by: Guan Xuetao 

> ---
>
> Notes:
> This prerequisite patch is part of a larger effort to feed NTP
> corrections into the clockevent devices' frequencies and thus
> avoiding their notion of time to diverge from the system's
> one. If you're interested, the current state of the whole series
> can be found at [1].
>
> If you haven't got any objections and these prerequisites get
> merged by 4.12 everywhere, I'll proceed with the remainder of
> this series in 4.13.
>
> Applicable to next-20170324 as well as to John' Stultz tree [2].
>
> [1]
>   git://nicst.de/linux.git cev-freq-adj.v10.fortglx-4.12-time
>   
> https://nicst.de/git/?p=linux.git;a=shortlog;h=refs/heads/cev-freq-adj.v10.fortglx-4.12-time
>
> [2]
>   https://git.linaro.org/people/john.stultz/linux.git
> fortglx/4.12/time
>
>  arch/unicore32/kernel/time.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/unicore32/kernel/time.c b/arch/unicore32/kernel/time.c
> index fceaa673f861..c6b3fa3ee0b6 100644
> --- a/arch/unicore32/kernel/time.c
> +++ b/arch/unicore32/kernel/time.c
> @@ -91,8 +91,10 @@ void __init time_init(void)
>
>   ckevt_puv3_osmr0.max_delta_ns =
>   clockevent_delta2ns(0x7fff, _puv3_osmr0);
> + ckevt_puv3_osmr0.max_delta_ticks = 0x7fff;
>   ckevt_puv3_osmr0.min_delta_ns =
>   clockevent_delta2ns(MIN_OSCR_DELTA * 2, _puv3_osmr0) + 1;
> + ckevt_puv3_osmr0.min_delta_ticks = MIN_OSCR_DELTA * 2;
>   ckevt_puv3_osmr0.cpumask = cpumask_of(0);
>
>   setup_irq(IRQ_TIMER0, _timer_irq);
> --
> 2.12.0
>



Re: [PATCH 1/3] linux/const.h: move UL() macro to include/linux/const.h

2017-01-04 Thread Xuetao Guan
> Some architectures are duplicating the definition of UL():
>
>   #define UL(x) _AC(x, UL)
>
> This is not actually arch-specific, so it will be useful to move it
> to a common header.  Currently, we only have the uapi variant for
> linux/const.h, so I am creating include/linux/const.h.
>
> I am also adding _UL(x), _ULL(x), ULL(x) because _AC() is used for
> UL in most places (and ULL in some places).  I expect _AC(..., UL)
> will be replaced with _UL(...) or UL(...).  The underscore-prefixed
> one should be used for exported headers.
>
> Note:
> I renamed UL(x) in arch/m68k/mm/init.c, where it is used for a
> different meaning.
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  arch/arm/include/asm/memory.h   | 6 --
>  arch/arm64/include/asm/memory.h | 6 --
>  arch/m68k/mm/init.c | 6 +++---
>  arch/unicore32/include/asm/memory.h | 6 --
>  include/linux/const.h   | 9 +
>  include/uapi/linux/const.h  | 9 ++---
>  6 files changed, 18 insertions(+), 24 deletions(-)
>  create mode 100644 include/linux/const.h
>
> diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
> index 76cbd9c..7558247 100644
> --- a/arch/arm/include/asm/memory.h
> +++ b/arch/arm/include/asm/memory.h
> @@ -22,12 +22,6 @@
>  #include 
>  #endif
>
> -/*
> - * Allow for constants defined here to be used from assembly code
> - * by prepending the UL suffix only with actual C code compilation.
> - */
> -#define UL(x) _AC(x, UL)
> -
>  /* PAGE_OFFSET - the virtual address of the start of the kernel image */
>  #define PAGE_OFFSET  UL(CONFIG_PAGE_OFFSET)
>
> diff --git a/arch/arm64/include/asm/memory.h
> b/arch/arm64/include/asm/memory.h
> index bfe6328..4310bcc 100644
> --- a/arch/arm64/include/asm/memory.h
> +++ b/arch/arm64/include/asm/memory.h
> @@ -28,12 +28,6 @@
>  #include 
>
>  /*
> - * Allow for constants defined here to be used from assembly code
> - * by prepending the UL suffix only with actual C code compilation.
> - */
> -#define UL(x) _AC(x, UL)
> -
> -/*
>   * Size of the PCI I/O space. This must remain a power of two so that
>   * IO_SPACE_LIMIT acts as a mask for the low bits of I/O addresses.
>   */
> diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
> index 9c1e656..a625144 100644
> --- a/arch/m68k/mm/init.c
> +++ b/arch/m68k/mm/init.c
> @@ -121,9 +121,9 @@ void free_initmem(void)
>
>  void __init print_memmap(void)
>  {
> -#define UL(x) ((unsigned long) (x))
> -#define MLK(b, t) UL(b), UL(t), (UL(t) - UL(b)) >> 10
> -#define MLM(b, t) UL(b), UL(t), (UL(t) - UL(b)) >> 20
> +#define TO_UL(x) ((unsigned long) (x))
> +#define MLK(b, t) TO_UL(b), TO_UL(t), (TO_UL(t) - TO_UL(b)) >> 10
> +#define MLM(b, t) TO_UL(b), TO_UL(t), (TO_UL(t) - TO_UL(b)) >> 20
>  #define MLK_ROUNDUP(b, t) b, t, DIV_ROUND_UP(((t) - (b)), 1024)
>
>   pr_notice("Virtual kernel memory layout:\n"
> diff --git a/arch/unicore32/include/asm/memory.h
> b/arch/unicore32/include/asm/memory.h
> index 3bb0a29..66bb9f6 100644
> --- a/arch/unicore32/include/asm/memory.h
> +++ b/arch/unicore32/include/asm/memory.h
> @@ -20,12 +20,6 @@
>  #include 
>
>  /*
> - * Allow for constants defined here to be used from assembly code
> - * by prepending the UL suffix only with actual C code compilation.
> - */
> -#define UL(x) _AC(x, UL)
> -
> -/*
>   * PAGE_OFFSET - the virtual address of the start of the kernel image
>   * TASK_SIZE - the maximum size of a user space task.
>   * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area

For UniCore32 codes:
Acked-by: Guan Xuetao 

Thanks.

Xuetao

> diff --git a/include/linux/const.h b/include/linux/const.h
> new file mode 100644
> index 000..7b55a55
> --- /dev/null
> +++ b/include/linux/const.h
> @@ -0,0 +1,9 @@
> +#ifndef _LINUX_CONST_H
> +#define _LINUX_CONST_H
> +
> +#include 
> +
> +#define UL(x)(_UL(x))
> +#define ULL(x)   (_ULL(x))
> +
> +#endif /* _LINUX_CONST_H */
> diff --git a/include/uapi/linux/const.h b/include/uapi/linux/const.h
> index c872bfd..76fb0f9 100644
> --- a/include/uapi/linux/const.h
> +++ b/include/uapi/linux/const.h
> @@ -1,7 +1,7 @@
>  /* const.h: Macros for dealing with constants.  */
>
> -#ifndef _LINUX_CONST_H
> -#define _LINUX_CONST_H
> +#ifndef _UAPI_LINUX_CONST_H
> +#define _UAPI_LINUX_CONST_H
>
>  /* Some constant macros are used in both assembler and
>   * C code.  Therefore we cannot annotate them always with
> @@ -21,7 +21,10 @@
>  #define _AT(T,X) ((T)(X))
>  #endif
>
> +#define _UL(x)   (_AC(x, UL))
> +#define _ULL(x)  (_AC(x, ULL))
> +
>  #define _BITUL(x)(_AC(1,UL) << (x))
>  #define _BITULL(x)   (_AC(1,ULL) << (x))
>
> -#endif /* !(_LINUX_CONST_H) */
> +#endif /* _UAPI_LINUX_CONST_H */
> --
> 2.7.4
>



Re: [PATCH 1/3] linux/const.h: move UL() macro to include/linux/const.h

2017-01-04 Thread Xuetao Guan
> Some architectures are duplicating the definition of UL():
>
>   #define UL(x) _AC(x, UL)
>
> This is not actually arch-specific, so it will be useful to move it
> to a common header.  Currently, we only have the uapi variant for
> linux/const.h, so I am creating include/linux/const.h.
>
> I am also adding _UL(x), _ULL(x), ULL(x) because _AC() is used for
> UL in most places (and ULL in some places).  I expect _AC(..., UL)
> will be replaced with _UL(...) or UL(...).  The underscore-prefixed
> one should be used for exported headers.
>
> Note:
> I renamed UL(x) in arch/m68k/mm/init.c, where it is used for a
> different meaning.
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  arch/arm/include/asm/memory.h   | 6 --
>  arch/arm64/include/asm/memory.h | 6 --
>  arch/m68k/mm/init.c | 6 +++---
>  arch/unicore32/include/asm/memory.h | 6 --
>  include/linux/const.h   | 9 +
>  include/uapi/linux/const.h  | 9 ++---
>  6 files changed, 18 insertions(+), 24 deletions(-)
>  create mode 100644 include/linux/const.h
>
> diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
> index 76cbd9c..7558247 100644
> --- a/arch/arm/include/asm/memory.h
> +++ b/arch/arm/include/asm/memory.h
> @@ -22,12 +22,6 @@
>  #include 
>  #endif
>
> -/*
> - * Allow for constants defined here to be used from assembly code
> - * by prepending the UL suffix only with actual C code compilation.
> - */
> -#define UL(x) _AC(x, UL)
> -
>  /* PAGE_OFFSET - the virtual address of the start of the kernel image */
>  #define PAGE_OFFSET  UL(CONFIG_PAGE_OFFSET)
>
> diff --git a/arch/arm64/include/asm/memory.h
> b/arch/arm64/include/asm/memory.h
> index bfe6328..4310bcc 100644
> --- a/arch/arm64/include/asm/memory.h
> +++ b/arch/arm64/include/asm/memory.h
> @@ -28,12 +28,6 @@
>  #include 
>
>  /*
> - * Allow for constants defined here to be used from assembly code
> - * by prepending the UL suffix only with actual C code compilation.
> - */
> -#define UL(x) _AC(x, UL)
> -
> -/*
>   * Size of the PCI I/O space. This must remain a power of two so that
>   * IO_SPACE_LIMIT acts as a mask for the low bits of I/O addresses.
>   */
> diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
> index 9c1e656..a625144 100644
> --- a/arch/m68k/mm/init.c
> +++ b/arch/m68k/mm/init.c
> @@ -121,9 +121,9 @@ void free_initmem(void)
>
>  void __init print_memmap(void)
>  {
> -#define UL(x) ((unsigned long) (x))
> -#define MLK(b, t) UL(b), UL(t), (UL(t) - UL(b)) >> 10
> -#define MLM(b, t) UL(b), UL(t), (UL(t) - UL(b)) >> 20
> +#define TO_UL(x) ((unsigned long) (x))
> +#define MLK(b, t) TO_UL(b), TO_UL(t), (TO_UL(t) - TO_UL(b)) >> 10
> +#define MLM(b, t) TO_UL(b), TO_UL(t), (TO_UL(t) - TO_UL(b)) >> 20
>  #define MLK_ROUNDUP(b, t) b, t, DIV_ROUND_UP(((t) - (b)), 1024)
>
>   pr_notice("Virtual kernel memory layout:\n"
> diff --git a/arch/unicore32/include/asm/memory.h
> b/arch/unicore32/include/asm/memory.h
> index 3bb0a29..66bb9f6 100644
> --- a/arch/unicore32/include/asm/memory.h
> +++ b/arch/unicore32/include/asm/memory.h
> @@ -20,12 +20,6 @@
>  #include 
>
>  /*
> - * Allow for constants defined here to be used from assembly code
> - * by prepending the UL suffix only with actual C code compilation.
> - */
> -#define UL(x) _AC(x, UL)
> -
> -/*
>   * PAGE_OFFSET - the virtual address of the start of the kernel image
>   * TASK_SIZE - the maximum size of a user space task.
>   * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area

For UniCore32 codes:
Acked-by: Guan Xuetao 

Thanks.

Xuetao

> diff --git a/include/linux/const.h b/include/linux/const.h
> new file mode 100644
> index 000..7b55a55
> --- /dev/null
> +++ b/include/linux/const.h
> @@ -0,0 +1,9 @@
> +#ifndef _LINUX_CONST_H
> +#define _LINUX_CONST_H
> +
> +#include 
> +
> +#define UL(x)(_UL(x))
> +#define ULL(x)   (_ULL(x))
> +
> +#endif /* _LINUX_CONST_H */
> diff --git a/include/uapi/linux/const.h b/include/uapi/linux/const.h
> index c872bfd..76fb0f9 100644
> --- a/include/uapi/linux/const.h
> +++ b/include/uapi/linux/const.h
> @@ -1,7 +1,7 @@
>  /* const.h: Macros for dealing with constants.  */
>
> -#ifndef _LINUX_CONST_H
> -#define _LINUX_CONST_H
> +#ifndef _UAPI_LINUX_CONST_H
> +#define _UAPI_LINUX_CONST_H
>
>  /* Some constant macros are used in both assembler and
>   * C code.  Therefore we cannot annotate them always with
> @@ -21,7 +21,10 @@
>  #define _AT(T,X) ((T)(X))
>  #endif
>
> +#define _UL(x)   (_AC(x, UL))
> +#define _ULL(x)  (_AC(x, ULL))
> +
>  #define _BITUL(x)(_AC(1,UL) << (x))
>  #define _BITULL(x)   (_AC(1,ULL) << (x))
>
> -#endif /* !(_LINUX_CONST_H) */
> +#endif /* _UAPI_LINUX_CONST_H */
> --
> 2.7.4
>



Re: [PATCH -next] unicore32: Fix build error

2016-10-25 Thread Xuetao Guan
> Since the oldabi syscall interface was first introduced, the
> infrastructure
> changed and the patch no longer compiles. See commit f56141e3e2d9a ("all
> arches, signal: move restart_block to struct task_struct") for details.
>
> Fixes: 1ace5d1e3d4b4 ("unicore32-oldabi: add oldabi syscall interface")
> Signed-off-by: Guenter Roeck 

Sorry, I missed your patch when sent patch-v2 for oldabi.
And so, I directly modified the codes in patch-v2.
I'll add your comment and Sob for patch-v2.
Thanks, Guenter.

Xuetao

> ---
> Should be merged with the commit introducing the problem if possible.
>
>  arch/unicore32/kernel/signal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/unicore32/kernel/signal.c
> b/arch/unicore32/kernel/signal.c
> index 78a66491b108..be75ef8c1e0c 100644
> --- a/arch/unicore32/kernel/signal.c
> +++ b/arch/unicore32/kernel/signal.c
> @@ -115,7 +115,7 @@ asmlinkage int __sys_sigreturn(struct pt_regs *regs)
>   struct sigframe __user *frame;
>
>   /* Always make any pending restarted system calls return -EINTR */
> - current_thread_info()->restart_block.fn = do_no_restart_syscall;
> + current->restart_block.fn = do_no_restart_syscall;
>
>   /*
>* Since we stacked the signal on a 64-bit boundary,
> --
> 2.5.0
>



Re: [PATCH -next] unicore32: Fix build error

2016-10-25 Thread Xuetao Guan
> Since the oldabi syscall interface was first introduced, the
> infrastructure
> changed and the patch no longer compiles. See commit f56141e3e2d9a ("all
> arches, signal: move restart_block to struct task_struct") for details.
>
> Fixes: 1ace5d1e3d4b4 ("unicore32-oldabi: add oldabi syscall interface")
> Signed-off-by: Guenter Roeck 

Sorry, I missed your patch when sent patch-v2 for oldabi.
And so, I directly modified the codes in patch-v2.
I'll add your comment and Sob for patch-v2.
Thanks, Guenter.

Xuetao

> ---
> Should be merged with the commit introducing the problem if possible.
>
>  arch/unicore32/kernel/signal.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/unicore32/kernel/signal.c
> b/arch/unicore32/kernel/signal.c
> index 78a66491b108..be75ef8c1e0c 100644
> --- a/arch/unicore32/kernel/signal.c
> +++ b/arch/unicore32/kernel/signal.c
> @@ -115,7 +115,7 @@ asmlinkage int __sys_sigreturn(struct pt_regs *regs)
>   struct sigframe __user *frame;
>
>   /* Always make any pending restarted system calls return -EINTR */
> - current_thread_info()->restart_block.fn = do_no_restart_syscall;
> + current->restart_block.fn = do_no_restart_syscall;
>
>   /*
>* Since we stacked the signal on a 64-bit boundary,
> --
> 2.5.0
>



[PATCHv2 4/4] unicore32-oldabi: add oldabi syscall interface

2016-09-28 Thread Xuetao Guan
Define unicore32 oldabi syscall in
arch/unicore32/include/uapi/asm/unistd-oldabi.h.
And implement some architecture related syscalls.

Signed-off-by: Guan Xuetao 
Signed-off-by: Qin Rui 
Tested-by: Guenter Roeck 
---
 arch/unicore32/Kconfig  |   3 +
 arch/unicore32/include/asm/Kbuild   |   2 -
 arch/unicore32/include/asm/signal.h |  21 +
 arch/unicore32/include/asm/syscalls.h   |  25 +
 arch/unicore32/include/uapi/asm/unistd-oldabi.h | 770

 arch/unicore32/include/uapi/asm/unistd.h|   8 +
 arch/unicore32/kernel/entry.S   |  17 +
 arch/unicore32/kernel/signal.c  |  41 ++
 8 files changed, 885 insertions(+), 2 deletions(-)
 create mode 100644 arch/unicore32/include/asm/signal.h
 create mode 100644 arch/unicore32/include/asm/syscalls.h
 create mode 100644 arch/unicore32/include/uapi/asm/unistd-oldabi.h

diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index e23100b..0a3bfd1 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -72,6 +72,9 @@ menu "System Type"
 config UNICORE32_OLDABI
bool "Allow old ABI binaries to run with this kernel"
default y
+   select CLONE_BACKWARDS
+   select OLD_SIGACTION
+   select OLD_SIGSUSPEND3
help
  This option preserves the old syscall interface instead of the
asm-generic one. It also provides a compatibility layer to
diff --git a/arch/unicore32/include/asm/Kbuild
b/arch/unicore32/include/asm/Kbuild
index 0ce2a5a..8578702 100644
--- a/arch/unicore32/include/asm/Kbuild
+++ b/arch/unicore32/include/asm/Kbuild
@@ -45,13 +45,11 @@ generic-y += setup.h
 generic-y += shmbuf.h
 generic-y += shmparam.h
 generic-y += siginfo.h
-generic-y += signal.h
 generic-y += sizes.h
 generic-y += socket.h
 generic-y += sockios.h
 generic-y += statfs.h
 generic-y += swab.h
-generic-y += syscalls.h
 generic-y += termbits.h
 generic-y += termios.h
 generic-y += topology.h
diff --git a/arch/unicore32/include/asm/signal.h
b/arch/unicore32/include/asm/signal.h
new file mode 100644
index 000..a875198
--- /dev/null
+++ b/arch/unicore32/include/asm/signal.h
@@ -0,0 +1,21 @@
+/*
+ * linux/arch/unicore32/include/asm/signal.h
+ *
+ * Code specific to UniCore ISA
+ *
+ * Copyright (C) 2014 GUAN Xuetao
+ *
+ * This program is free software; you can redistribute it and/or modify +
* it under the terms of the GNU General Public License version 2 as + *
published by the Free Software Foundation.
+ */
+#ifndef __UNICORE32_ASM_SIGNAL_H__
+#define __UNICORE32_ASM_SIGNAL_H__
+
+#ifdef CONFIG_UNICORE32_OLDABI
+#define SA_RESTORER0x0400
+#endif
+
+#include 
+
+#endif /* __UNICORE32_ASM_SIGNAL_H__ */
diff --git a/arch/unicore32/include/asm/syscalls.h
b/arch/unicore32/include/asm/syscalls.h
new file mode 100644
index 000..362cf4d
--- /dev/null
+++ b/arch/unicore32/include/asm/syscalls.h
@@ -0,0 +1,25 @@
+/*
+ * linux/arch/unicore32/include/asm/syscalls.h
+ *
+ * Code specific to UniCore ISA
+ *
+ * Copyright (C) 2014 GUAN Xuetao
+ *
+ * This program is free software; you can redistribute it and/or modify +
* it under the terms of the GNU General Public License version 2 as + *
published by the Free Software Foundation.
+ */
+#ifndef __UNICORE32_ASM_SYSCALLS_H__
+#define __UNICORE32_ASM_SYSCALLS_H__
+
+#include 
+
+#ifdef CONFIG_UNICORE32_OLDABI
+/* Wrapper functions */
+extern asmlinkage long sys_clone_wrapper(unsigned long clone_flags,
+   unsigned long newsp, int __user *parent_tidptr,
+   int tls_val, int __user *child_tidptr);
+extern asmlinkage long sys_sigreturn_wrapper(struct pt_regs *regs);
+#endif /* CONFIG_UNICORE32_OLDABI */
+
+#endif /* __UNICORE32_ASM_SYSCALLS_H__ */
diff --git a/arch/unicore32/include/uapi/asm/unistd-oldabi.h
b/arch/unicore32/include/uapi/asm/unistd-oldabi.h
new file mode 100644
index 000..0c24fcf
--- /dev/null
+++ b/arch/unicore32/include/uapi/asm/unistd-oldabi.h
@@ -0,0 +1,770 @@
+#ifndef CONFIG_UNICORE32_OLDABI
+#error unistd-oldabi.h is ONLY used when CONFIG_UNICORE32_OLDABI defined
+#endif
+
+#define __NR_SYSCALL_BASE  0x90
+
+#ifndef __SYSCALL
+#define __SYSCALL(x, y)
+#endif
+
+#define __NR_restart_syscall 0
+__SYSCALL(__NR_restart_syscall, sys_restart_syscall)
+#define __NR_exit 1
+__SYSCALL(__NR_exit, sys_exit)
+#define __NR_fork 2
+__SYSCALL(__NR_fork, sys_fork)
+#define __NR_read 3
+__SYSCALL(__NR_read, sys_read)
+#define __NR_write 4
+__SYSCALL(__NR_write, sys_write)
+#define __NR_open 5
+__SYSCALL(__NR_open, sys_open)
+#define __NR_close 6
+__SYSCALL(__NR_close, sys_close)
+   /* 7 was sys_waitpid */
+#define __NR_creat 8
+__SYSCALL(__NR_creat, sys_creat)
+#define __NR_link 9
+__SYSCALL(__NR_link, sys_link)
+#define __NR_unlink 10
+__SYSCALL(__NR_unlink, sys_unlink)
+#define __NR_execve 11
+__SYSCALL(__NR_execve, sys_execve)
+#define 

[PATCHv2 4/4] unicore32-oldabi: add oldabi syscall interface

2016-09-28 Thread Xuetao Guan
Define unicore32 oldabi syscall in
arch/unicore32/include/uapi/asm/unistd-oldabi.h.
And implement some architecture related syscalls.

Signed-off-by: Guan Xuetao 
Signed-off-by: Qin Rui 
Tested-by: Guenter Roeck 
---
 arch/unicore32/Kconfig  |   3 +
 arch/unicore32/include/asm/Kbuild   |   2 -
 arch/unicore32/include/asm/signal.h |  21 +
 arch/unicore32/include/asm/syscalls.h   |  25 +
 arch/unicore32/include/uapi/asm/unistd-oldabi.h | 770

 arch/unicore32/include/uapi/asm/unistd.h|   8 +
 arch/unicore32/kernel/entry.S   |  17 +
 arch/unicore32/kernel/signal.c  |  41 ++
 8 files changed, 885 insertions(+), 2 deletions(-)
 create mode 100644 arch/unicore32/include/asm/signal.h
 create mode 100644 arch/unicore32/include/asm/syscalls.h
 create mode 100644 arch/unicore32/include/uapi/asm/unistd-oldabi.h

diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index e23100b..0a3bfd1 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -72,6 +72,9 @@ menu "System Type"
 config UNICORE32_OLDABI
bool "Allow old ABI binaries to run with this kernel"
default y
+   select CLONE_BACKWARDS
+   select OLD_SIGACTION
+   select OLD_SIGSUSPEND3
help
  This option preserves the old syscall interface instead of the
asm-generic one. It also provides a compatibility layer to
diff --git a/arch/unicore32/include/asm/Kbuild
b/arch/unicore32/include/asm/Kbuild
index 0ce2a5a..8578702 100644
--- a/arch/unicore32/include/asm/Kbuild
+++ b/arch/unicore32/include/asm/Kbuild
@@ -45,13 +45,11 @@ generic-y += setup.h
 generic-y += shmbuf.h
 generic-y += shmparam.h
 generic-y += siginfo.h
-generic-y += signal.h
 generic-y += sizes.h
 generic-y += socket.h
 generic-y += sockios.h
 generic-y += statfs.h
 generic-y += swab.h
-generic-y += syscalls.h
 generic-y += termbits.h
 generic-y += termios.h
 generic-y += topology.h
diff --git a/arch/unicore32/include/asm/signal.h
b/arch/unicore32/include/asm/signal.h
new file mode 100644
index 000..a875198
--- /dev/null
+++ b/arch/unicore32/include/asm/signal.h
@@ -0,0 +1,21 @@
+/*
+ * linux/arch/unicore32/include/asm/signal.h
+ *
+ * Code specific to UniCore ISA
+ *
+ * Copyright (C) 2014 GUAN Xuetao
+ *
+ * This program is free software; you can redistribute it and/or modify +
* it under the terms of the GNU General Public License version 2 as + *
published by the Free Software Foundation.
+ */
+#ifndef __UNICORE32_ASM_SIGNAL_H__
+#define __UNICORE32_ASM_SIGNAL_H__
+
+#ifdef CONFIG_UNICORE32_OLDABI
+#define SA_RESTORER0x0400
+#endif
+
+#include 
+
+#endif /* __UNICORE32_ASM_SIGNAL_H__ */
diff --git a/arch/unicore32/include/asm/syscalls.h
b/arch/unicore32/include/asm/syscalls.h
new file mode 100644
index 000..362cf4d
--- /dev/null
+++ b/arch/unicore32/include/asm/syscalls.h
@@ -0,0 +1,25 @@
+/*
+ * linux/arch/unicore32/include/asm/syscalls.h
+ *
+ * Code specific to UniCore ISA
+ *
+ * Copyright (C) 2014 GUAN Xuetao
+ *
+ * This program is free software; you can redistribute it and/or modify +
* it under the terms of the GNU General Public License version 2 as + *
published by the Free Software Foundation.
+ */
+#ifndef __UNICORE32_ASM_SYSCALLS_H__
+#define __UNICORE32_ASM_SYSCALLS_H__
+
+#include 
+
+#ifdef CONFIG_UNICORE32_OLDABI
+/* Wrapper functions */
+extern asmlinkage long sys_clone_wrapper(unsigned long clone_flags,
+   unsigned long newsp, int __user *parent_tidptr,
+   int tls_val, int __user *child_tidptr);
+extern asmlinkage long sys_sigreturn_wrapper(struct pt_regs *regs);
+#endif /* CONFIG_UNICORE32_OLDABI */
+
+#endif /* __UNICORE32_ASM_SYSCALLS_H__ */
diff --git a/arch/unicore32/include/uapi/asm/unistd-oldabi.h
b/arch/unicore32/include/uapi/asm/unistd-oldabi.h
new file mode 100644
index 000..0c24fcf
--- /dev/null
+++ b/arch/unicore32/include/uapi/asm/unistd-oldabi.h
@@ -0,0 +1,770 @@
+#ifndef CONFIG_UNICORE32_OLDABI
+#error unistd-oldabi.h is ONLY used when CONFIG_UNICORE32_OLDABI defined
+#endif
+
+#define __NR_SYSCALL_BASE  0x90
+
+#ifndef __SYSCALL
+#define __SYSCALL(x, y)
+#endif
+
+#define __NR_restart_syscall 0
+__SYSCALL(__NR_restart_syscall, sys_restart_syscall)
+#define __NR_exit 1
+__SYSCALL(__NR_exit, sys_exit)
+#define __NR_fork 2
+__SYSCALL(__NR_fork, sys_fork)
+#define __NR_read 3
+__SYSCALL(__NR_read, sys_read)
+#define __NR_write 4
+__SYSCALL(__NR_write, sys_write)
+#define __NR_open 5
+__SYSCALL(__NR_open, sys_open)
+#define __NR_close 6
+__SYSCALL(__NR_close, sys_close)
+   /* 7 was sys_waitpid */
+#define __NR_creat 8
+__SYSCALL(__NR_creat, sys_creat)
+#define __NR_link 9
+__SYSCALL(__NR_link, sys_link)
+#define __NR_unlink 10
+__SYSCALL(__NR_unlink, sys_unlink)
+#define __NR_execve 11
+__SYSCALL(__NR_execve, sys_execve)
+#define __NR_chdir 12
+__SYSCALL(__NR_chdir, sys_chdir)
+#define 

[PATCHv2 1/4] unicore32-oldabi: add CONFIG_UNICORE32_OLDABI for distinguishing two ABIs

2016-09-28 Thread Xuetao Guan
Signed-off-by: Guan Xuetao 
Signed-off-by: Qin Rui 
Tested-by: Guenter Roeck 
---
 arch/unicore32/Kconfig | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index 0769066..e23100b 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -69,6 +69,17 @@ source "kernel/Kconfig.freezer"

 menu "System Type"

+config UNICORE32_OLDABI
+   bool "Allow old ABI binaries to run with this kernel"
+   default y
+   help
+ This option preserves the old syscall interface instead of the +  
 
asm-generic one. It also provides a compatibility layer to
+ intercept syscalls that have structure arguments which layout
+ in memory differs between the asm-generic ABI and this old one. +
+ If in doubt, say Y.
+
 config MMU
def_bool y

-- 
1.9.1







[PATCHv2 2/4] unicore32-oldabi: add stat.h support for UNICORE32_OLDABI

2016-09-28 Thread Xuetao Guan
Remove generated code in arch/unicore32/include/asm/Kbuild, and
restore asm/stat.h for UNICORE32_OLDABI.

Signed-off-by: Guan Xuetao 
Signed-off-by: Qin Rui 
Tested-by: Guenter Roeck 
---
 arch/unicore32/include/asm/Kbuild |  1 -
 arch/unicore32/include/uapi/asm/stat-oldabi.h | 71
+++
 arch/unicore32/include/uapi/asm/stat.h| 19 +++
 3 files changed, 90 insertions(+), 1 deletion(-)
 create mode 100644 arch/unicore32/include/uapi/asm/stat-oldabi.h
 create mode 100644 arch/unicore32/include/uapi/asm/stat.h

diff --git a/arch/unicore32/include/asm/Kbuild
b/arch/unicore32/include/asm/Kbuild
index 256c45b..0ce2a5a 100644
--- a/arch/unicore32/include/asm/Kbuild
+++ b/arch/unicore32/include/asm/Kbuild
@@ -49,7 +49,6 @@ generic-y += signal.h
 generic-y += sizes.h
 generic-y += socket.h
 generic-y += sockios.h
-generic-y += stat.h
 generic-y += statfs.h
 generic-y += swab.h
 generic-y += syscalls.h
diff --git a/arch/unicore32/include/uapi/asm/stat-oldabi.h
b/arch/unicore32/include/uapi/asm/stat-oldabi.h
new file mode 100644
index 000..d36ce13
--- /dev/null
+++ b/arch/unicore32/include/uapi/asm/stat-oldabi.h
@@ -0,0 +1,71 @@
+/*
+ * Code specific to UniCore32 ISA
+ *
+ * Copyright (C) 2014 GUAN Xuetao
+ *
+ * This program is free software; you can redistribute it and/or modify +
* it under the terms of the GNU General Public License version 2 as + *
published by the Free Software Foundation.
+ */
+#ifndef __UNICORE32_ASM_STAT_OLDABI_H__
+#define __UNICORE32_ASM_STAT_OLDABI_H__
+
+#define STAT_HAVE_NSEC 1
+
+struct stat {
+   unsigned long   st_dev; /* Device.  */
+   unsigned long   st_ino; /* File serial number.  */
+   unsigned intst_mode;/* File mode.  */
+   unsigned intst_nlink;   /* Link count.  */
+   unsigned intst_uid; /* User ID of the file's owner.  */
+   unsigned intst_gid; /* Group ID of the file's group. */
+   unsigned long   st_rdev;/* Device number, if device.  */
+   unsigned long   __pad1;
+   longst_size;/* Size of file, in bytes.  */
+   int st_blksize; /* Optimal block size for I/O.  */
+   int __pad2;
+   longst_blocks;  /* Number 512-byte blocks allocated. */
+   int st_atime;   /* Time of last access.  */
+   unsigned intst_atime_nsec;
+   int st_mtime;   /* Time of last modification.  */
+   unsigned intst_mtime_nsec;
+   int st_ctime;   /* Time of last status change.  */
+   unsigned intst_ctime_nsec;
+   unsigned int__unused4;
+   unsigned int__unused5;
+};
+
+/*
+ * This matches struct stat64 in glibc2.1, hence the absolutely
+ * insane amounts of padding around dev_t's.
+ * Note: The kernel zero's the padded region because glibc might read them
+ * in the hope that the kernel has stretched to using larger sizes. + */
+#define STAT64_HAS_BROKEN_ST_INO
+
+struct stat64 {
+   unsigned long long  st_dev; /* Device.  */
+   unsigned char   __pad0[4];
+   unsigned long   __st_ino;
+   unsigned intst_mode;/* File mode.  */
+   unsigned intst_nlink;   /* Link count.  */
+   unsigned intst_uid; /* UID of the file's owner.  */
+   unsigned intst_gid; /* GID of the file's group. */
+   unsigned long long  st_rdev;/* Device number, if device. */
+
+   unsigned char   __pad3[4];
+
+   long long   st_size;/* Size of file, in bytes.  */
+   int st_blksize; /* Optimal block size for I/O.  */
+   long long   st_blocks;  /* Number 512-byte blocks allocated. */
+   int st_atime;   /* Time of last access.  */
+   unsigned intst_atime_nsec;
+   int st_mtime;   /* Time of last modification.  */
+   unsigned intst_mtime_nsec;
+   int st_ctime;   /* Time of last status change.  */
+   unsigned intst_ctime_nsec;
+
+   unsigned long long  st_ino;
+};
+
+#endif /* __UNICORE32_ASM_STAT_OLDABI_H__ */
diff --git a/arch/unicore32/include/uapi/asm/stat.h
b/arch/unicore32/include/uapi/asm/stat.h
new file mode 100644
index 000..2cff377d
--- /dev/null
+++ b/arch/unicore32/include/uapi/asm/stat.h
@@ -0,0 +1,19 @@
+/*
+ * Code specific to UniCore32 ISA
+ *
+ * Copyright (C) 2014 GUAN Xuetao
+ *
+ * This program is free software; you can redistribute it and/or modify +
* it under the terms of the GNU General Public License version 2 as + *
published by the Free Software Foundation.
+ */
+#ifndef __UNICORE32_ASM_STAT_H__
+#define __UNICORE32_ASM_STAT_H__
+
+#ifndef CONFIG_UNICORE32_OLDABI
+#include 
+#else
+#include 
+#endif /* 

[PATCHv2 4/4] unicore32-oldabi: add oldabi syscall interface

2016-09-28 Thread Xuetao Guan
Define unicore32 oldabi syscall in
arch/unicore32/include/uapi/asm/unistd-oldabi.h.
And implement some architecture related syscalls.

Signed-off-by: Guan Xuetao 
Signed-off-by: Qin Rui 
Tested-by: Guenter Roeck 
---
 arch/unicore32/Kconfig  |   3 +
 arch/unicore32/include/asm/Kbuild   |   2 -
 arch/unicore32/include/asm/signal.h |  21 +
 arch/unicore32/include/asm/syscalls.h   |  25 +
 arch/unicore32/include/uapi/asm/unistd-oldabi.h | 770

 arch/unicore32/include/uapi/asm/unistd.h|   8 +
 arch/unicore32/kernel/entry.S   |  17 +
 arch/unicore32/kernel/signal.c  |  41 ++
 8 files changed, 885 insertions(+), 2 deletions(-)
 create mode 100644 arch/unicore32/include/asm/signal.h
 create mode 100644 arch/unicore32/include/asm/syscalls.h
 create mode 100644 arch/unicore32/include/uapi/asm/unistd-oldabi.h

diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index e23100b..0a3bfd1 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -72,6 +72,9 @@ menu "System Type"
 config UNICORE32_OLDABI
bool "Allow old ABI binaries to run with this kernel"
default y
+   select CLONE_BACKWARDS
+   select OLD_SIGACTION
+   select OLD_SIGSUSPEND3
help
  This option preserves the old syscall interface instead of the
asm-generic one. It also provides a compatibility layer to
diff --git a/arch/unicore32/include/asm/Kbuild
b/arch/unicore32/include/asm/Kbuild
index 0ce2a5a..8578702 100644
--- a/arch/unicore32/include/asm/Kbuild
+++ b/arch/unicore32/include/asm/Kbuild
@@ -45,13 +45,11 @@ generic-y += setup.h
 generic-y += shmbuf.h
 generic-y += shmparam.h
 generic-y += siginfo.h
-generic-y += signal.h
 generic-y += sizes.h
 generic-y += socket.h
 generic-y += sockios.h
 generic-y += statfs.h
 generic-y += swab.h
-generic-y += syscalls.h
 generic-y += termbits.h
 generic-y += termios.h
 generic-y += topology.h
diff --git a/arch/unicore32/include/asm/signal.h
b/arch/unicore32/include/asm/signal.h
new file mode 100644
index 000..a875198
--- /dev/null
+++ b/arch/unicore32/include/asm/signal.h
@@ -0,0 +1,21 @@
+/*
+ * linux/arch/unicore32/include/asm/signal.h
+ *
+ * Code specific to UniCore ISA
+ *
+ * Copyright (C) 2014 GUAN Xuetao
+ *
+ * This program is free software; you can redistribute it and/or modify +
* it under the terms of the GNU General Public License version 2 as + *
published by the Free Software Foundation.
+ */
+#ifndef __UNICORE32_ASM_SIGNAL_H__
+#define __UNICORE32_ASM_SIGNAL_H__
+
+#ifdef CONFIG_UNICORE32_OLDABI
+#define SA_RESTORER0x0400
+#endif
+
+#include 
+
+#endif /* __UNICORE32_ASM_SIGNAL_H__ */
diff --git a/arch/unicore32/include/asm/syscalls.h
b/arch/unicore32/include/asm/syscalls.h
new file mode 100644
index 000..362cf4d
--- /dev/null
+++ b/arch/unicore32/include/asm/syscalls.h
@@ -0,0 +1,25 @@
+/*
+ * linux/arch/unicore32/include/asm/syscalls.h
+ *
+ * Code specific to UniCore ISA
+ *
+ * Copyright (C) 2014 GUAN Xuetao
+ *
+ * This program is free software; you can redistribute it and/or modify +
* it under the terms of the GNU General Public License version 2 as + *
published by the Free Software Foundation.
+ */
+#ifndef __UNICORE32_ASM_SYSCALLS_H__
+#define __UNICORE32_ASM_SYSCALLS_H__
+
+#include 
+
+#ifdef CONFIG_UNICORE32_OLDABI
+/* Wrapper functions */
+extern asmlinkage long sys_clone_wrapper(unsigned long clone_flags,
+   unsigned long newsp, int __user *parent_tidptr,
+   int tls_val, int __user *child_tidptr);
+extern asmlinkage long sys_sigreturn_wrapper(struct pt_regs *regs);
+#endif /* CONFIG_UNICORE32_OLDABI */
+
+#endif /* __UNICORE32_ASM_SYSCALLS_H__ */
diff --git a/arch/unicore32/include/uapi/asm/unistd-oldabi.h
b/arch/unicore32/include/uapi/asm/unistd-oldabi.h
new file mode 100644
index 000..0c24fcf
--- /dev/null
+++ b/arch/unicore32/include/uapi/asm/unistd-oldabi.h
@@ -0,0 +1,770 @@
+#ifndef CONFIG_UNICORE32_OLDABI
+#error unistd-oldabi.h is ONLY used when CONFIG_UNICORE32_OLDABI defined
+#endif
+
+#define __NR_SYSCALL_BASE  0x90
+
+#ifndef __SYSCALL
+#define __SYSCALL(x, y)
+#endif
+
+#define __NR_restart_syscall 0
+__SYSCALL(__NR_restart_syscall, sys_restart_syscall)
+#define __NR_exit 1
+__SYSCALL(__NR_exit, sys_exit)
+#define __NR_fork 2
+__SYSCALL(__NR_fork, sys_fork)
+#define __NR_read 3
+__SYSCALL(__NR_read, sys_read)
+#define __NR_write 4
+__SYSCALL(__NR_write, sys_write)
+#define __NR_open 5
+__SYSCALL(__NR_open, sys_open)
+#define __NR_close 6
+__SYSCALL(__NR_close, sys_close)
+   /* 7 was sys_waitpid */
+#define __NR_creat 8
+__SYSCALL(__NR_creat, sys_creat)
+#define __NR_link 9
+__SYSCALL(__NR_link, sys_link)
+#define __NR_unlink 10
+__SYSCALL(__NR_unlink, sys_unlink)
+#define __NR_execve 11
+__SYSCALL(__NR_execve, sys_execve)
+#define 

[PATCHv2 3/4] unicore32-oldabi: add sigcontext.h support for UNICORE32_OLDABI

2016-09-28 Thread Xuetao Guan
Signed-off-by: Guan Xuetao 
Signed-off-by: Qin Rui 
Tested-by: Guenter Roeck 
---
 arch/unicore32/include/uapi/asm/sigcontext.h | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/arch/unicore32/include/uapi/asm/sigcontext.h
b/arch/unicore32/include/uapi/asm/sigcontext.h
index 6a2d767..cbc3446 100644
--- a/arch/unicore32/include/uapi/asm/sigcontext.h
+++ b/arch/unicore32/include/uapi/asm/sigcontext.h
@@ -18,6 +18,7 @@
  * before the signal handler was invoked.  Note: only add new entries *
to the end of the structure.
  */
+#ifndef CONFIG_UNICORE32_OLDABI
 struct sigcontext {
unsigned long trap_no;
unsigned long error_code;
@@ -25,5 +26,18 @@ struct sigcontext {
unsigned long fault_address;
struct pt_regs regs;
 };
+#else
+struct pt_regs_sigcontext {
+   unsigned long uregs[33];
+};
+
+struct sigcontext {
+   unsigned long trap_no;
+   unsigned long error_code;
+   unsigned long oldmask;
+   struct pt_regs_sigcontext regs;
+   unsigned long fault_address;
+};
+#endif /* CONFIG_UNICORE32_OLDABI */

 #endif
-- 
1.9.1







[PATCHv2 1/4] unicore32-oldabi: add CONFIG_UNICORE32_OLDABI for distinguishing two ABIs

2016-09-28 Thread Xuetao Guan
Signed-off-by: Guan Xuetao 
Signed-off-by: Qin Rui 
Tested-by: Guenter Roeck 
---
 arch/unicore32/Kconfig | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index 0769066..e23100b 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -69,6 +69,17 @@ source "kernel/Kconfig.freezer"

 menu "System Type"

+config UNICORE32_OLDABI
+   bool "Allow old ABI binaries to run with this kernel"
+   default y
+   help
+ This option preserves the old syscall interface instead of the +  
 
asm-generic one. It also provides a compatibility layer to
+ intercept syscalls that have structure arguments which layout
+ in memory differs between the asm-generic ABI and this old one. +
+ If in doubt, say Y.
+
 config MMU
def_bool y

-- 
1.9.1







[PATCHv2 2/4] unicore32-oldabi: add stat.h support for UNICORE32_OLDABI

2016-09-28 Thread Xuetao Guan
Remove generated code in arch/unicore32/include/asm/Kbuild, and
restore asm/stat.h for UNICORE32_OLDABI.

Signed-off-by: Guan Xuetao 
Signed-off-by: Qin Rui 
Tested-by: Guenter Roeck 
---
 arch/unicore32/include/asm/Kbuild |  1 -
 arch/unicore32/include/uapi/asm/stat-oldabi.h | 71
+++
 arch/unicore32/include/uapi/asm/stat.h| 19 +++
 3 files changed, 90 insertions(+), 1 deletion(-)
 create mode 100644 arch/unicore32/include/uapi/asm/stat-oldabi.h
 create mode 100644 arch/unicore32/include/uapi/asm/stat.h

diff --git a/arch/unicore32/include/asm/Kbuild
b/arch/unicore32/include/asm/Kbuild
index 256c45b..0ce2a5a 100644
--- a/arch/unicore32/include/asm/Kbuild
+++ b/arch/unicore32/include/asm/Kbuild
@@ -49,7 +49,6 @@ generic-y += signal.h
 generic-y += sizes.h
 generic-y += socket.h
 generic-y += sockios.h
-generic-y += stat.h
 generic-y += statfs.h
 generic-y += swab.h
 generic-y += syscalls.h
diff --git a/arch/unicore32/include/uapi/asm/stat-oldabi.h
b/arch/unicore32/include/uapi/asm/stat-oldabi.h
new file mode 100644
index 000..d36ce13
--- /dev/null
+++ b/arch/unicore32/include/uapi/asm/stat-oldabi.h
@@ -0,0 +1,71 @@
+/*
+ * Code specific to UniCore32 ISA
+ *
+ * Copyright (C) 2014 GUAN Xuetao
+ *
+ * This program is free software; you can redistribute it and/or modify +
* it under the terms of the GNU General Public License version 2 as + *
published by the Free Software Foundation.
+ */
+#ifndef __UNICORE32_ASM_STAT_OLDABI_H__
+#define __UNICORE32_ASM_STAT_OLDABI_H__
+
+#define STAT_HAVE_NSEC 1
+
+struct stat {
+   unsigned long   st_dev; /* Device.  */
+   unsigned long   st_ino; /* File serial number.  */
+   unsigned intst_mode;/* File mode.  */
+   unsigned intst_nlink;   /* Link count.  */
+   unsigned intst_uid; /* User ID of the file's owner.  */
+   unsigned intst_gid; /* Group ID of the file's group. */
+   unsigned long   st_rdev;/* Device number, if device.  */
+   unsigned long   __pad1;
+   longst_size;/* Size of file, in bytes.  */
+   int st_blksize; /* Optimal block size for I/O.  */
+   int __pad2;
+   longst_blocks;  /* Number 512-byte blocks allocated. */
+   int st_atime;   /* Time of last access.  */
+   unsigned intst_atime_nsec;
+   int st_mtime;   /* Time of last modification.  */
+   unsigned intst_mtime_nsec;
+   int st_ctime;   /* Time of last status change.  */
+   unsigned intst_ctime_nsec;
+   unsigned int__unused4;
+   unsigned int__unused5;
+};
+
+/*
+ * This matches struct stat64 in glibc2.1, hence the absolutely
+ * insane amounts of padding around dev_t's.
+ * Note: The kernel zero's the padded region because glibc might read them
+ * in the hope that the kernel has stretched to using larger sizes. + */
+#define STAT64_HAS_BROKEN_ST_INO
+
+struct stat64 {
+   unsigned long long  st_dev; /* Device.  */
+   unsigned char   __pad0[4];
+   unsigned long   __st_ino;
+   unsigned intst_mode;/* File mode.  */
+   unsigned intst_nlink;   /* Link count.  */
+   unsigned intst_uid; /* UID of the file's owner.  */
+   unsigned intst_gid; /* GID of the file's group. */
+   unsigned long long  st_rdev;/* Device number, if device. */
+
+   unsigned char   __pad3[4];
+
+   long long   st_size;/* Size of file, in bytes.  */
+   int st_blksize; /* Optimal block size for I/O.  */
+   long long   st_blocks;  /* Number 512-byte blocks allocated. */
+   int st_atime;   /* Time of last access.  */
+   unsigned intst_atime_nsec;
+   int st_mtime;   /* Time of last modification.  */
+   unsigned intst_mtime_nsec;
+   int st_ctime;   /* Time of last status change.  */
+   unsigned intst_ctime_nsec;
+
+   unsigned long long  st_ino;
+};
+
+#endif /* __UNICORE32_ASM_STAT_OLDABI_H__ */
diff --git a/arch/unicore32/include/uapi/asm/stat.h
b/arch/unicore32/include/uapi/asm/stat.h
new file mode 100644
index 000..2cff377d
--- /dev/null
+++ b/arch/unicore32/include/uapi/asm/stat.h
@@ -0,0 +1,19 @@
+/*
+ * Code specific to UniCore32 ISA
+ *
+ * Copyright (C) 2014 GUAN Xuetao
+ *
+ * This program is free software; you can redistribute it and/or modify +
* it under the terms of the GNU General Public License version 2 as + *
published by the Free Software Foundation.
+ */
+#ifndef __UNICORE32_ASM_STAT_H__
+#define __UNICORE32_ASM_STAT_H__
+
+#ifndef CONFIG_UNICORE32_OLDABI
+#include 
+#else
+#include 
+#endif /* CONFIG_UNICORE32_OLDABI */
+
+#endif /* __UNICORE32_ASM_STAT_H__ */
-- 
1.9.1





[PATCHv2 4/4] unicore32-oldabi: add oldabi syscall interface

2016-09-28 Thread Xuetao Guan
Define unicore32 oldabi syscall in
arch/unicore32/include/uapi/asm/unistd-oldabi.h.
And implement some architecture related syscalls.

Signed-off-by: Guan Xuetao 
Signed-off-by: Qin Rui 
Tested-by: Guenter Roeck 
---
 arch/unicore32/Kconfig  |   3 +
 arch/unicore32/include/asm/Kbuild   |   2 -
 arch/unicore32/include/asm/signal.h |  21 +
 arch/unicore32/include/asm/syscalls.h   |  25 +
 arch/unicore32/include/uapi/asm/unistd-oldabi.h | 770

 arch/unicore32/include/uapi/asm/unistd.h|   8 +
 arch/unicore32/kernel/entry.S   |  17 +
 arch/unicore32/kernel/signal.c  |  41 ++
 8 files changed, 885 insertions(+), 2 deletions(-)
 create mode 100644 arch/unicore32/include/asm/signal.h
 create mode 100644 arch/unicore32/include/asm/syscalls.h
 create mode 100644 arch/unicore32/include/uapi/asm/unistd-oldabi.h

diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index e23100b..0a3bfd1 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -72,6 +72,9 @@ menu "System Type"
 config UNICORE32_OLDABI
bool "Allow old ABI binaries to run with this kernel"
default y
+   select CLONE_BACKWARDS
+   select OLD_SIGACTION
+   select OLD_SIGSUSPEND3
help
  This option preserves the old syscall interface instead of the
asm-generic one. It also provides a compatibility layer to
diff --git a/arch/unicore32/include/asm/Kbuild
b/arch/unicore32/include/asm/Kbuild
index 0ce2a5a..8578702 100644
--- a/arch/unicore32/include/asm/Kbuild
+++ b/arch/unicore32/include/asm/Kbuild
@@ -45,13 +45,11 @@ generic-y += setup.h
 generic-y += shmbuf.h
 generic-y += shmparam.h
 generic-y += siginfo.h
-generic-y += signal.h
 generic-y += sizes.h
 generic-y += socket.h
 generic-y += sockios.h
 generic-y += statfs.h
 generic-y += swab.h
-generic-y += syscalls.h
 generic-y += termbits.h
 generic-y += termios.h
 generic-y += topology.h
diff --git a/arch/unicore32/include/asm/signal.h
b/arch/unicore32/include/asm/signal.h
new file mode 100644
index 000..a875198
--- /dev/null
+++ b/arch/unicore32/include/asm/signal.h
@@ -0,0 +1,21 @@
+/*
+ * linux/arch/unicore32/include/asm/signal.h
+ *
+ * Code specific to UniCore ISA
+ *
+ * Copyright (C) 2014 GUAN Xuetao
+ *
+ * This program is free software; you can redistribute it and/or modify +
* it under the terms of the GNU General Public License version 2 as + *
published by the Free Software Foundation.
+ */
+#ifndef __UNICORE32_ASM_SIGNAL_H__
+#define __UNICORE32_ASM_SIGNAL_H__
+
+#ifdef CONFIG_UNICORE32_OLDABI
+#define SA_RESTORER0x0400
+#endif
+
+#include 
+
+#endif /* __UNICORE32_ASM_SIGNAL_H__ */
diff --git a/arch/unicore32/include/asm/syscalls.h
b/arch/unicore32/include/asm/syscalls.h
new file mode 100644
index 000..362cf4d
--- /dev/null
+++ b/arch/unicore32/include/asm/syscalls.h
@@ -0,0 +1,25 @@
+/*
+ * linux/arch/unicore32/include/asm/syscalls.h
+ *
+ * Code specific to UniCore ISA
+ *
+ * Copyright (C) 2014 GUAN Xuetao
+ *
+ * This program is free software; you can redistribute it and/or modify +
* it under the terms of the GNU General Public License version 2 as + *
published by the Free Software Foundation.
+ */
+#ifndef __UNICORE32_ASM_SYSCALLS_H__
+#define __UNICORE32_ASM_SYSCALLS_H__
+
+#include 
+
+#ifdef CONFIG_UNICORE32_OLDABI
+/* Wrapper functions */
+extern asmlinkage long sys_clone_wrapper(unsigned long clone_flags,
+   unsigned long newsp, int __user *parent_tidptr,
+   int tls_val, int __user *child_tidptr);
+extern asmlinkage long sys_sigreturn_wrapper(struct pt_regs *regs);
+#endif /* CONFIG_UNICORE32_OLDABI */
+
+#endif /* __UNICORE32_ASM_SYSCALLS_H__ */
diff --git a/arch/unicore32/include/uapi/asm/unistd-oldabi.h
b/arch/unicore32/include/uapi/asm/unistd-oldabi.h
new file mode 100644
index 000..0c24fcf
--- /dev/null
+++ b/arch/unicore32/include/uapi/asm/unistd-oldabi.h
@@ -0,0 +1,770 @@
+#ifndef CONFIG_UNICORE32_OLDABI
+#error unistd-oldabi.h is ONLY used when CONFIG_UNICORE32_OLDABI defined
+#endif
+
+#define __NR_SYSCALL_BASE  0x90
+
+#ifndef __SYSCALL
+#define __SYSCALL(x, y)
+#endif
+
+#define __NR_restart_syscall 0
+__SYSCALL(__NR_restart_syscall, sys_restart_syscall)
+#define __NR_exit 1
+__SYSCALL(__NR_exit, sys_exit)
+#define __NR_fork 2
+__SYSCALL(__NR_fork, sys_fork)
+#define __NR_read 3
+__SYSCALL(__NR_read, sys_read)
+#define __NR_write 4
+__SYSCALL(__NR_write, sys_write)
+#define __NR_open 5
+__SYSCALL(__NR_open, sys_open)
+#define __NR_close 6
+__SYSCALL(__NR_close, sys_close)
+   /* 7 was sys_waitpid */
+#define __NR_creat 8
+__SYSCALL(__NR_creat, sys_creat)
+#define __NR_link 9
+__SYSCALL(__NR_link, sys_link)
+#define __NR_unlink 10
+__SYSCALL(__NR_unlink, sys_unlink)
+#define __NR_execve 11
+__SYSCALL(__NR_execve, sys_execve)
+#define __NR_chdir 12
+__SYSCALL(__NR_chdir, sys_chdir)
+#define 

[PATCHv2 3/4] unicore32-oldabi: add sigcontext.h support for UNICORE32_OLDABI

2016-09-28 Thread Xuetao Guan
Signed-off-by: Guan Xuetao 
Signed-off-by: Qin Rui 
Tested-by: Guenter Roeck 
---
 arch/unicore32/include/uapi/asm/sigcontext.h | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/arch/unicore32/include/uapi/asm/sigcontext.h
b/arch/unicore32/include/uapi/asm/sigcontext.h
index 6a2d767..cbc3446 100644
--- a/arch/unicore32/include/uapi/asm/sigcontext.h
+++ b/arch/unicore32/include/uapi/asm/sigcontext.h
@@ -18,6 +18,7 @@
  * before the signal handler was invoked.  Note: only add new entries *
to the end of the structure.
  */
+#ifndef CONFIG_UNICORE32_OLDABI
 struct sigcontext {
unsigned long trap_no;
unsigned long error_code;
@@ -25,5 +26,18 @@ struct sigcontext {
unsigned long fault_address;
struct pt_regs regs;
 };
+#else
+struct pt_regs_sigcontext {
+   unsigned long uregs[33];
+};
+
+struct sigcontext {
+   unsigned long trap_no;
+   unsigned long error_code;
+   unsigned long oldmask;
+   struct pt_regs_sigcontext regs;
+   unsigned long fault_address;
+};
+#endif /* CONFIG_UNICORE32_OLDABI */

 #endif
-- 
1.9.1







[PATCHv2 4/4] unicore32-oldabi: add oldabi syscall interface

2016-09-28 Thread Xuetao Guan
Define unicore32 oldabi syscall in
arch/unicore32/include/uapi/asm/unistd-oldabi.h.
And implement some architecture related syscalls.

Signed-off-by: Guan Xuetao 
Signed-off-by: Qin Rui 
Tested-by: Guenter Roeck 
---
 arch/unicore32/Kconfig  |   3 +
 arch/unicore32/include/asm/Kbuild   |   2 -
 arch/unicore32/include/asm/signal.h |  21 +
 arch/unicore32/include/asm/syscalls.h   |  25 +
 arch/unicore32/include/uapi/asm/unistd-oldabi.h | 770

 arch/unicore32/include/uapi/asm/unistd.h|   8 +
 arch/unicore32/kernel/entry.S   |  17 +
 arch/unicore32/kernel/signal.c  |  41 ++
 8 files changed, 885 insertions(+), 2 deletions(-)
 create mode 100644 arch/unicore32/include/asm/signal.h
 create mode 100644 arch/unicore32/include/asm/syscalls.h
 create mode 100644 arch/unicore32/include/uapi/asm/unistd-oldabi.h

diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index e23100b..0a3bfd1 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -72,6 +72,9 @@ menu "System Type"
 config UNICORE32_OLDABI
bool "Allow old ABI binaries to run with this kernel"
default y
+   select CLONE_BACKWARDS
+   select OLD_SIGACTION
+   select OLD_SIGSUSPEND3
help
  This option preserves the old syscall interface instead of the
asm-generic one. It also provides a compatibility layer to
diff --git a/arch/unicore32/include/asm/Kbuild
b/arch/unicore32/include/asm/Kbuild
index 0ce2a5a..8578702 100644
--- a/arch/unicore32/include/asm/Kbuild
+++ b/arch/unicore32/include/asm/Kbuild
@@ -45,13 +45,11 @@ generic-y += setup.h
 generic-y += shmbuf.h
 generic-y += shmparam.h
 generic-y += siginfo.h
-generic-y += signal.h
 generic-y += sizes.h
 generic-y += socket.h
 generic-y += sockios.h
 generic-y += statfs.h
 generic-y += swab.h
-generic-y += syscalls.h
 generic-y += termbits.h
 generic-y += termios.h
 generic-y += topology.h
diff --git a/arch/unicore32/include/asm/signal.h
b/arch/unicore32/include/asm/signal.h
new file mode 100644
index 000..a875198
--- /dev/null
+++ b/arch/unicore32/include/asm/signal.h
@@ -0,0 +1,21 @@
+/*
+ * linux/arch/unicore32/include/asm/signal.h
+ *
+ * Code specific to UniCore ISA
+ *
+ * Copyright (C) 2014 GUAN Xuetao
+ *
+ * This program is free software; you can redistribute it and/or modify +
* it under the terms of the GNU General Public License version 2 as + *
published by the Free Software Foundation.
+ */
+#ifndef __UNICORE32_ASM_SIGNAL_H__
+#define __UNICORE32_ASM_SIGNAL_H__
+
+#ifdef CONFIG_UNICORE32_OLDABI
+#define SA_RESTORER0x0400
+#endif
+
+#include 
+
+#endif /* __UNICORE32_ASM_SIGNAL_H__ */
diff --git a/arch/unicore32/include/asm/syscalls.h
b/arch/unicore32/include/asm/syscalls.h
new file mode 100644
index 000..362cf4d
--- /dev/null
+++ b/arch/unicore32/include/asm/syscalls.h
@@ -0,0 +1,25 @@
+/*
+ * linux/arch/unicore32/include/asm/syscalls.h
+ *
+ * Code specific to UniCore ISA
+ *
+ * Copyright (C) 2014 GUAN Xuetao
+ *
+ * This program is free software; you can redistribute it and/or modify +
* it under the terms of the GNU General Public License version 2 as + *
published by the Free Software Foundation.
+ */
+#ifndef __UNICORE32_ASM_SYSCALLS_H__
+#define __UNICORE32_ASM_SYSCALLS_H__
+
+#include 
+
+#ifdef CONFIG_UNICORE32_OLDABI
+/* Wrapper functions */
+extern asmlinkage long sys_clone_wrapper(unsigned long clone_flags,
+   unsigned long newsp, int __user *parent_tidptr,
+   int tls_val, int __user *child_tidptr);
+extern asmlinkage long sys_sigreturn_wrapper(struct pt_regs *regs);
+#endif /* CONFIG_UNICORE32_OLDABI */
+
+#endif /* __UNICORE32_ASM_SYSCALLS_H__ */
diff --git a/arch/unicore32/include/uapi/asm/unistd-oldabi.h
b/arch/unicore32/include/uapi/asm/unistd-oldabi.h
new file mode 100644
index 000..0c24fcf
--- /dev/null
+++ b/arch/unicore32/include/uapi/asm/unistd-oldabi.h
@@ -0,0 +1,770 @@
+#ifndef CONFIG_UNICORE32_OLDABI
+#error unistd-oldabi.h is ONLY used when CONFIG_UNICORE32_OLDABI defined
+#endif
+
+#define __NR_SYSCALL_BASE  0x90
+
+#ifndef __SYSCALL
+#define __SYSCALL(x, y)
+#endif
+
+#define __NR_restart_syscall 0
+__SYSCALL(__NR_restart_syscall, sys_restart_syscall)
+#define __NR_exit 1
+__SYSCALL(__NR_exit, sys_exit)
+#define __NR_fork 2
+__SYSCALL(__NR_fork, sys_fork)
+#define __NR_read 3
+__SYSCALL(__NR_read, sys_read)
+#define __NR_write 4
+__SYSCALL(__NR_write, sys_write)
+#define __NR_open 5
+__SYSCALL(__NR_open, sys_open)
+#define __NR_close 6
+__SYSCALL(__NR_close, sys_close)
+   /* 7 was sys_waitpid */
+#define __NR_creat 8
+__SYSCALL(__NR_creat, sys_creat)
+#define __NR_link 9
+__SYSCALL(__NR_link, sys_link)
+#define __NR_unlink 10
+__SYSCALL(__NR_unlink, sys_unlink)
+#define __NR_execve 11
+__SYSCALL(__NR_execve, sys_execve)
+#define 

[PATCHv2 4/4] unicore32-oldabi: add oldabi syscall interface

2016-09-28 Thread Xuetao Guan
Define unicore32 oldabi syscall in
arch/unicore32/include/uapi/asm/unistd-oldabi.h.
And implement some architecture related syscalls.

Signed-off-by: Guan Xuetao 
Signed-off-by: Qin Rui 
Tested-by: Guenter Roeck 
---
 arch/unicore32/Kconfig  |   3 +
 arch/unicore32/include/asm/Kbuild   |   2 -
 arch/unicore32/include/asm/signal.h |  21 +
 arch/unicore32/include/asm/syscalls.h   |  25 +
 arch/unicore32/include/uapi/asm/unistd-oldabi.h | 770

 arch/unicore32/include/uapi/asm/unistd.h|   8 +
 arch/unicore32/kernel/entry.S   |  17 +
 arch/unicore32/kernel/signal.c  |  41 ++
 8 files changed, 885 insertions(+), 2 deletions(-)
 create mode 100644 arch/unicore32/include/asm/signal.h
 create mode 100644 arch/unicore32/include/asm/syscalls.h
 create mode 100644 arch/unicore32/include/uapi/asm/unistd-oldabi.h

diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index e23100b..0a3bfd1 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -72,6 +72,9 @@ menu "System Type"
 config UNICORE32_OLDABI
bool "Allow old ABI binaries to run with this kernel"
default y
+   select CLONE_BACKWARDS
+   select OLD_SIGACTION
+   select OLD_SIGSUSPEND3
help
  This option preserves the old syscall interface instead of the
asm-generic one. It also provides a compatibility layer to
diff --git a/arch/unicore32/include/asm/Kbuild
b/arch/unicore32/include/asm/Kbuild
index 0ce2a5a..8578702 100644
--- a/arch/unicore32/include/asm/Kbuild
+++ b/arch/unicore32/include/asm/Kbuild
@@ -45,13 +45,11 @@ generic-y += setup.h
 generic-y += shmbuf.h
 generic-y += shmparam.h
 generic-y += siginfo.h
-generic-y += signal.h
 generic-y += sizes.h
 generic-y += socket.h
 generic-y += sockios.h
 generic-y += statfs.h
 generic-y += swab.h
-generic-y += syscalls.h
 generic-y += termbits.h
 generic-y += termios.h
 generic-y += topology.h
diff --git a/arch/unicore32/include/asm/signal.h
b/arch/unicore32/include/asm/signal.h
new file mode 100644
index 000..a875198
--- /dev/null
+++ b/arch/unicore32/include/asm/signal.h
@@ -0,0 +1,21 @@
+/*
+ * linux/arch/unicore32/include/asm/signal.h
+ *
+ * Code specific to UniCore ISA
+ *
+ * Copyright (C) 2014 GUAN Xuetao
+ *
+ * This program is free software; you can redistribute it and/or modify +
* it under the terms of the GNU General Public License version 2 as + *
published by the Free Software Foundation.
+ */
+#ifndef __UNICORE32_ASM_SIGNAL_H__
+#define __UNICORE32_ASM_SIGNAL_H__
+
+#ifdef CONFIG_UNICORE32_OLDABI
+#define SA_RESTORER0x0400
+#endif
+
+#include 
+
+#endif /* __UNICORE32_ASM_SIGNAL_H__ */
diff --git a/arch/unicore32/include/asm/syscalls.h
b/arch/unicore32/include/asm/syscalls.h
new file mode 100644
index 000..362cf4d
--- /dev/null
+++ b/arch/unicore32/include/asm/syscalls.h
@@ -0,0 +1,25 @@
+/*
+ * linux/arch/unicore32/include/asm/syscalls.h
+ *
+ * Code specific to UniCore ISA
+ *
+ * Copyright (C) 2014 GUAN Xuetao
+ *
+ * This program is free software; you can redistribute it and/or modify +
* it under the terms of the GNU General Public License version 2 as + *
published by the Free Software Foundation.
+ */
+#ifndef __UNICORE32_ASM_SYSCALLS_H__
+#define __UNICORE32_ASM_SYSCALLS_H__
+
+#include 
+
+#ifdef CONFIG_UNICORE32_OLDABI
+/* Wrapper functions */
+extern asmlinkage long sys_clone_wrapper(unsigned long clone_flags,
+   unsigned long newsp, int __user *parent_tidptr,
+   int tls_val, int __user *child_tidptr);
+extern asmlinkage long sys_sigreturn_wrapper(struct pt_regs *regs);
+#endif /* CONFIG_UNICORE32_OLDABI */
+
+#endif /* __UNICORE32_ASM_SYSCALLS_H__ */
diff --git a/arch/unicore32/include/uapi/asm/unistd-oldabi.h
b/arch/unicore32/include/uapi/asm/unistd-oldabi.h
new file mode 100644
index 000..0c24fcf
--- /dev/null
+++ b/arch/unicore32/include/uapi/asm/unistd-oldabi.h
@@ -0,0 +1,770 @@
+#ifndef CONFIG_UNICORE32_OLDABI
+#error unistd-oldabi.h is ONLY used when CONFIG_UNICORE32_OLDABI defined
+#endif
+
+#define __NR_SYSCALL_BASE  0x90
+
+#ifndef __SYSCALL
+#define __SYSCALL(x, y)
+#endif
+
+#define __NR_restart_syscall 0
+__SYSCALL(__NR_restart_syscall, sys_restart_syscall)
+#define __NR_exit 1
+__SYSCALL(__NR_exit, sys_exit)
+#define __NR_fork 2
+__SYSCALL(__NR_fork, sys_fork)
+#define __NR_read 3
+__SYSCALL(__NR_read, sys_read)
+#define __NR_write 4
+__SYSCALL(__NR_write, sys_write)
+#define __NR_open 5
+__SYSCALL(__NR_open, sys_open)
+#define __NR_close 6
+__SYSCALL(__NR_close, sys_close)
+   /* 7 was sys_waitpid */
+#define __NR_creat 8
+__SYSCALL(__NR_creat, sys_creat)
+#define __NR_link 9
+__SYSCALL(__NR_link, sys_link)
+#define __NR_unlink 10
+__SYSCALL(__NR_unlink, sys_unlink)
+#define __NR_execve 11
+__SYSCALL(__NR_execve, sys_execve)
+#define __NR_chdir 12
+__SYSCALL(__NR_chdir, sys_chdir)
+#define 

Re: [PATCH v4 7/7] unicore32: use the new LED disk activity trigger

2016-06-13 Thread Xuetao Guan
> Hi Guan,
>
> For consistency reasons this patch should be merged through LED tree,
> but I need an ack for this.
>
> Thanks,
> Jacek Anaszewski

For uc32 code,
Acked-by: GUAN Xuetao 

Thanks Jacek

>
> On 06/10/2016 08:00 AM, Stephan Linz wrote:
>> - platform: rename 'ide-disk' to 'disk-activity'
>> - defconfig: rename 'LEDS_TRIGGER_IDE_DISK' to 'LEDS_TRIGGER_DISK'
>>
>> Signed-off-by: Stephan Linz 
>> ---
>>   arch/unicore32/configs/unicore32_defconfig | 2 +-
>>   arch/unicore32/kernel/gpio.c   | 2 +-
>>   2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/unicore32/configs/unicore32_defconfig
>> b/arch/unicore32/configs/unicore32_defconfig
>> index 45f47f8..aebd01f 100644
>> --- a/arch/unicore32/configs/unicore32_defconfig
>> +++ b/arch/unicore32/configs/unicore32_defconfig
>> @@ -161,7 +161,7 @@ CONFIG_LEDS_GPIO=y
>>   #  LED Triggers
>>   CONFIG_LEDS_TRIGGERS=y
>>   CONFIG_LEDS_TRIGGER_TIMER=y
>> -CONFIG_LEDS_TRIGGER_IDE_DISK=y
>> +CONFIG_LEDS_TRIGGER_DISK=y
>>   CONFIG_LEDS_TRIGGER_HEARTBEAT=y
>>
>>   #  Real Time Clock
>> diff --git a/arch/unicore32/kernel/gpio.c b/arch/unicore32/kernel/gpio.c
>> index 49347a0..bf164bb 100644
>> --- a/arch/unicore32/kernel/gpio.c
>> +++ b/arch/unicore32/kernel/gpio.c
>> @@ -27,7 +27,7 @@ static const struct gpio_led puv3_gpio_leds[] = {
>>  { .name = "cpuhealth", .gpio = GPO_CPU_HEALTH, .active_low = 0,
>>  .default_trigger = "heartbeat", },
>>  { .name = "hdd_led", .gpio = GPO_HDD_LED, .active_low = 1,
>> -.default_trigger = "ide-disk", },
>> +.default_trigger = "disk-activity", },
>>   };
>>
>>   static const struct gpio_led_platform_data puv3_gpio_led_data = {
>>
>
>
> --
> Best regards,
> Jacek Anaszewski
>



Re: [PATCH v4 7/7] unicore32: use the new LED disk activity trigger

2016-06-13 Thread Xuetao Guan
> Hi Guan,
>
> For consistency reasons this patch should be merged through LED tree,
> but I need an ack for this.
>
> Thanks,
> Jacek Anaszewski

For uc32 code,
Acked-by: GUAN Xuetao 

Thanks Jacek

>
> On 06/10/2016 08:00 AM, Stephan Linz wrote:
>> - platform: rename 'ide-disk' to 'disk-activity'
>> - defconfig: rename 'LEDS_TRIGGER_IDE_DISK' to 'LEDS_TRIGGER_DISK'
>>
>> Signed-off-by: Stephan Linz 
>> ---
>>   arch/unicore32/configs/unicore32_defconfig | 2 +-
>>   arch/unicore32/kernel/gpio.c   | 2 +-
>>   2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/unicore32/configs/unicore32_defconfig
>> b/arch/unicore32/configs/unicore32_defconfig
>> index 45f47f8..aebd01f 100644
>> --- a/arch/unicore32/configs/unicore32_defconfig
>> +++ b/arch/unicore32/configs/unicore32_defconfig
>> @@ -161,7 +161,7 @@ CONFIG_LEDS_GPIO=y
>>   #  LED Triggers
>>   CONFIG_LEDS_TRIGGERS=y
>>   CONFIG_LEDS_TRIGGER_TIMER=y
>> -CONFIG_LEDS_TRIGGER_IDE_DISK=y
>> +CONFIG_LEDS_TRIGGER_DISK=y
>>   CONFIG_LEDS_TRIGGER_HEARTBEAT=y
>>
>>   #  Real Time Clock
>> diff --git a/arch/unicore32/kernel/gpio.c b/arch/unicore32/kernel/gpio.c
>> index 49347a0..bf164bb 100644
>> --- a/arch/unicore32/kernel/gpio.c
>> +++ b/arch/unicore32/kernel/gpio.c
>> @@ -27,7 +27,7 @@ static const struct gpio_led puv3_gpio_leds[] = {
>>  { .name = "cpuhealth", .gpio = GPO_CPU_HEALTH, .active_low = 0,
>>  .default_trigger = "heartbeat", },
>>  { .name = "hdd_led", .gpio = GPO_HDD_LED, .active_low = 1,
>> -.default_trigger = "ide-disk", },
>> +.default_trigger = "disk-activity", },
>>   };
>>
>>   static const struct gpio_led_platform_data puv3_gpio_led_data = {
>>
>
>
> --
> Best regards,
> Jacek Anaszewski
>



Re: [PATCH 4.6 000/100] 4.6.1-stable review

2016-06-01 Thread Xuetao Guan
> On Tue, May 31, 2016 at 10:35:32PM -0700, Guenter Roeck wrote:
>> On 05/30/2016 01:48 PM, Greg Kroah-Hartman wrote:
>> > This is the start of the stable review cycle for the 4.6.1 release.
>> > There are 100 patches in this series, all will be posted as a response
>> > to this one.  If anyone has any issues with these being applied,
>> please
>> > let me know.
>> >
>> > Responses should be made by Wed Jun  1 20:48:45 UTC 2016.
>> > Anything received after that time might be too late.
>> >
>>
>> Build results:
>>  total: 148 pass: 146 fail: 2
>> Failed builds:
>>  unicore32:defconfig
>>  unicore32:allnoconfig
>>
>> Qemu test results:
>>  total: 107 pass: 107 fail: 0
>>
>> The unicore32 failures are known and still seen in mainline as of today.
>> The fix is available in -next with commit c83d8b2fc986 ("unicore32: mm:
>> Add missing parameter to arch_vma_access_permitted"). Copying Guan
>> Xuetao
>> for advice when it might be available upstream.
>
> Thanks for this, and the other testing results.  I'll pick up the
> unicore32 patches when they hit Linus's tree.
>
> thanks,
>
> greg k-h
>

Thanks greg. And I haven't send merge request to linus.

Xuetao


Re: [PATCH 4.6 000/100] 4.6.1-stable review

2016-06-01 Thread Xuetao Guan
> On Tue, May 31, 2016 at 10:35:32PM -0700, Guenter Roeck wrote:
>> On 05/30/2016 01:48 PM, Greg Kroah-Hartman wrote:
>> > This is the start of the stable review cycle for the 4.6.1 release.
>> > There are 100 patches in this series, all will be posted as a response
>> > to this one.  If anyone has any issues with these being applied,
>> please
>> > let me know.
>> >
>> > Responses should be made by Wed Jun  1 20:48:45 UTC 2016.
>> > Anything received after that time might be too late.
>> >
>>
>> Build results:
>>  total: 148 pass: 146 fail: 2
>> Failed builds:
>>  unicore32:defconfig
>>  unicore32:allnoconfig
>>
>> Qemu test results:
>>  total: 107 pass: 107 fail: 0
>>
>> The unicore32 failures are known and still seen in mainline as of today.
>> The fix is available in -next with commit c83d8b2fc986 ("unicore32: mm:
>> Add missing parameter to arch_vma_access_permitted"). Copying Guan
>> Xuetao
>> for advice when it might be available upstream.
>
> Thanks for this, and the other testing results.  I'll pick up the
> unicore32 patches when they hit Linus's tree.
>
> thanks,
>
> greg k-h
>

Thanks greg. And I haven't send merge request to linus.

Xuetao


Re: [PATCH] unicore32: mm: Add missing parameter to arch_vma_access_permitted

2016-04-24 Thread Xuetao Guan
> ping ... still not upstream.
I'm sorry.
I'll do it in next week.

Xuetao

>
> On 03/21/2016 04:20 AM, Guenter Roeck wrote:
>> unicore32 fails to compile with the following errors.
>>
>> mm/memory.c: In function ���__handle_mm_fault��:
>> mm/memory.c:3381: error:
>>  too many arguments to function ���arch_vma_access_permitted��
>> mm/gup.c: In function ���check_vma_flags��:
>> mm/gup.c:456: error:
>>  too many arguments to function ���arch_vma_access_permitted��
>> mm/gup.c: In function ���vma_permits_fault��:
>> mm/gup.c:640: error:
>>  too many arguments to function ���arch_vma_access_permitted��
>>
>> Fixes: d61172b4b695b ("mm/core, x86/mm/pkeys: Differentiate instruction
>> fetches")
>> Cc: Dave Hansen 
>> Cc: Thomas Gleixner 
>> Cc: Ingo Molnar 
>> Signed-off-by: Guenter Roeck 
>> ---
>>   arch/unicore32/include/asm/mmu_context.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/unicore32/include/asm/mmu_context.h
>> b/arch/unicore32/include/asm/mmu_context.h
>> index e35632ef23c7..62dfc644c908 100644
>> --- a/arch/unicore32/include/asm/mmu_context.h
>> +++ b/arch/unicore32/include/asm/mmu_context.h
>> @@ -98,7 +98,7 @@ static inline void arch_bprm_mm_init(struct mm_struct
>> *mm,
>>   }
>>
>>   static inline bool arch_vma_access_permitted(struct vm_area_struct
>> *vma,
>> -bool write, bool foreign)
>> +bool write, bool execute, bool foreign)
>>   {
>>  /* by default, allow everything */
>>  return true;
>>
>



Re: [PATCH] unicore32: mm: Add missing parameter to arch_vma_access_permitted

2016-04-24 Thread Xuetao Guan
> ping ... still not upstream.
I'm sorry.
I'll do it in next week.

Xuetao

>
> On 03/21/2016 04:20 AM, Guenter Roeck wrote:
>> unicore32 fails to compile with the following errors.
>>
>> mm/memory.c: In function ���__handle_mm_fault��:
>> mm/memory.c:3381: error:
>>  too many arguments to function ���arch_vma_access_permitted��
>> mm/gup.c: In function ���check_vma_flags��:
>> mm/gup.c:456: error:
>>  too many arguments to function ���arch_vma_access_permitted��
>> mm/gup.c: In function ���vma_permits_fault��:
>> mm/gup.c:640: error:
>>  too many arguments to function ���arch_vma_access_permitted��
>>
>> Fixes: d61172b4b695b ("mm/core, x86/mm/pkeys: Differentiate instruction
>> fetches")
>> Cc: Dave Hansen 
>> Cc: Thomas Gleixner 
>> Cc: Ingo Molnar 
>> Signed-off-by: Guenter Roeck 
>> ---
>>   arch/unicore32/include/asm/mmu_context.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/unicore32/include/asm/mmu_context.h
>> b/arch/unicore32/include/asm/mmu_context.h
>> index e35632ef23c7..62dfc644c908 100644
>> --- a/arch/unicore32/include/asm/mmu_context.h
>> +++ b/arch/unicore32/include/asm/mmu_context.h
>> @@ -98,7 +98,7 @@ static inline void arch_bprm_mm_init(struct mm_struct
>> *mm,
>>   }
>>
>>   static inline bool arch_vma_access_permitted(struct vm_area_struct
>> *vma,
>> -bool write, bool foreign)
>> +bool write, bool execute, bool foreign)
>>   {
>>  /* by default, allow everything */
>>  return true;
>>
>



Re: [PATCH] unicore32: mm: Add missing parameter to arch_vma_access_permitted

2016-03-23 Thread Xuetao Guan
> On Mon, Mar 21, 2016 at 07:47:29PM +0800, Xuetao Guan wrote:
>> > unicore32 fails to compile with the following errors.
>> >
>> > mm/memory.c: In function ��ユ��_handle_mm_fault��:
>> > mm/memory.c:3381: error:
>> >too many arguments to function
>> ��ユ��rch_vma_access_permitted��
>> > mm/gup.c: In function ��ユ��heck_vma_flags��:
>> > mm/gup.c:456: error:
>> >too many arguments to function
>> ��ユ��rch_vma_access_permitted��
>> > mm/gup.c: In function ��ユΣma_permits_fault��:
>> > mm/gup.c:640: error:
>> >too many arguments to function
>> ��ユ��rch_vma_access_permitted��
>> >
>> > Fixes: d61172b4b695b ("mm/core, x86/mm/pkeys: Differentiate
>> instruction
>> > fetches")
>> > Cc: Dave Hansen <dave.han...@linux.intel.com>
>> > Cc: Thomas Gleixner <t...@linutronix.de>
>> > Cc: Ingo Molnar <mi...@kernel.org>
>> > Signed-off-by: Guenter Roeck <li...@roeck-us.net>
>>
>> Thanks.
>>
>> Acked-by: Guan Xuetao <g...@mprc.pku.edu.cn>
>>
> Who is going to send the patch upstream ?
>
> Guenter

I will do. Thanks.

Xuetao

>
>> > ---
>> >  arch/unicore32/include/asm/mmu_context.h | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/arch/unicore32/include/asm/mmu_context.h
>> > b/arch/unicore32/include/asm/mmu_context.h
>> > index e35632ef23c7..62dfc644c908 100644
>> > --- a/arch/unicore32/include/asm/mmu_context.h
>> > +++ b/arch/unicore32/include/asm/mmu_context.h
>> > @@ -98,7 +98,7 @@ static inline void arch_bprm_mm_init(struct
>> mm_struct
>> > *mm,
>> >  }
>> >
>> >  static inline bool arch_vma_access_permitted(struct vm_area_struct
>> *vma,
>> > -  bool write, bool foreign)
>> > +  bool write, bool execute, bool foreign)
>> >  {
>> >/* by default, allow everything */
>> >return true;
>> > --
>> > 2.5.0
>> >
>>
>



Re: [PATCH] unicore32: mm: Add missing parameter to arch_vma_access_permitted

2016-03-23 Thread Xuetao Guan
> On Mon, Mar 21, 2016 at 07:47:29PM +0800, Xuetao Guan wrote:
>> > unicore32 fails to compile with the following errors.
>> >
>> > mm/memory.c: In function ��ユ��_handle_mm_fault��:
>> > mm/memory.c:3381: error:
>> >too many arguments to function
>> ��ユ��rch_vma_access_permitted��
>> > mm/gup.c: In function ��ユ��heck_vma_flags��:
>> > mm/gup.c:456: error:
>> >too many arguments to function
>> ��ユ��rch_vma_access_permitted��
>> > mm/gup.c: In function ��ユΣma_permits_fault��:
>> > mm/gup.c:640: error:
>> >too many arguments to function
>> ��ユ��rch_vma_access_permitted��
>> >
>> > Fixes: d61172b4b695b ("mm/core, x86/mm/pkeys: Differentiate
>> instruction
>> > fetches")
>> > Cc: Dave Hansen 
>> > Cc: Thomas Gleixner 
>> > Cc: Ingo Molnar 
>> > Signed-off-by: Guenter Roeck 
>>
>> Thanks.
>>
>> Acked-by: Guan Xuetao 
>>
> Who is going to send the patch upstream ?
>
> Guenter

I will do. Thanks.

Xuetao

>
>> > ---
>> >  arch/unicore32/include/asm/mmu_context.h | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/arch/unicore32/include/asm/mmu_context.h
>> > b/arch/unicore32/include/asm/mmu_context.h
>> > index e35632ef23c7..62dfc644c908 100644
>> > --- a/arch/unicore32/include/asm/mmu_context.h
>> > +++ b/arch/unicore32/include/asm/mmu_context.h
>> > @@ -98,7 +98,7 @@ static inline void arch_bprm_mm_init(struct
>> mm_struct
>> > *mm,
>> >  }
>> >
>> >  static inline bool arch_vma_access_permitted(struct vm_area_struct
>> *vma,
>> > -  bool write, bool foreign)
>> > +  bool write, bool execute, bool foreign)
>> >  {
>> >/* by default, allow everything */
>> >return true;
>> > --
>> > 2.5.0
>> >
>>
>



Re: [PATCH] unicore32: mm: Add missing parameter to arch_vma_access_permitted

2016-03-21 Thread Xuetao Guan
> unicore32 fails to compile with the following errors.
>
> mm/memory.c: In function ���__handle_mm_fault��:
> mm/memory.c:3381: error:
>   too many arguments to function ���arch_vma_access_permitted��
> mm/gup.c: In function ���check_vma_flags��:
> mm/gup.c:456: error:
>   too many arguments to function ���arch_vma_access_permitted��
> mm/gup.c: In function ���vma_permits_fault��:
> mm/gup.c:640: error:
>   too many arguments to function ���arch_vma_access_permitted��
>
> Fixes: d61172b4b695b ("mm/core, x86/mm/pkeys: Differentiate instruction
> fetches")
> Cc: Dave Hansen 
> Cc: Thomas Gleixner 
> Cc: Ingo Molnar 
> Signed-off-by: Guenter Roeck 

Thanks.

Acked-by: Guan Xuetao 

> ---
>  arch/unicore32/include/asm/mmu_context.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/unicore32/include/asm/mmu_context.h
> b/arch/unicore32/include/asm/mmu_context.h
> index e35632ef23c7..62dfc644c908 100644
> --- a/arch/unicore32/include/asm/mmu_context.h
> +++ b/arch/unicore32/include/asm/mmu_context.h
> @@ -98,7 +98,7 @@ static inline void arch_bprm_mm_init(struct mm_struct
> *mm,
>  }
>
>  static inline bool arch_vma_access_permitted(struct vm_area_struct *vma,
> - bool write, bool foreign)
> + bool write, bool execute, bool foreign)
>  {
>   /* by default, allow everything */
>   return true;
> --
> 2.5.0
>



Re: [PATCH] unicore32: mm: Add missing parameter to arch_vma_access_permitted

2016-03-21 Thread Xuetao Guan
> unicore32 fails to compile with the following errors.
>
> mm/memory.c: In function ���__handle_mm_fault��:
> mm/memory.c:3381: error:
>   too many arguments to function ���arch_vma_access_permitted��
> mm/gup.c: In function ���check_vma_flags��:
> mm/gup.c:456: error:
>   too many arguments to function ���arch_vma_access_permitted��
> mm/gup.c: In function ���vma_permits_fault��:
> mm/gup.c:640: error:
>   too many arguments to function ���arch_vma_access_permitted��
>
> Fixes: d61172b4b695b ("mm/core, x86/mm/pkeys: Differentiate instruction
> fetches")
> Cc: Dave Hansen 
> Cc: Thomas Gleixner 
> Cc: Ingo Molnar 
> Signed-off-by: Guenter Roeck 

Thanks.

Acked-by: Guan Xuetao 

> ---
>  arch/unicore32/include/asm/mmu_context.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/unicore32/include/asm/mmu_context.h
> b/arch/unicore32/include/asm/mmu_context.h
> index e35632ef23c7..62dfc644c908 100644
> --- a/arch/unicore32/include/asm/mmu_context.h
> +++ b/arch/unicore32/include/asm/mmu_context.h
> @@ -98,7 +98,7 @@ static inline void arch_bprm_mm_init(struct mm_struct
> *mm,
>  }
>
>  static inline bool arch_vma_access_permitted(struct vm_area_struct *vma,
> - bool write, bool foreign)
> + bool write, bool execute, bool foreign)
>  {
>   /* by default, allow everything */
>   return true;
> --
> 2.5.0
>



回复: Re: [PATCH] unicore32: Remove unneeded Kconfig entry NO_IOPORT_MAP

2014-10-01 Thread Xuetao Guan

- Paul Bolle  写道:
> On Sun, 2014-09-28 at 09:49 +0800, Xuetao Guan wrote:
> > Sorry for late reply.
> 
> You replied within four days. That's rather quick, actually.
> 
> > I checked this config, and it's only used for HAS_IOPORT_MAP in lib/Kconfig
> > Sure, removing it means no different for .config file.
> > I think a better way is reserving it
> 
> I'm not sure I get what you're saying here: what do mean with "reserving
> it"?

I mean, it's better to keep the code unchanged.

> 
> > or moving it into arch/Kconfig
> 
> Without a (treewide) patch I find it hard to say whether that's worth
> the trouble. But even if that move would be done, wouldn't it include
> dropping this entry from arch/unicore32 anyway?

IMHO, this config could be removed from kernel code.

> 
> 
> Paul Bolle
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Re: [PATCH] unicore32: Remove unneeded Kconfig entry NO_IOPORT_MAP

2014-10-01 Thread Xuetao Guan

- Paul Bolle pebo...@tiscali.nl 写道:
 On Sun, 2014-09-28 at 09:49 +0800, Xuetao Guan wrote:
  Sorry for late reply.
 
 You replied within four days. That's rather quick, actually.
 
  I checked this config, and it's only used for HAS_IOPORT_MAP in lib/Kconfig
  Sure, removing it means no different for .config file.
  I think a better way is reserving it
 
 I'm not sure I get what you're saying here: what do mean with reserving
 it?

I mean, it's better to keep the code unchanged.

 
  or moving it into arch/Kconfig
 
 Without a (treewide) patch I find it hard to say whether that's worth
 the trouble. But even if that move would be done, wouldn't it include
 dropping this entry from arch/unicore32 anyway?

IMHO, this config could be removed from kernel code.

 
 
 Paul Bolle
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] unicore32: Remove unneeded Kconfig entry NO_IOPORT_MAP

2014-09-27 Thread Xuetao Guan
Sorry for late reply.

I checked this config, and it's only used for HAS_IOPORT_MAP in lib/Kconfig
Sure, removing it means no different for .config file.
I think a better way is reserving it or moving it into arch/Kconfig

Cc: linux-a...@vger.kernel.org

Xuetao Guan

- Paul Bolle  写道:
> Architectures only need a Kconfig entry for NO_IOPORT_MAP if it is
> possible that its value will be 'y'. For unicore32 its value will always
> be 'n', making it pointless. Remove it.
> 
> Signed-off-by: Paul Bolle 
> ---
> Tested by playing with arch/unicore32/configs/unicore32_defconfig. This
> patch made no difference whatsoever to the generated .config file.
> Please note that it has
> CONFIG_HAS_IOPORT_MAP=y
> 
> set after invoking "make oldconfig" both before and after this patch.
> 
>  arch/unicore32/Kconfig | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
> index 928237a7b9ca..2322cc87e7cb 100644
> --- a/arch/unicore32/Kconfig
> +++ b/arch/unicore32/Kconfig
> @@ -27,9 +27,6 @@ config UNICORE32
>  config GENERIC_CSUM
>   def_bool y
>  
> -config NO_IOPORT_MAP
> - bool
> -
>  config STACKTRACE_SUPPORT
>   def_bool y
>  
> -- 
> 1.9.3
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] unicore32: Remove unneeded Kconfig entry NO_IOPORT_MAP

2014-09-27 Thread Xuetao Guan
Sorry for late reply.

I checked this config, and it's only used for HAS_IOPORT_MAP in lib/Kconfig
Sure, removing it means no different for .config file.
I think a better way is reserving it or moving it into arch/Kconfig

Cc: linux-a...@vger.kernel.org

Xuetao Guan

- Paul Bolle pebo...@tiscali.nl 写道:
 Architectures only need a Kconfig entry for NO_IOPORT_MAP if it is
 possible that its value will be 'y'. For unicore32 its value will always
 be 'n', making it pointless. Remove it.
 
 Signed-off-by: Paul Bolle pebo...@tiscali.nl
 ---
 Tested by playing with arch/unicore32/configs/unicore32_defconfig. This
 patch made no difference whatsoever to the generated .config file.
 Please note that it has
 CONFIG_HAS_IOPORT_MAP=y
 
 set after invoking make oldconfig both before and after this patch.
 
  arch/unicore32/Kconfig | 3 ---
  1 file changed, 3 deletions(-)
 
 diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
 index 928237a7b9ca..2322cc87e7cb 100644
 --- a/arch/unicore32/Kconfig
 +++ b/arch/unicore32/Kconfig
 @@ -27,9 +27,6 @@ config UNICORE32
  config GENERIC_CSUM
   def_bool y
  
 -config NO_IOPORT_MAP
 - bool
 -
  config STACKTRACE_SUPPORT
   def_bool y
  
 -- 
 1.9.3
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Re: 回复: Re: 回复: Re: 回复: Re: 回复: Re: 回复: Status of 'unicore32' architecture in Linux kernel

2014-09-08 Thread Xuetao Guan

- Guenter Roeck  写道:
> On 09/08/2014 05:57 AM, Xuetao Guan  wrote:
> 
> Whatever is more recent. Guess you'll have to either update the toolchain
> or the kernel. If the plan is to update the kernel, can you send me a patch
> to do that so I can test it ?
> 
> Thanks,
> Guenter
> 
I'll update unicore kernel at first, and cc patches to you.

Thanks.
Xuetao
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Re: 回复: Re: 回复: Re: 回复: Re: 回复: Status of 'unicore32' architecture in Linux kernel

2014-09-08 Thread Xuetao Guan

- Guenter Roeck  写道:
> On 09/04/2014 11:13 PM, Xuetao Guan  wrote:
> Hi,
> 
> I made everything I have available at 
> http://server.roeck-us.net/qemu/unicore32/.
> I tried multiple variants for creating the root file system, including the one
> on https://github.com/gxt/UniCore32.git and the one using mkrootfs.sh in
> the link above. No difference - I always see the same crash. Note that the
> 'init' program is loading, but crashes with above error (0x000b is SIGSEGV
> unless I am missing something).
> 
> Note that I used the latest qemu for unicore from upstream sources; I was 
> unable
> to compile it from g...@github.com:gxt/QEMU.git. Qemu configuration did not 
> seem
> to make a difference. The toolchain was extracted from uc4-1.0.5-hard.tgz.
> 
> Hope this helps,
> Guenter
> 
I guess you used the newest kernel to run busybox.
However, as for unicore32, the newest kernel uses different ABI with uc4-1.0.5 
toolchain.
I'm sorry to make it so confusing.
I'll update and submit another-ABI patches asap.

Thanks,
Xutao



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Re: 回复: Re: 回复: Re: 回复: Re: 回复: Status of 'unicore32' architecture in Linux kernel

2014-09-08 Thread Xuetao Guan

- Guenter Roeck li...@roeck-us.net 写道:
 On 09/04/2014 11:13 PM, Xuetao Guan  wrote:
 Hi,
 
 I made everything I have available at 
 http://server.roeck-us.net/qemu/unicore32/.
 I tried multiple variants for creating the root file system, including the one
 on https://github.com/gxt/UniCore32.git and the one using mkrootfs.sh in
 the link above. No difference - I always see the same crash. Note that the
 'init' program is loading, but crashes with above error (0x000b is SIGSEGV
 unless I am missing something).
 
 Note that I used the latest qemu for unicore from upstream sources; I was 
 unable
 to compile it from g...@github.com:gxt/QEMU.git. Qemu configuration did not 
 seem
 to make a difference. The toolchain was extracted from uc4-1.0.5-hard.tgz.
 
 Hope this helps,
 Guenter
 
I guess you used the newest kernel to run busybox.
However, as for unicore32, the newest kernel uses different ABI with uc4-1.0.5 
toolchain.
I'm sorry to make it so confusing.
I'll update and submit another-ABI patches asap.

Thanks,
Xutao



--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Re: 回复: Re: 回复: Re: 回复: Re: 回复: Re: 回复: Status of 'unicore32' architecture in Linux kernel

2014-09-08 Thread Xuetao Guan

- Guenter Roeck li...@roeck-us.net 写道:
 On 09/08/2014 05:57 AM, Xuetao Guan  wrote:
 
 Whatever is more recent. Guess you'll have to either update the toolchain
 or the kernel. If the plan is to update the kernel, can you send me a patch
 to do that so I can test it ?
 
 Thanks,
 Guenter
 
I'll update unicore kernel at first, and cc patches to you.

Thanks.
Xuetao
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Re: 回复: Re: 回复: Re: 回复: Status of 'unicore32' architecture in Linux kernel

2014-09-05 Thread Xuetao Guan

- Guenter Roeck  写道:
> On 09/03/2014 01:32 AM, Xuetao Guan  wrote:
> >
> [ ... ]
> 
> >> Please try the following patch. That seems to do it.
> >> I am sure it can be improved, but it is a start.
> >>
> >> Thanks,
> >> Guenter
> >
> > Thanks. I'll test it.
> > BTW, Qemu codestyle is different, and tab should be replaced with blanks.
> >
> 
> Here is where I am. User space code (busybox) was compiled
> using the unicore toolchain available on the web.
> 
> ...
> serio: i8042 KBD port at 0x6eb00060,0x6eb00064 irq 22
> mousedev: PS/2 mouse device common for all mice
> Enable UniCore-F64 support.
> Warning: unable to open an initial console.
> Freeing unused kernel memory: 1156K (c0408000 - c0529000)
> 
> Kernel panic - not syncing: Attempted to kill init! exitcode=0x000b
> 
> ---[ end Kernel panic - not syncing: Attempted to kill init! 
> exitcode=0x000b
> 
> The kernel tries to execute the init program, which fails with SIGSEGV.
> I confirmed that the init program is loaded and starts to execute.
> 
> Any idea what might cause such a problem ?
> 
> Thanks,
> Guenter
> 
'slink /init /bin/busybox 777 0 0' should be inserted in initramfs 
config
Also, I recommend compile busybox statically for initramfs.

I need more information, including full kmsg and initramfs configs

My qemu commands as following. Maybe useful.

qemu-new:
@test -d $(DIR_WORKING)/qemu-unicore32 ||   \
mkdir -p $(DIR_WORKING)/qemu-unicore32
@echo "Remove old qemu repo ..."
@rm -fr $(DIR_WORKING)/qemu
@cd $(DIR_WORKING); git clone $(QEMU_GITREPO)
@cd $(DIR_WORKING)/qemu;\
git br unicore32 origin/unicore32;  \
git co unicore32

qemu-make:
@echo "Configure qemu ..."
@cd $(DIR_WORKING)/qemu; ./configure\
--enable-trace-backend=stderr   \
--target-list=$(QEMU_TARGETS)   \
--enable-debug  \
--disable-sdl   \
--interp-prefix=$(DIR_GNU_UC)   \
--prefix=$(DIR_WORKING)/qemu-unicore32  \
>> $(QEMU_BUILDLOG) 2>&1
@echo "Make qemu and make install ..."
@make -C $(DIR_WORKING)/qemu -j4 >> $(QEMU_BUILDLOG) 2>&1
@make -C $(DIR_WORKING)/qemu install >> $(QEMU_BUILDLOG) 2>&1

qemu-run:
@echo "Remove old log file"
@rm -fr $(QEMU_TRACELOG)
@echo "Running QEMU in this tty ..."
@$(DIR_WORKING)/qemu-unicore32/bin/qemu-system-unicore32\
-curses \
-M puv3 \
-m 512  \
-icount 0   \
-kernel $(DIR_WORKING)/zImage   \
-net nic\
-net tap,ifname=tap_$(USER),script=no,downscript=no \
-append "root=/dev/nfs 
nfsroot=192.168.200.161:/export/guestroot/,tcp rw ip=192.168.122.4"\
2> $(QEMU_TRACELOG)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Re: 回复: Re: 回复: Re: 回复: Status of 'unicore32' architecture in Linux kernel

2014-09-05 Thread Xuetao Guan

- Guenter Roeck li...@roeck-us.net 写道:
 On 09/03/2014 01:32 AM, Xuetao Guan  wrote:
 
 [ ... ]
 
  Please try the following patch. That seems to do it.
  I am sure it can be improved, but it is a start.
 
  Thanks,
  Guenter
 
  Thanks. I'll test it.
  BTW, Qemu codestyle is different, and tab should be replaced with blanks.
 
 
 Here is where I am. User space code (busybox) was compiled
 using the unicore toolchain available on the web.
 
 ...
 serio: i8042 KBD port at 0x6eb00060,0x6eb00064 irq 22
 mousedev: PS/2 mouse device common for all mice
 Enable UniCore-F64 support.
 Warning: unable to open an initial console.
 Freeing unused kernel memory: 1156K (c0408000 - c0529000)
 
 Kernel panic - not syncing: Attempted to kill init! exitcode=0x000b
 
 ---[ end Kernel panic - not syncing: Attempted to kill init! 
 exitcode=0x000b
 
 The kernel tries to execute the init program, which fails with SIGSEGV.
 I confirmed that the init program is loaded and starts to execute.
 
 Any idea what might cause such a problem ?
 
 Thanks,
 Guenter
 
'slink /init /bin/busybox 777 0 0' should be inserted in initramfs 
config
Also, I recommend compile busybox statically for initramfs.

I need more information, including full kmsg and initramfs configs

My qemu commands as following. Maybe useful.

qemu-new:
@test -d $(DIR_WORKING)/qemu-unicore32 ||   \
mkdir -p $(DIR_WORKING)/qemu-unicore32
@echo Remove old qemu repo ...
@rm -fr $(DIR_WORKING)/qemu
@cd $(DIR_WORKING); git clone $(QEMU_GITREPO)
@cd $(DIR_WORKING)/qemu;\
git br unicore32 origin/unicore32;  \
git co unicore32

qemu-make:
@echo Configure qemu ...
@cd $(DIR_WORKING)/qemu; ./configure\
--enable-trace-backend=stderr   \
--target-list=$(QEMU_TARGETS)   \
--enable-debug  \
--disable-sdl   \
--interp-prefix=$(DIR_GNU_UC)   \
--prefix=$(DIR_WORKING)/qemu-unicore32  \
 $(QEMU_BUILDLOG) 21
@echo Make qemu and make install ...
@make -C $(DIR_WORKING)/qemu -j4  $(QEMU_BUILDLOG) 21
@make -C $(DIR_WORKING)/qemu install  $(QEMU_BUILDLOG) 21

qemu-run:
@echo Remove old log file
@rm -fr $(QEMU_TRACELOG)
@echo Running QEMU in this tty ...
@$(DIR_WORKING)/qemu-unicore32/bin/qemu-system-unicore32\
-curses \
-M puv3 \
-m 512  \
-icount 0   \
-kernel $(DIR_WORKING)/zImage   \
-net nic\
-net tap,ifname=tap_$(USER),script=no,downscript=no \
-append root=/dev/nfs 
nfsroot=192.168.200.161:/export/guestroot/,tcp rw ip=192.168.122.4\
2 $(QEMU_TRACELOG)

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Re: 回复: Re: 回复: Status of 'unicore32' architecture in Linux kernel

2014-09-03 Thread Xuetao Guan

- Guenter Roeck  写道:
> On Wed, Sep 03, 2014 at 08:09:28AM +0800, Xuetao Guan  wrote:
> > 
> > [...]
> > > > 
> > > > > 
> > > > > unicore32: Add ocd console and qemu-defconfig to support qemu 
> > > > > simulator
> > > > >   This patch adds a primitive OCD console to communicate with 
> > > > > qemu.
> > > > >   The same code is already used for early console support.
> > > > 
> > > > Do you mean there's the same/similar code in QEMU.
> > > > 
> > > No, I mean that the ocd functions in the linux kernel (such as ocd_putc) 
> > > are
> > > used by both earlyprintk and the ocd console code.
> > Yes. By the way, it's only for qemu and fpga debug.
> > 
> > > 
> > > > > 
> > > > > With this patch added, and with qemu_defconfig as provided by the 
> > > > > same patch,
> > > > > it is possible to build and load a unicore32 image in qemu using the 
> > > > > following
> > > > > qemu command line.
> > > > > 
> > > > > qemu-system-unicore32 -curses -M puv3 -m 512 -kernel 
> > > > > arch/unicore32/boot/zImage
> > > > > 
> > > > > Caveats:
> > > > > - The use of -nographic instead of -curses causes a qemu crash
> > > > Yes, since qemu curses code was modified to meet the simple OCD console 
> > > > requirement.
> > > > 
> > > The lack of support for -nographic is a problem for scripted testing.
> > > The issue is that we have to interpret console output for scripted 
> > > testing,
> > > and having to go through curses makes that a bit difficult.
> > > 
> > > Wonder if '-nographic' can be modeled as '-curses' with no available 
> > > terminal
> > > configuration. At least in theory that should work, but executing the 
> > > above
> > > command with TERM=dumb yields no output. Wonder how difficult it would be 
> > > to
> > > change that.
> > 
> > I see. I'll try to make -nographic work anyway.
> > 
> Please try the following patch. That seems to do it.
> I am sure it can be improved, but it is a start.
> 
> Thanks,
> Guenter

Thanks. I'll test it.
BTW, Qemu codestyle is different, and tab should be replaced with blanks.

Xuetao

> 
> ---
> From a7c89177b3c00e4c16bea25a0b4b2f9dc511e07b Mon Sep 17 00:00:00 2001
> From: Guenter Roeck 
> Date: Tue, 2 Sep 2014 20:55:02 -0700
> Subject: [PATCH] qemu: unicore32: Add support for non-curses display
> 
> Add basic support for DT_NONE and DT_NOGRAPHIC display types.
> 
> Signed-off-by: Guenter Roeck 
> ---
>  target-unicore32/helper.c | 14 +-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/target-unicore32/helper.c b/target-unicore32/helper.c
> index e5ebbf4..dda3772 100644
> --- a/target-unicore32/helper.c
> +++ b/target-unicore32/helper.c
> @@ -13,6 +13,7 @@
>  #include "exec/gdbstub.h"
>  #include "exec/helper-proto.h"
>  #include "qemu/host-utils.h"
> +#include "sysemu/sysemu.h"
>  #ifndef CONFIG_USER_ONLY
>  #include "ui/console.h"
>  #endif
> @@ -223,7 +224,18 @@ static void putc_on_screen(unsigned char ch)
>  
>  void helper_cp1_putc(target_ulong x)
>  {
> -putc_on_screen((unsigned char)x);   /* Output to screen */
> +switch(display_type) {
> +case DT_CURSES:
> + putc_on_screen((unsigned char)x);   /* Output to screen */
> + break;
> +case DT_NOGRAPHIC:
> +case DT_NONE:
> + putchar((int)x);
> + break;
> +default:
> + break;
> +}
> +
>  DPRINTF("%c", x);   /* Output to stdout */
>  }
>  #endif
> -- 
> 1.9.1
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Re: 回复: Re: 回复: Status of 'unicore32' architecture in Linux kernel

2014-09-03 Thread Xuetao Guan

- Guenter Roeck li...@roeck-us.net 写道:
 On Wed, Sep 03, 2014 at 08:09:28AM +0800, Xuetao Guan  wrote:
  
  [...]

 
 unicore32: Add ocd console and qemu-defconfig to support qemu 
 simulator
   This patch adds a primitive OCD console to communicate with 
 qemu.
   The same code is already used for early console support.

Do you mean there's the same/similar code in QEMU.

   No, I mean that the ocd functions in the linux kernel (such as ocd_putc) 
   are
   used by both earlyprintk and the ocd console code.
  Yes. By the way, it's only for qemu and fpga debug.
  
   
 
 With this patch added, and with qemu_defconfig as provided by the 
 same patch,
 it is possible to build and load a unicore32 image in qemu using the 
 following
 qemu command line.
 
 qemu-system-unicore32 -curses -M puv3 -m 512 -kernel 
 arch/unicore32/boot/zImage
 
 Caveats:
 - The use of -nographic instead of -curses causes a qemu crash
Yes, since qemu curses code was modified to meet the simple OCD console 
requirement.

   The lack of support for -nographic is a problem for scripted testing.
   The issue is that we have to interpret console output for scripted 
   testing,
   and having to go through curses makes that a bit difficult.
   
   Wonder if '-nographic' can be modeled as '-curses' with no available 
   terminal
   configuration. At least in theory that should work, but executing the 
   above
   command with TERM=dumb yields no output. Wonder how difficult it would be 
   to
   change that.
  
  I see. I'll try to make -nographic work anyway.
  
 Please try the following patch. That seems to do it.
 I am sure it can be improved, but it is a start.
 
 Thanks,
 Guenter

Thanks. I'll test it.
BTW, Qemu codestyle is different, and tab should be replaced with blanks.

Xuetao

 
 ---
 From a7c89177b3c00e4c16bea25a0b4b2f9dc511e07b Mon Sep 17 00:00:00 2001
 From: Guenter Roeck li...@roeck-us.net
 Date: Tue, 2 Sep 2014 20:55:02 -0700
 Subject: [PATCH] qemu: unicore32: Add support for non-curses display
 
 Add basic support for DT_NONE and DT_NOGRAPHIC display types.
 
 Signed-off-by: Guenter Roeck li...@roeck-us.net
 ---
  target-unicore32/helper.c | 14 +-
  1 file changed, 13 insertions(+), 1 deletion(-)
 
 diff --git a/target-unicore32/helper.c b/target-unicore32/helper.c
 index e5ebbf4..dda3772 100644
 --- a/target-unicore32/helper.c
 +++ b/target-unicore32/helper.c
 @@ -13,6 +13,7 @@
  #include exec/gdbstub.h
  #include exec/helper-proto.h
  #include qemu/host-utils.h
 +#include sysemu/sysemu.h
  #ifndef CONFIG_USER_ONLY
  #include ui/console.h
  #endif
 @@ -223,7 +224,18 @@ static void putc_on_screen(unsigned char ch)
  
  void helper_cp1_putc(target_ulong x)
  {
 -putc_on_screen((unsigned char)x);   /* Output to screen */
 +switch(display_type) {
 +case DT_CURSES:
 + putc_on_screen((unsigned char)x);   /* Output to screen */
 + break;
 +case DT_NOGRAPHIC:
 +case DT_NONE:
 + putchar((int)x);
 + break;
 +default:
 + break;
 +}
 +
  DPRINTF(%c, x);   /* Output to stdout */
  }
  #endif
 -- 
 1.9.1
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Re: 回复: Status of 'unicore32' architecture in Linux kernel

2014-09-02 Thread Xuetao Guan

[...]
> > 
> > > 
> > > unicore32: Add ocd console and qemu-defconfig to support qemu simulator
> > >   This patch adds a primitive OCD console to communicate with qemu.
> > >   The same code is already used for early console support.
> > 
> > Do you mean there's the same/similar code in QEMU.
> > 
> No, I mean that the ocd functions in the linux kernel (such as ocd_putc) are
> used by both earlyprintk and the ocd console code.
Yes. By the way, it's only for qemu and fpga debug.

> 
> > > 
> > > With this patch added, and with qemu_defconfig as provided by the same 
> > > patch,
> > > it is possible to build and load a unicore32 image in qemu using the 
> > > following
> > > qemu command line.
> > > 
> > > qemu-system-unicore32 -curses -M puv3 -m 512 -kernel 
> > > arch/unicore32/boot/zImage
> > > 
> > > Caveats:
> > > - The use of -nographic instead of -curses causes a qemu crash
> > Yes, since qemu curses code was modified to meet the simple OCD console 
> > requirement.
> > 
> The lack of support for -nographic is a problem for scripted testing.
> The issue is that we have to interpret console output for scripted testing,
> and having to go through curses makes that a bit difficult.
> 
> Wonder if '-nographic' can be modeled as '-curses' with no available terminal
> configuration. At least in theory that should work, but executing the above
> command with TERM=dumb yields no output. Wonder how difficult it would be to
> change that.

I see. I'll try to make -nographic work anyway.

> 
> > > - The qemu emulation only accepts a built-in initramfs.
> > Yes, github version only support built-in initramfs.
> > NFS+LFS could be also supported, and puv3-pci sim should be added at first.
> > 
> > > - The only working image is arch/unicore32/boot/zImage.
> > >   All other variants, arch/unicore32/boot/Image and vmlinux, cause a 
> > > crash.
> > >   The same (or a similar) crash is also seen if I don't provide a built-in
> > >   kernel command line and try to load zImage.
> > Sorry for that. That should be fixed.
> > 
> > > - There is no networking. There is another patch in the github linux
> > >   respository [4] which is not available upstream. The driver was 
> > > submitted
> > >   for integration back in 2011 [5] but it was never accepted or merged.
> > Yes, exactly.
> 
> Too bad. Not exactly necessary for our current scope of testing, but it would 
> be
> nice to be able to test networking.
I'll review and submit networking code again. Or, maybe pci-nic function, to 
support qemu as well. 

> 
> > Thanks Guenter.
> > 
> You are welcome. Thanks for the feedback.
> 
> Guenter

Thanks.

Xuetao
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RESEND] unicore32: Fix build error

2014-09-02 Thread Xuetao Guan
Signed-off-by: Guan Xuetao 

- Guenter Roeck  写道:
> unicore32 builds fail with
> 
> arch/unicore32/kernel/signal.c: In function ‘setup_frame’:
> arch/unicore32/kernel/signal.c:257: error:
>   ‘usig’ undeclared (first use in this function)
> arch/unicore32/kernel/signal.c:279: error:
>   ‘usig’ undeclared (first use in this function)
> arch/unicore32/kernel/signal.c: In function ‘handle_signal’:
> arch/unicore32/kernel/signal.c:306: warning: unused variable ‘tsk’
> arch/unicore32/kernel/signal.c: In function ‘do_signal’:
> arch/unicore32/kernel/signal.c:376: error:
>   implicit declaration of function ‘get_signsl’
> make[1]: *** [arch/unicore32/kernel/signal.o] Error 1
> make: *** [arch/unicore32/kernel/signal.o] Error 2
> 
> Bisect points to commit 649671c90eaf ("unicore32: Use get_signal()
> signal_setup_done()").
> 
> This code never even compiled. Reverting the patch does not work,
> since previously used functions no longer exist, so try to fix it up.
> Compile tested only.
> 
> Fixes: 649671c90eaf ("unicore32: Use get_signal() signal_setup_done()")
> Cc: Richard Weinberger 
> Signed-off-by: Guenter Roeck 
> ---
> Resending after rebase to current upstream kernel.
> 
> Linus, please consider adding this patch directly to your tree.
> This is the one remaining build failure regression in the upstream kernel.
> 
>  arch/unicore32/kernel/signal.c | 9 +
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/unicore32/kernel/signal.c b/arch/unicore32/kernel/signal.c
> index 780d773..7c8fb70 100644
> --- a/arch/unicore32/kernel/signal.c
> +++ b/arch/unicore32/kernel/signal.c
> @@ -254,7 +254,8 @@ static int setup_frame(struct ksignal *ksig, sigset_t 
> *set,
>  
>   err |= setup_sigframe(frame, regs, set);
>   if (err == 0)
> - err |= setup_return(regs, >ka, frame->retcode, frame, 
> usig);
> + err |= setup_return(regs, >ka, frame->retcode, frame,
> + ksig->sig);
>  
>   return err;
>  }
> @@ -276,7 +277,8 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t 
> *set,
>   err |= __save_altstack(>sig.uc.uc_stack, regs->UCreg_sp);
>   err |= setup_sigframe(>sig, regs, set);
>   if (err == 0)
> - err |= setup_return(regs, >ka, frame->sig.retcode, frame, 
> usig);
> + err |= setup_return(regs, >ka, frame->sig.retcode, frame,
> + ksig->sig);
>  
>   if (err == 0) {
>   /*
> @@ -303,7 +305,6 @@ static void handle_signal(struct ksignal *ksig, struct 
> pt_regs *regs,
> int syscall)
>  {
>   struct thread_info *thread = current_thread_info();
> - struct task_struct *tsk = current;
>   sigset_t *oldset = sigmask_to_save();
>   int usig = ksig->sig;
>   int ret;
> @@ -373,7 +374,7 @@ static void do_signal(struct pt_regs *regs, int syscall)
>   if (!user_mode(regs))
>   return;
>  
> - if (get_signsl()) {
> + if (get_signal()) {
>   handle_signal(, regs, syscall);
>   return;
>   }
> -- 
> 1.9.1
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Status of 'unicore32' architecture in Linux kernel

2014-09-02 Thread Xuetao Guan
Sorry for late reply.

- Guenter Roeck  写道:
> Status of 'unicore32' architecture in Linux kernel
> --
> 
> The idea was to create a working kernel and initramfs for the ongoing Linux
> kernel test project. This summary describes the result of this effort.
> 
> Overall, conclusion is that the architecture would need some work
> (both in qemu and the kernel itself) to make it testable with qemu.

Great. And there's a lot of work to do for unicore32.

> 
> Guenter
> 
> -
> Toolchain used was from [1]. I did not attempt to build my own toolchain.
> 
> Configuration:
> 
> make ARCH=unicore32 defconfig && make ARCH=unicore32
> 
> This configuration currently fails to build in the upstream kernel.
> A patch to fix the problem has been submitted and is pending upstream
> integration [2]. With this patch merged, the 'defconfig' image can
> be built.

Thanks. I'll apply it in my repo.

> 
> 
> qemu
> 
> Attempts to load the unicore32:defconfig image with qemu failed.
> 
> Research points to [3], which includes a working unicore32 linux kernel
> in its linux repository [4], in branch unicore32-working. This branch
> includes a working unicore32 qemu configuration. It also includes
> a critical patch which is not available in the upstream kernel.

Yes. And these patches need to be reviewed and reconsidered.
I'll try to do that in this month.

> 
> unicore32: Add ocd console and qemu-defconfig to support qemu simulator
>   This patch adds a primitive OCD console to communicate with qemu.
>   The same code is already used for early console support.

Do you mean there's the same/similar code in QEMU.

> 
> With this patch added, and with qemu_defconfig as provided by the same patch,
> it is possible to build and load a unicore32 image in qemu using the following
> qemu command line.
> 
> qemu-system-unicore32 -curses -M puv3 -m 512 -kernel 
> arch/unicore32/boot/zImage
> 
> Caveats:
> - The use of -nographic instead of -curses causes a qemu crash
Yes, since qemu curses code was modified to meet the simple OCD console 
requirement.

> - The qemu emulation only accepts a built-in initramfs.
Yes, github version only support built-in initramfs.
NFS+LFS could be also supported, and puv3-pci sim should be added at first.

> - The only working image is arch/unicore32/boot/zImage.
>   All other variants, arch/unicore32/boot/Image and vmlinux, cause a crash.
>   The same (or a similar) crash is also seen if I don't provide a built-in
>   kernel command line and try to load zImage.
Sorry for that. That should be fixed.

> - There is no networking. There is another patch in the github linux
>   respository [4] which is not available upstream. The driver was submitted
>   for integration back in 2011 [5] but it was never accepted or merged.
Yes, exactly.
Thanks Guenter.

> 
> 
> [1] http://mprc.pku.edu.cn/~guanxuetao/linux/
> [2] https://lkml.org/lkml/2014/8/31/86
> [3] https://github.com/gxt
> [4] git://github.com/gxt/linux.git
> [5] https://lkml.org/lkml/2011/5/27/17

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Status of 'unicore32' architecture in Linux kernel

2014-09-02 Thread Xuetao Guan
Sorry for late reply.

- Guenter Roeck li...@roeck-us.net 写道:
 Status of 'unicore32' architecture in Linux kernel
 --
 
 The idea was to create a working kernel and initramfs for the ongoing Linux
 kernel test project. This summary describes the result of this effort.
 
 Overall, conclusion is that the architecture would need some work
 (both in qemu and the kernel itself) to make it testable with qemu.

Great. And there's a lot of work to do for unicore32.

 
 Guenter
 
 -
 Toolchain used was from [1]. I did not attempt to build my own toolchain.
 
 Configuration:
 
 make ARCH=unicore32 defconfig  make ARCH=unicore32
 
 This configuration currently fails to build in the upstream kernel.
 A patch to fix the problem has been submitted and is pending upstream
 integration [2]. With this patch merged, the 'defconfig' image can
 be built.

Thanks. I'll apply it in my repo.

 
 
 qemu
 
 Attempts to load the unicore32:defconfig image with qemu failed.
 
 Research points to [3], which includes a working unicore32 linux kernel
 in its linux repository [4], in branch unicore32-working. This branch
 includes a working unicore32 qemu configuration. It also includes
 a critical patch which is not available in the upstream kernel.

Yes. And these patches need to be reviewed and reconsidered.
I'll try to do that in this month.

 
 unicore32: Add ocd console and qemu-defconfig to support qemu simulator
   This patch adds a primitive OCD console to communicate with qemu.
   The same code is already used for early console support.

Do you mean there's the same/similar code in QEMU.

 
 With this patch added, and with qemu_defconfig as provided by the same patch,
 it is possible to build and load a unicore32 image in qemu using the following
 qemu command line.
 
 qemu-system-unicore32 -curses -M puv3 -m 512 -kernel 
 arch/unicore32/boot/zImage
 
 Caveats:
 - The use of -nographic instead of -curses causes a qemu crash
Yes, since qemu curses code was modified to meet the simple OCD console 
requirement.

 - The qemu emulation only accepts a built-in initramfs.
Yes, github version only support built-in initramfs.
NFS+LFS could be also supported, and puv3-pci sim should be added at first.

 - The only working image is arch/unicore32/boot/zImage.
   All other variants, arch/unicore32/boot/Image and vmlinux, cause a crash.
   The same (or a similar) crash is also seen if I don't provide a built-in
   kernel command line and try to load zImage.
Sorry for that. That should be fixed.

 - There is no networking. There is another patch in the github linux
   respository [4] which is not available upstream. The driver was submitted
   for integration back in 2011 [5] but it was never accepted or merged.
Yes, exactly.
Thanks Guenter.

 
 
 [1] http://mprc.pku.edu.cn/~guanxuetao/linux/
 [2] https://lkml.org/lkml/2014/8/31/86
 [3] https://github.com/gxt
 [4] git://github.com/gxt/linux.git
 [5] https://lkml.org/lkml/2011/5/27/17

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RESEND] unicore32: Fix build error

2014-09-02 Thread Xuetao Guan
Signed-off-by: Guan Xuetao g...@mprc.pku.edu.cn

- Guenter Roeck li...@roeck-us.net 写道:
 unicore32 builds fail with
 
 arch/unicore32/kernel/signal.c: In function ‘setup_frame’:
 arch/unicore32/kernel/signal.c:257: error:
   ‘usig’ undeclared (first use in this function)
 arch/unicore32/kernel/signal.c:279: error:
   ‘usig’ undeclared (first use in this function)
 arch/unicore32/kernel/signal.c: In function ‘handle_signal’:
 arch/unicore32/kernel/signal.c:306: warning: unused variable ‘tsk’
 arch/unicore32/kernel/signal.c: In function ‘do_signal’:
 arch/unicore32/kernel/signal.c:376: error:
   implicit declaration of function ‘get_signsl’
 make[1]: *** [arch/unicore32/kernel/signal.o] Error 1
 make: *** [arch/unicore32/kernel/signal.o] Error 2
 
 Bisect points to commit 649671c90eaf (unicore32: Use get_signal()
 signal_setup_done()).
 
 This code never even compiled. Reverting the patch does not work,
 since previously used functions no longer exist, so try to fix it up.
 Compile tested only.
 
 Fixes: 649671c90eaf (unicore32: Use get_signal() signal_setup_done())
 Cc: Richard Weinberger rich...@nod.at
 Signed-off-by: Guenter Roeck li...@roeck-us.net
 ---
 Resending after rebase to current upstream kernel.
 
 Linus, please consider adding this patch directly to your tree.
 This is the one remaining build failure regression in the upstream kernel.
 
  arch/unicore32/kernel/signal.c | 9 +
  1 file changed, 5 insertions(+), 4 deletions(-)
 
 diff --git a/arch/unicore32/kernel/signal.c b/arch/unicore32/kernel/signal.c
 index 780d773..7c8fb70 100644
 --- a/arch/unicore32/kernel/signal.c
 +++ b/arch/unicore32/kernel/signal.c
 @@ -254,7 +254,8 @@ static int setup_frame(struct ksignal *ksig, sigset_t 
 *set,
  
   err |= setup_sigframe(frame, regs, set);
   if (err == 0)
 - err |= setup_return(regs, ksig-ka, frame-retcode, frame, 
 usig);
 + err |= setup_return(regs, ksig-ka, frame-retcode, frame,
 + ksig-sig);
  
   return err;
  }
 @@ -276,7 +277,8 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t 
 *set,
   err |= __save_altstack(frame-sig.uc.uc_stack, regs-UCreg_sp);
   err |= setup_sigframe(frame-sig, regs, set);
   if (err == 0)
 - err |= setup_return(regs, ksig-ka, frame-sig.retcode, frame, 
 usig);
 + err |= setup_return(regs, ksig-ka, frame-sig.retcode, frame,
 + ksig-sig);
  
   if (err == 0) {
   /*
 @@ -303,7 +305,6 @@ static void handle_signal(struct ksignal *ksig, struct 
 pt_regs *regs,
 int syscall)
  {
   struct thread_info *thread = current_thread_info();
 - struct task_struct *tsk = current;
   sigset_t *oldset = sigmask_to_save();
   int usig = ksig-sig;
   int ret;
 @@ -373,7 +374,7 @@ static void do_signal(struct pt_regs *regs, int syscall)
   if (!user_mode(regs))
   return;
  
 - if (get_signsl(ksig)) {
 + if (get_signal(ksig)) {
   handle_signal(ksig, regs, syscall);
   return;
   }
 -- 
 1.9.1
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Re: 回复: Status of 'unicore32' architecture in Linux kernel

2014-09-02 Thread Xuetao Guan

[...]
  
   
   unicore32: Add ocd console and qemu-defconfig to support qemu simulator
 This patch adds a primitive OCD console to communicate with qemu.
 The same code is already used for early console support.
  
  Do you mean there's the same/similar code in QEMU.
  
 No, I mean that the ocd functions in the linux kernel (such as ocd_putc) are
 used by both earlyprintk and the ocd console code.
Yes. By the way, it's only for qemu and fpga debug.

 
   
   With this patch added, and with qemu_defconfig as provided by the same 
   patch,
   it is possible to build and load a unicore32 image in qemu using the 
   following
   qemu command line.
   
   qemu-system-unicore32 -curses -M puv3 -m 512 -kernel 
   arch/unicore32/boot/zImage
   
   Caveats:
   - The use of -nographic instead of -curses causes a qemu crash
  Yes, since qemu curses code was modified to meet the simple OCD console 
  requirement.
  
 The lack of support for -nographic is a problem for scripted testing.
 The issue is that we have to interpret console output for scripted testing,
 and having to go through curses makes that a bit difficult.
 
 Wonder if '-nographic' can be modeled as '-curses' with no available terminal
 configuration. At least in theory that should work, but executing the above
 command with TERM=dumb yields no output. Wonder how difficult it would be to
 change that.

I see. I'll try to make -nographic work anyway.

 
   - The qemu emulation only accepts a built-in initramfs.
  Yes, github version only support built-in initramfs.
  NFS+LFS could be also supported, and puv3-pci sim should be added at first.
  
   - The only working image is arch/unicore32/boot/zImage.
 All other variants, arch/unicore32/boot/Image and vmlinux, cause a 
   crash.
 The same (or a similar) crash is also seen if I don't provide a built-in
 kernel command line and try to load zImage.
  Sorry for that. That should be fixed.
  
   - There is no networking. There is another patch in the github linux
 respository [4] which is not available upstream. The driver was 
   submitted
 for integration back in 2011 [5] but it was never accepted or merged.
  Yes, exactly.
 
 Too bad. Not exactly necessary for our current scope of testing, but it would 
 be
 nice to be able to test networking.
I'll review and submit networking code again. Or, maybe pci-nic function, to 
support qemu as well. 

 
  Thanks Guenter.
  
 You are welcome. Thanks for the feedback.
 
 Guenter

Thanks.

Xuetao
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Re: 回复: Re: [PATCH] unicore32: Fix build error

2014-08-17 Thread Xuetao Guan

- Guenter Roeck  写道:
> On 08/15/2014 05:45 PM, Xuetao Guan  wrote:
> >
> > - Guenter Roeck  写道:
> >> On 08/10/2014 08:29 AM, Guenter Roeck wrote:
> >>> unicore32 builds fail with
> >>>
> >>> arch/unicore32/kernel/signal.c: In function ‘setup_frame’:
> >>> arch/unicore32/kernel/signal.c:257: error:
> >>>   ‘usig’ undeclared (first use in this function)
> >>> arch/unicore32/kernel/signal.c:279: error:
> >>>   ‘usig’ undeclared (first use in this function)
> >>> arch/unicore32/kernel/signal.c: In function ‘handle_signal’:
> >>> arch/unicore32/kernel/signal.c:306: warning: unused variable ‘tsk’
> >>> arch/unicore32/kernel/signal.c: In function ‘do_signal’:
> >>> arch/unicore32/kernel/signal.c:376: error:
> >>>   implicit declaration of function ‘get_signsl’
> >>> make[1]: *** [arch/unicore32/kernel/signal.o] Error 1
> >>> make: *** [arch/unicore32/kernel/signal.o] Error 2
> >>>
> >>> Bisect points to commit 649671c90eaf ("unicore32: Use get_signal()
> >>> signal_setup_done()").
> >>>
> >>> This code never even compiled. Reverting the patch does not work,
> >>> since previously used functions no longer exist, so try to fix it up.
> >>> Compile tested only.
> >>>
> >>> Cc: Richard Weinberger 
> >>> Signed-off-by: Guenter Roeck 
> >>
> >> ping ...
> >>
> >> Failure is still present in upstream kernel (v3.16-11383-gc9d2642).
> >>
> >> Guenter
> >>
> >
> > Thanks. I'll fix it.
> >
> 
> More a question of applying (and if possible testing) the patch I provided.
> 
> Thanks,
> Guenter
> 
> 
Ok, I'll do it.

Xuetao
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Re: 回复: Re: [PATCH] unicore32: Fix build error

2014-08-17 Thread Xuetao Guan

- Guenter Roeck li...@roeck-us.net 写道:
 On 08/15/2014 05:45 PM, Xuetao Guan  wrote:
 
  - Guenter Roeck li...@roeck-us.net 写道:
  On 08/10/2014 08:29 AM, Guenter Roeck wrote:
  unicore32 builds fail with
 
  arch/unicore32/kernel/signal.c: In function ‘setup_frame’:
  arch/unicore32/kernel/signal.c:257: error:
‘usig’ undeclared (first use in this function)
  arch/unicore32/kernel/signal.c:279: error:
‘usig’ undeclared (first use in this function)
  arch/unicore32/kernel/signal.c: In function ‘handle_signal’:
  arch/unicore32/kernel/signal.c:306: warning: unused variable ‘tsk’
  arch/unicore32/kernel/signal.c: In function ‘do_signal’:
  arch/unicore32/kernel/signal.c:376: error:
implicit declaration of function ‘get_signsl’
  make[1]: *** [arch/unicore32/kernel/signal.o] Error 1
  make: *** [arch/unicore32/kernel/signal.o] Error 2
 
  Bisect points to commit 649671c90eaf (unicore32: Use get_signal()
  signal_setup_done()).
 
  This code never even compiled. Reverting the patch does not work,
  since previously used functions no longer exist, so try to fix it up.
  Compile tested only.
 
  Cc: Richard Weinberger rich...@nod.at
  Signed-off-by: Guenter Roeck li...@roeck-us.net
 
  ping ...
 
  Failure is still present in upstream kernel (v3.16-11383-gc9d2642).
 
  Guenter
 
 
  Thanks. I'll fix it.
 
 
 More a question of applying (and if possible testing) the patch I provided.
 
 Thanks,
 Guenter
 
 
Ok, I'll do it.

Xuetao
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Re: [PATCH] unicore32: Fix build error

2014-08-15 Thread Xuetao Guan

- Guenter Roeck  写道:
> On 08/10/2014 08:29 AM, Guenter Roeck wrote:
> > unicore32 builds fail with
> >
> > arch/unicore32/kernel/signal.c: In function ‘setup_frame’:
> > arch/unicore32/kernel/signal.c:257: error:
> > ‘usig’ undeclared (first use in this function)
> > arch/unicore32/kernel/signal.c:279: error:
> > ‘usig’ undeclared (first use in this function)
> > arch/unicore32/kernel/signal.c: In function ‘handle_signal’:
> > arch/unicore32/kernel/signal.c:306: warning: unused variable ‘tsk’
> > arch/unicore32/kernel/signal.c: In function ‘do_signal’:
> > arch/unicore32/kernel/signal.c:376: error:
> > implicit declaration of function ‘get_signsl’
> > make[1]: *** [arch/unicore32/kernel/signal.o] Error 1
> > make: *** [arch/unicore32/kernel/signal.o] Error 2
> >
> > Bisect points to commit 649671c90eaf ("unicore32: Use get_signal()
> > signal_setup_done()").
> >
> > This code never even compiled. Reverting the patch does not work,
> > since previously used functions no longer exist, so try to fix it up.
> > Compile tested only.
> >
> > Cc: Richard Weinberger 
> > Signed-off-by: Guenter Roeck 
> 
> ping ...
> 
> Failure is still present in upstream kernel (v3.16-11383-gc9d2642).
> 
> Guenter
> 

Thanks. I'll fix it.

Xuetao
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Re: [PATCH] unicore32: Fix build error

2014-08-15 Thread Xuetao Guan

- Guenter Roeck li...@roeck-us.net 写道:
 On 08/10/2014 08:29 AM, Guenter Roeck wrote:
  unicore32 builds fail with
 
  arch/unicore32/kernel/signal.c: In function ‘setup_frame’:
  arch/unicore32/kernel/signal.c:257: error:
  ‘usig’ undeclared (first use in this function)
  arch/unicore32/kernel/signal.c:279: error:
  ‘usig’ undeclared (first use in this function)
  arch/unicore32/kernel/signal.c: In function ‘handle_signal’:
  arch/unicore32/kernel/signal.c:306: warning: unused variable ‘tsk’
  arch/unicore32/kernel/signal.c: In function ‘do_signal’:
  arch/unicore32/kernel/signal.c:376: error:
  implicit declaration of function ‘get_signsl’
  make[1]: *** [arch/unicore32/kernel/signal.o] Error 1
  make: *** [arch/unicore32/kernel/signal.o] Error 2
 
  Bisect points to commit 649671c90eaf (unicore32: Use get_signal()
  signal_setup_done()).
 
  This code never even compiled. Reverting the patch does not work,
  since previously used functions no longer exist, so try to fix it up.
  Compile tested only.
 
  Cc: Richard Weinberger rich...@nod.at
  Signed-off-by: Guenter Roeck li...@roeck-us.net
 
 ping ...
 
 Failure is still present in upstream kernel (v3.16-11383-gc9d2642).
 
 Guenter
 

Thanks. I'll fix it.

Xuetao
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Re: [PATCH] unicore32: Fix build error

2014-08-10 Thread Xuetao Guan

- Guenter Roeck  写道:
> On 08/10/2014 08:39 AM, Richard Weinberger wrote:
> > Guenther,
> >
> > Am 10.08.2014 17:29, schrieb Guenter Roeck:
> >> unicore32 builds fail with
> >>
> >> arch/unicore32/kernel/signal.c: In function ‘setup_frame’:
> >> arch/unicore32/kernel/signal.c:257: error:
> >>‘usig’ undeclared (first use in this function)
> >> arch/unicore32/kernel/signal.c:279: error:
> >>‘usig’ undeclared (first use in this function)
> >> arch/unicore32/kernel/signal.c: In function ‘handle_signal’:
> >> arch/unicore32/kernel/signal.c:306: warning: unused variable ‘tsk’
> >> arch/unicore32/kernel/signal.c: In function ‘do_signal’:
> >> arch/unicore32/kernel/signal.c:376: error:
> >>implicit declaration of function ‘get_signsl’
> >> make[1]: *** [arch/unicore32/kernel/signal.o] Error 1
> >> make: *** [arch/unicore32/kernel/signal.o] Error 2
> >>
> >> Bisect points to commit 649671c90eaf ("unicore32: Use get_signal()
> >> signal_setup_done()").
> >>
> >> This code never even compiled. Reverting the patch does not work,
> >> since previously used functions no longer exist, so try to fix it up.
> >> Compile tested only.
> >
> > Where did you get the unicore32 cross compiler from?
> >
> mprc.pku.edu.cn/~guanxuetao/linux/uc4-1.0.5-hard.tgz
> 
> Guenter

Yes, this toolchain can generate unicore32 binaries.
Thanks Guenter.

Xuetao
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: Re: [PATCH] unicore32: Fix build error

2014-08-10 Thread Xuetao Guan

- Guenter Roeck li...@roeck-us.net 写道:
 On 08/10/2014 08:39 AM, Richard Weinberger wrote:
  Guenther,
 
  Am 10.08.2014 17:29, schrieb Guenter Roeck:
  unicore32 builds fail with
 
  arch/unicore32/kernel/signal.c: In function ‘setup_frame’:
  arch/unicore32/kernel/signal.c:257: error:
 ‘usig’ undeclared (first use in this function)
  arch/unicore32/kernel/signal.c:279: error:
 ‘usig’ undeclared (first use in this function)
  arch/unicore32/kernel/signal.c: In function ‘handle_signal’:
  arch/unicore32/kernel/signal.c:306: warning: unused variable ‘tsk’
  arch/unicore32/kernel/signal.c: In function ‘do_signal’:
  arch/unicore32/kernel/signal.c:376: error:
 implicit declaration of function ‘get_signsl’
  make[1]: *** [arch/unicore32/kernel/signal.o] Error 1
  make: *** [arch/unicore32/kernel/signal.o] Error 2
 
  Bisect points to commit 649671c90eaf (unicore32: Use get_signal()
  signal_setup_done()).
 
  This code never even compiled. Reverting the patch does not work,
  since previously used functions no longer exist, so try to fix it up.
  Compile tested only.
 
  Where did you get the unicore32 cross compiler from?
 
 mprc.pku.edu.cn/~guanxuetao/linux/uc4-1.0.5-hard.tgz
 
 Guenter

Yes, this toolchain can generate unicore32 binaries.
Thanks Guenter.

Xuetao
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: [PATCH] unicore32: Remove ARCH_HAS_CPUFREQ config option

2014-06-04 Thread Xuetao Guan

- Stephen Boyd  写道:
> This config exists entirely to hide the cpufreq menu from the
> kernel configuration unless a platform has selected it. Nothing
> is actually built if this config is 'Y' and it just leads to more
> patches that add a select under a platform Kconfig so that some
> other CPUfreq option can be chosen. Let's remove the option so
> that we can always enable CPUfreq drivers on unicore32 platforms.
> 
> Cc: Viresh Kumar 
> Signed-off-by: Stephen Boyd 

Thanks, I'll push it in my repo.

Signed-off-by: Xuetao Guan 

> ---
>  arch/unicore32/Kconfig | 6 --
>  1 file changed, 6 deletions(-)
> 
> diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
> index aafad6fa1667..928237a7b9ca 100644
> --- a/arch/unicore32/Kconfig
> +++ b/arch/unicore32/Kconfig
> @@ -51,9 +51,6 @@ config ARCH_HAS_ILOG2_U32
>  config ARCH_HAS_ILOG2_U64
>   bool
>  
> -config ARCH_HAS_CPUFREQ
> - bool
> -
>  config GENERIC_HWEIGHT
>   def_bool y
>  
> @@ -87,7 +84,6 @@ config ARCH_PUV3
>   select GENERIC_CLOCKEVENTS
>   select HAVE_CLK
>   select ARCH_REQUIRE_GPIOLIB
> - select ARCH_HAS_CPUFREQ
>  
>  # CONFIGs for ARCH_PUV3
>  
> @@ -198,9 +194,7 @@ menu "Power management options"
>  
>  source "kernel/power/Kconfig"
>  
> -if ARCH_HAS_CPUFREQ
>  source "drivers/cpufreq/Kconfig"
> -endif
>  
>  config ARCH_SUSPEND_POSSIBLE
>   def_bool y if !ARCH_FPGA
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> hosted by The Linux Foundation
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


回复: [PATCH] unicore32: Remove ARCH_HAS_CPUFREQ config option

2014-06-04 Thread Xuetao Guan

- Stephen Boyd sb...@codeaurora.org 写道:
 This config exists entirely to hide the cpufreq menu from the
 kernel configuration unless a platform has selected it. Nothing
 is actually built if this config is 'Y' and it just leads to more
 patches that add a select under a platform Kconfig so that some
 other CPUfreq option can be chosen. Let's remove the option so
 that we can always enable CPUfreq drivers on unicore32 platforms.
 
 Cc: Viresh Kumar viresh.ku...@linaro.org
 Signed-off-by: Stephen Boyd sb...@codeaurora.org

Thanks, I'll push it in my repo.

Signed-off-by: Xuetao Guan g...@mprc.pku.edu.cn

 ---
  arch/unicore32/Kconfig | 6 --
  1 file changed, 6 deletions(-)
 
 diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
 index aafad6fa1667..928237a7b9ca 100644
 --- a/arch/unicore32/Kconfig
 +++ b/arch/unicore32/Kconfig
 @@ -51,9 +51,6 @@ config ARCH_HAS_ILOG2_U32
  config ARCH_HAS_ILOG2_U64
   bool
  
 -config ARCH_HAS_CPUFREQ
 - bool
 -
  config GENERIC_HWEIGHT
   def_bool y
  
 @@ -87,7 +84,6 @@ config ARCH_PUV3
   select GENERIC_CLOCKEVENTS
   select HAVE_CLK
   select ARCH_REQUIRE_GPIOLIB
 - select ARCH_HAS_CPUFREQ
  
  # CONFIGs for ARCH_PUV3
  
 @@ -198,9 +194,7 @@ menu Power management options
  
  source kernel/power/Kconfig
  
 -if ARCH_HAS_CPUFREQ
  source drivers/cpufreq/Kconfig
 -endif
  
  config ARCH_SUSPEND_POSSIBLE
   def_bool y if !ARCH_FPGA
 -- 
 The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
 hosted by The Linux Foundation
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Re: [GIT PULL REQUEST] UniCore32 update for 3.15-rc7

2014-06-03 Thread Xuetao Guan
Sorry, I think I used an old version git (v 1.7.0.4), and its request-pull 
command
used branch name instead of tag name.

I'll resend GIT PULL email.

Thanks,
Xuetao Guan

- Linus Torvalds  写道:
> On Thu, May 29, 2014 at 1:19 AM, guanxuetao  
> wrote:
> >
> >   git://github.com/gxt/linux.git unicore32
> 
> Guan, this isn't the usual signed tag I see from you, and when it
> comes from a public hosting place like github, I _really_ want to see
> the stuff I pull being signed. I realize that the email itself has a
> gpg signature, but since there are no sane ways to actually verify
> email signatures (or save them in git if you were to use one of the
> baroque few email clients that do), that doesn't exactly help..
> 
>  Linus

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Re: [GIT PULL REQUEST] UniCore32 update for 3.15-rc7

2014-06-03 Thread Xuetao Guan
Sorry, I think I used an old version git (v 1.7.0.4), and its request-pull 
command
used branch name instead of tag name.

I'll resend GIT PULL email.

Thanks,
Xuetao Guan

- Linus Torvalds torva...@linux-foundation.org 写道:
 On Thu, May 29, 2014 at 1:19 AM, guanxuetao guanxue...@mprc.pku.edu.cn 
 wrote:
 
git://github.com/gxt/linux.git unicore32
 
 Guan, this isn't the usual signed tag I see from you, and when it
 comes from a public hosting place like github, I _really_ want to see
 the stuff I pull being signed. I realize that the email itself has a
 gpg signature, but since there are no sane ways to actually verify
 email signatures (or save them in git if you were to use one of the
 baroque few email clients that do), that doesn't exactly help..
 
  Linus

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH -v9 07/11] unicore32, prepare reboot_mode for moving to generic kernel code.

2013-05-10 Thread Xuetao Guan
> This patch prepares for the moving the parsing of reboot= to the generic
> kernel code by making reboot_mode into a more generic form.
>
> Signed-off-by: Robin Holt 
> To: Andrew Morton 
> Cc: Guan Xuetao 
> Cc: Russ Anderson 
> Cc: Robin Holt 
> Cc: Russell King 
> Cc: H. Peter Anvin 
> Cc: Linux Kernel Mailing List 
> Cc: the arch/x86 maintainers 
> Cc: Arm Mailing List 

Thanks for your hard work.

For UniCore32 bits: (Though I can't compile and test it in recent months)
Acked-by: Guan Xuetao 


>
> ---
>
> Changes since -v8
>  - Switched from using REBOOT_WARM/COLD to HARD/SOFT.
> ---
>  arch/unicore32/kernel/process.c | 10 +-
>  arch/unicore32/kernel/setup.h   |  2 +-
>  arch/unicore32/mm/mmu.c |  2 +-
>  include/linux/reboot.h  |  2 ++
>  4 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/arch/unicore32/kernel/process.c
> b/arch/unicore32/kernel/process.c
> index c944769..93dd035 100644
> --- a/arch/unicore32/kernel/process.c
> +++ b/arch/unicore32/kernel/process.c
> @@ -51,14 +51,14 @@ void arch_cpu_idle(void)
>   local_irq_enable();
>  }
>
> -static char reboot_mode = 'h';
> +static enum reboot_mode reboot_mode = REBOOT_HARD;
>
>  int __init reboot_setup(char *str)
>  {
> - reboot_mode = str[0];
> + if ('s' == str[0])
> + reboot_mode = REBOOT_SOFT;
>   return 1;
>  }
> -
>  __setup("reboot=", reboot_setup);
>
>  void machine_halt(void)
> @@ -88,7 +88,7 @@ void machine_restart(char *cmd)
>* we may need it to insert some 1:1 mappings so that
>* soft boot works.
>*/
> - setup_mm_for_reboot(reboot_mode);
> + setup_mm_for_reboot();
>
>   /* Clean and invalidate caches */
>   flush_cache_all();
> @@ -102,7 +102,7 @@ void machine_restart(char *cmd)
>   /*
>* Now handle reboot code.
>*/
> - if (reboot_mode == 's') {
> + if (reboot_mode == REBOOT_SOFT) {
>   /* Jump into ROM at address 0x */
>   cpu_reset(VECTORS_BASE);
>   } else {
> diff --git a/arch/unicore32/kernel/setup.h b/arch/unicore32/kernel/setup.h
> index 30f749d..f5c51b8 100644
> --- a/arch/unicore32/kernel/setup.h
> +++ b/arch/unicore32/kernel/setup.h
> @@ -22,7 +22,7 @@ extern void puv3_ps2_init(void);
>  extern void pci_puv3_preinit(void);
>  extern void __init puv3_init_gpio(void);
>
> -extern void setup_mm_for_reboot(char mode);
> +extern void setup_mm_for_reboot(void);
>
>  extern char __stubs_start[], __stubs_end[];
>  extern char __vectors_start[], __vectors_end[];
> diff --git a/arch/unicore32/mm/mmu.c b/arch/unicore32/mm/mmu.c
> index 43c20b4..4f5a532 100644
> --- a/arch/unicore32/mm/mmu.c
> +++ b/arch/unicore32/mm/mmu.c
> @@ -445,7 +445,7 @@ void __init paging_init(void)
>   * the user-mode pages.  This will then ensure that we have predictable
>   * results when turning the mmu off
>   */
> -void setup_mm_for_reboot(char mode)
> +void setup_mm_for_reboot(void)
>  {
>   unsigned long base_pmdval;
>   pgd_t *pgd;
> diff --git a/include/linux/reboot.h b/include/linux/reboot.h
> index 37d56c3..ca29a6f 100644
> --- a/include/linux/reboot.h
> +++ b/include/linux/reboot.h
> @@ -13,6 +13,8 @@
>  enum reboot_mode {
>   REBOOT_COLD = 0,
>   REBOOT_WARM,
> + REBOOT_HARD,
> + REBOOT_SOFT,
>  };
>
>  extern int register_reboot_notifier(struct notifier_block *);
> --
> 1.8.2.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH -v9 07/11] unicore32, prepare reboot_mode for moving to generic kernel code.

2013-05-10 Thread Xuetao Guan
 This patch prepares for the moving the parsing of reboot= to the generic
 kernel code by making reboot_mode into a more generic form.

 Signed-off-by: Robin Holt h...@sgi.com
 To: Andrew Morton a...@linux-foundation.org
 Cc: Guan Xuetao g...@mprc.pku.edu.cn
 Cc: Russ Anderson r...@sgi.com
 Cc: Robin Holt h...@sgi.com
 Cc: Russell King li...@arm.linux.org.uk
 Cc: H. Peter Anvin h...@zytor.com
 Cc: Linux Kernel Mailing List linux-kernel@vger.kernel.org
 Cc: the arch/x86 maintainers x...@kernel.org
 Cc: Arm Mailing List linux-arm-ker...@lists.infradead.org

Thanks for your hard work.

For UniCore32 bits: (Though I can't compile and test it in recent months)
Acked-by: Guan Xuetao g...@mprc.pku.edu.cn



 ---

 Changes since -v8
  - Switched from using REBOOT_WARM/COLD to HARD/SOFT.
 ---
  arch/unicore32/kernel/process.c | 10 +-
  arch/unicore32/kernel/setup.h   |  2 +-
  arch/unicore32/mm/mmu.c |  2 +-
  include/linux/reboot.h  |  2 ++
  4 files changed, 9 insertions(+), 7 deletions(-)

 diff --git a/arch/unicore32/kernel/process.c
 b/arch/unicore32/kernel/process.c
 index c944769..93dd035 100644
 --- a/arch/unicore32/kernel/process.c
 +++ b/arch/unicore32/kernel/process.c
 @@ -51,14 +51,14 @@ void arch_cpu_idle(void)
   local_irq_enable();
  }

 -static char reboot_mode = 'h';
 +static enum reboot_mode reboot_mode = REBOOT_HARD;

  int __init reboot_setup(char *str)
  {
 - reboot_mode = str[0];
 + if ('s' == str[0])
 + reboot_mode = REBOOT_SOFT;
   return 1;
  }
 -
  __setup(reboot=, reboot_setup);

  void machine_halt(void)
 @@ -88,7 +88,7 @@ void machine_restart(char *cmd)
* we may need it to insert some 1:1 mappings so that
* soft boot works.
*/
 - setup_mm_for_reboot(reboot_mode);
 + setup_mm_for_reboot();

   /* Clean and invalidate caches */
   flush_cache_all();
 @@ -102,7 +102,7 @@ void machine_restart(char *cmd)
   /*
* Now handle reboot code.
*/
 - if (reboot_mode == 's') {
 + if (reboot_mode == REBOOT_SOFT) {
   /* Jump into ROM at address 0x */
   cpu_reset(VECTORS_BASE);
   } else {
 diff --git a/arch/unicore32/kernel/setup.h b/arch/unicore32/kernel/setup.h
 index 30f749d..f5c51b8 100644
 --- a/arch/unicore32/kernel/setup.h
 +++ b/arch/unicore32/kernel/setup.h
 @@ -22,7 +22,7 @@ extern void puv3_ps2_init(void);
  extern void pci_puv3_preinit(void);
  extern void __init puv3_init_gpio(void);

 -extern void setup_mm_for_reboot(char mode);
 +extern void setup_mm_for_reboot(void);

  extern char __stubs_start[], __stubs_end[];
  extern char __vectors_start[], __vectors_end[];
 diff --git a/arch/unicore32/mm/mmu.c b/arch/unicore32/mm/mmu.c
 index 43c20b4..4f5a532 100644
 --- a/arch/unicore32/mm/mmu.c
 +++ b/arch/unicore32/mm/mmu.c
 @@ -445,7 +445,7 @@ void __init paging_init(void)
   * the user-mode pages.  This will then ensure that we have predictable
   * results when turning the mmu off
   */
 -void setup_mm_for_reboot(char mode)
 +void setup_mm_for_reboot(void)
  {
   unsigned long base_pmdval;
   pgd_t *pgd;
 diff --git a/include/linux/reboot.h b/include/linux/reboot.h
 index 37d56c3..ca29a6f 100644
 --- a/include/linux/reboot.h
 +++ b/include/linux/reboot.h
 @@ -13,6 +13,8 @@
  enum reboot_mode {
   REBOOT_COLD = 0,
   REBOOT_WARM,
 + REBOOT_HARD,
 + REBOOT_SOFT,
  };

  extern int register_reboot_notifier(struct notifier_block *);
 --
 1.8.2.1


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 40/42] rtc: rtc-puv3: remove unnecessary platform_set_drvdata()

2013-05-03 Thread Xuetao Guan
> The driver core clears the driver data to NULL after device_release
> or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
> (device-core: Ensure drvdata = NULL when no driver is bound).
> Thus, it is not needed to manually clear the device driver data to NULL.
>
> Signed-off-by: Jingoo Han 
Thanks.

Acked-by: Guan Xuetao 

> ---
>  drivers/rtc/rtc-puv3.c |1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/rtc/rtc-puv3.c b/drivers/rtc/rtc-puv3.c
> index 72f4371..402732c 100644
> --- a/drivers/rtc/rtc-puv3.c
> +++ b/drivers/rtc/rtc-puv3.c
> @@ -224,7 +224,6 @@ static int puv3_rtc_remove(struct platform_device
> *dev)
>  {
>   struct rtc_device *rtc = platform_get_drvdata(dev);
>
> - platform_set_drvdata(dev, NULL);
>   rtc_device_unregister(rtc);
>
>   puv3_rtc_setpie(>dev, 0);
> --
> 1.7.2.5
>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 40/42] rtc: rtc-puv3: remove unnecessary platform_set_drvdata()

2013-05-03 Thread Xuetao Guan
 The driver core clears the driver data to NULL after device_release
 or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
 (device-core: Ensure drvdata = NULL when no driver is bound).
 Thus, it is not needed to manually clear the device driver data to NULL.

 Signed-off-by: Jingoo Han jg1@samsung.com
Thanks.

Acked-by: Guan Xuetao g...@mprc.pku.edu.cn

 ---
  drivers/rtc/rtc-puv3.c |1 -
  1 files changed, 0 insertions(+), 1 deletions(-)

 diff --git a/drivers/rtc/rtc-puv3.c b/drivers/rtc/rtc-puv3.c
 index 72f4371..402732c 100644
 --- a/drivers/rtc/rtc-puv3.c
 +++ b/drivers/rtc/rtc-puv3.c
 @@ -224,7 +224,6 @@ static int puv3_rtc_remove(struct platform_device
 *dev)
  {
   struct rtc_device *rtc = platform_get_drvdata(dev);

 - platform_set_drvdata(dev, NULL);
   rtc_device_unregister(rtc);

   puv3_rtc_setpie(dev-dev, 0);
 --
 1.7.2.5



--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH v1 16/19] mm/unicore32: fix stale comment about VALID_PAGE()

2013-04-15 Thread Xuetao Guan
> VALID_PAGE() has been removed from kernel long time ago,
> so fix the comment.
>
> Signed-off-by: Jiang Liu 
> Cc: Guan Xuetao 
> Cc: linux-kernel@vger.kernel.org

Thanks,

Acked-by: Guan Xuetao 

> ---
>  arch/unicore32/include/asm/memory.h |6 --
>  1 file changed, 6 deletions(-)
>
> diff --git a/arch/unicore32/include/asm/memory.h
> b/arch/unicore32/include/asm/memory.h
> index 5eddb99..debafc4 100644
> --- a/arch/unicore32/include/asm/memory.h
> +++ b/arch/unicore32/include/asm/memory.h
> @@ -98,12 +98,6 @@
>  /*
>   * Conversion between a struct page and a physical address.
>   *
> - * Note: when converting an unknown physical address to a
> - * struct page, the resulting pointer must be validated
> - * using VALID_PAGE().  It must return an invalid struct page
> - * for any physical address not corresponding to a system
> - * RAM address.
> - *
>   *  page_to_pfn(page)convert a struct page * to a PFN number
>   *  pfn_to_page(pfn) convert a _valid_ PFN number to struct page *
>   *
> --
> 1.7.9.5
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH v1 16/19] mm/unicore32: fix stale comment about VALID_PAGE()

2013-04-15 Thread Xuetao Guan
 VALID_PAGE() has been removed from kernel long time ago,
 so fix the comment.

 Signed-off-by: Jiang Liu jiang@huawei.com
 Cc: Guan Xuetao g...@mprc.pku.edu.cn
 Cc: linux-kernel@vger.kernel.org

Thanks,

Acked-by: Guan Xuetao g...@mprc.pku.edu.cn

 ---
  arch/unicore32/include/asm/memory.h |6 --
  1 file changed, 6 deletions(-)

 diff --git a/arch/unicore32/include/asm/memory.h
 b/arch/unicore32/include/asm/memory.h
 index 5eddb99..debafc4 100644
 --- a/arch/unicore32/include/asm/memory.h
 +++ b/arch/unicore32/include/asm/memory.h
 @@ -98,12 +98,6 @@
  /*
   * Conversion between a struct page and a physical address.
   *
 - * Note: when converting an unknown physical address to a
 - * struct page, the resulting pointer must be validated
 - * using VALID_PAGE().  It must return an invalid struct page
 - * for any physical address not corresponding to a system
 - * RAM address.
 - *
   *  page_to_pfn(page)convert a struct page * to a PFN number
   *  pfn_to_page(pfn) convert a _valid_ PFN number to struct page *
   *
 --
 1.7.9.5


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 7/9] unicore2: cpufreq: move cpufreq driver to drivers/cpufreq

2013-03-31 Thread Xuetao Guan
> On 25 March 2013 22:24, Viresh Kumar  wrote:
>> This patch moves cpufreq driver of UNICORE-2 architecture to
>> drivers/cpufreq.
>>
>> Cc: Guan Xuetao 
>> Signed-off-by: Viresh Kumar 
>> ---
>>  arch/unicore32/kernel/Makefile
>> | 1 -
>>  drivers/cpufreq/Makefile
>> | 1 +
>>  arch/unicore32/kernel/cpu-ucv2.c => drivers/cpufreq/unicore2-cpufreq.c
>> | 2 +-
>>  3 files changed, 2 insertions(+), 2 deletions(-)
>>  rename arch/unicore32/kernel/cpu-ucv2.c =>
>> drivers/cpufreq/unicore2-cpufreq.c (96%)
>
> Guan,
>
> Can i have your ack for this?
>
Sure. Sorry for my delay.

Acked-by: Guan Xuetao 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 7/9] unicore2: cpufreq: move cpufreq driver to drivers/cpufreq

2013-03-31 Thread Xuetao Guan
 On 25 March 2013 22:24, Viresh Kumar viresh.ku...@linaro.org wrote:
 This patch moves cpufreq driver of UNICORE-2 architecture to
 drivers/cpufreq.

 Cc: Guan Xuetao g...@mprc.pku.edu.cn
 Signed-off-by: Viresh Kumar viresh.ku...@linaro.org
 ---
  arch/unicore32/kernel/Makefile
 | 1 -
  drivers/cpufreq/Makefile
 | 1 +
  arch/unicore32/kernel/cpu-ucv2.c = drivers/cpufreq/unicore2-cpufreq.c
 | 2 +-
  3 files changed, 2 insertions(+), 2 deletions(-)
  rename arch/unicore32/kernel/cpu-ucv2.c =
 drivers/cpufreq/unicore2-cpufreq.c (96%)

 Guan,

 Can i have your ack for this?

Sure. Sorry for my delay.

Acked-by: Guan Xuetao g...@mprc.pku.edu.cn

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/