lkml.org 
[lkml]   [2015]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86/asm/entry/64: Merge the field offset into the THREAD_INFO() macro

* Denys Vlasenko <dvlasenk@redhat.com> wrote:

> On 03/24/2015 07:44 PM, Ingo Molnar wrote:
> > From 11e2761ba0969466299b7109eba749d2292e8796 Mon Sep 17 00:00:00 2001
> > From: Ingo Molnar <mingo@kernel.org>
> > Date: Tue, 24 Mar 2015 19:18:41 +0100
> > Subject: [PATCH] x86/asm/entry/64: Merge the field offset into the THREAD_INFO() macro
> >
> > Before:
> >
> > TI_sysenter_return+THREAD_INFO(%rsp,3*8),%r10d
> >
> > After:
> >
> > movl THREAD_INFO(TI_sysenter_return, %rsp, 3*8), %r10d
> >
> > to turn it into a clear thread_info accessor.
>
> Good idea, I also wanted to do this.
> I propose a more C-like order of arguments instead.
> In C, field names are on the right: obj.field, ptr->field.
>
> THREAD_INFO(%rsp, 3*8, TI_field_name)
>
> would suggest to the reader a pseudo-C construct:
>
> THREAD_INFO(sp, offset)->field_name

So I picked that order, because the C code we want to emulate here
visually is:

thread_info->field_name

and visually this order represents just that:

THREAD_INFO(TI_field_name, ...)

" ,%reg, offset" in that sense is just a 'detail' to how to access
thread_info.

That order also resembles the assembly format more, which is usually
in field(reg) order, i.e.:

THREAD_INFO(field, %reg, ...)

Hm?

Thanks,

Ingo


\
 
 \ /
  Last update: 2015-03-24 20:41    [W:0.064 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site