linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: FW: [PATCH 24/31] nds32: Miscellaneous header files
@ 2017-11-09 10:42 Vincent Chen
  2017-11-22  5:45 ` Vincent Chen
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Chen @ 2017-11-09 10:42 UTC (permalink / raw)
  To: arndbergmann
  Cc: greentime, linux-kernel, linux-arch, tglx, jason, marc.zyngier,
	robh+dt, netdev, green.hu

>>On Wed, Nov 8, 2017 at 6:55 AM, Greentime Hu <green.hu@gmail.com> wrote:
>> +
>> +static inline void __delay(unsigned long loops) {
>> +       __asm__ __volatile__(".align 2\n"
>> +                            "1:\n"
>> +                            "\taddi\t%0, %0, -1\n"
>> +                            "\tbgtz\t%0, 1b\n"
>> +                            :"=r"(loops)
>> +                            :"0"(loops)); }
>
> Does the architecture define a high-resolution clock source? If yes, then it's better to use that to get exact timing than to rely on the loop calibration.
>
Dear Arnd:

Thanks.
I will modify it in the next version patch.

>> +/*
>> + * This file is generally used by user-level software, so you need to
>> + * be a little careful about namespace pollution etc.  Also, we
>> +cannot
>> + * assume GCC is being used.
>> + */
>> +
>> +typedef unsigned short __kernel_mode_t; #define __kernel_mode_t
>> +__kernel_mode_t
>> +
>> +typedef unsigned short __kernel_ipc_pid_t; #define __kernel_ipc_pid_t
>> +__kernel_ipc_pid_t
>> +
>> +typedef unsigned short __kernel_uid_t; typedef unsigned short
>> +__kernel_gid_t; #define __kernel_uid_t __kernel_uid_t
>> +
>> +typedef unsigned short __kernel_old_dev_t; #define __kernel_old_dev_t
>> +__kernel_old_dev_t
>> +
>> +#include <asm-generic/posix_types.h>
>
> I don't understand why you would want to override any of those.
> Changing them unfortunately means rebuilding all of your user space, but I think it would be better to do that now than to suffer from this later on.
>
>     Arnd

Thanks.
I will remove them in the next version patch.

Best regards
Vincent

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: FW: [PATCH 24/31] nds32: Miscellaneous header files
  2017-11-09 10:42 FW: [PATCH 24/31] nds32: Miscellaneous header files Vincent Chen
@ 2017-11-22  5:45 ` Vincent Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Vincent Chen @ 2017-11-22  5:45 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Greentime, Linux Kernel Mailing List, linux-arch,
	Thomas Gleixner, Jason Cooper, Marc Zyngier, Rob Herring,
	Networking, Green Hu

2017-11-09 18:42 GMT+08:00 Vincent Chen <deanbo422@gmail.com>:
>>>On Wed, Nov 8, 2017 at 6:55 AM, Greentime Hu <green.hu@gmail.com> wrote:
>>> +
>>> +static inline void __delay(unsigned long loops) {
>>> +       __asm__ __volatile__(".align 2\n"
>>> +                            "1:\n"
>>> +                            "\taddi\t%0, %0, -1\n"
>>> +                            "\tbgtz\t%0, 1b\n"
>>> +                            :"=r"(loops)
>>> +                            :"0"(loops)); }
>>
>> Does the architecture define a high-resolution clock source? If yes, then it's better to use that to get exact timing than to rely on the loop calibration.
>>
> Dear Arnd:
>
> Thanks.
> I will modify it in the next version patch.
>
Sorry.
Our architecture does not define a high-resolution clock source.
At that time, I promised you because I thought maybe I can use SOC
defined clock source to replace it.
For portability, It is a terrible method.
 we will keep the original implementation for __delay() in the next
version patch.

Vincent
>>> +/*
>>> + * This file is generally used by user-level software, so you need to
>>> + * be a little careful about namespace pollution etc.  Also, we
>>> +cannot
>>> + * assume GCC is being used.
>>> + */
>>> +
>>> +typedef unsigned short __kernel_mode_t; #define __kernel_mode_t
>>> +__kernel_mode_t
>>> +
>>> +typedef unsigned short __kernel_ipc_pid_t; #define __kernel_ipc_pid_t
>>> +__kernel_ipc_pid_t
>>> +
>>> +typedef unsigned short __kernel_uid_t; typedef unsigned short
>>> +__kernel_gid_t; #define __kernel_uid_t __kernel_uid_t
>>> +
>>> +typedef unsigned short __kernel_old_dev_t; #define __kernel_old_dev_t
>>> +__kernel_old_dev_t
>>> +
>>> +#include <asm-generic/posix_types.h>
>>
>> I don't understand why you would want to override any of those.
>> Changing them unfortunately means rebuilding all of your user space, but I think it would be better to do that now than to suffer from this later on.
>>
>>     Arnd
>
> Thanks.
> I will remove them in the next version patch.
>
> Best regards
> Vincent

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-22  5:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-09 10:42 FW: [PATCH 24/31] nds32: Miscellaneous header files Vincent Chen
2017-11-22  5:45 ` Vincent Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).