All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zachary Amsden <zach@vmware.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andi Kleen <ak@muc.de>,
	kvm-devel <kvm-devel@lists.sourceforge.net>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 2/3] i386: use x86_64's desc_def.h
Date: Wed, 18 Jul 2007 09:19:45 -0700	[thread overview]
Message-ID: <469E3DA1.3010600@vmware.com> (raw)
In-Reply-To: <1184743422.10380.114.camel@localhost.localdomain>

Rusty Russell wrote:
> The main effect is to change the definition of "struct desc_struct" to
> a union of more complex types.
>   

Yay!  Someone finally killed it.  Every time I tried to kill it, I ended 
up off in the weeds chasing some bug.

>  
> diff -r 656f3ff2c9ce arch/i386/kernel/process.c
> @@ -880,21 +880,8 @@ asmlinkage int sys_set_thread_area(struc
>   * Get the current Thread-Local Storage area:
>   */
>  
> -#define GET_BASE(desc) ( \
> -	(((desc)->a >> 16) & 0x0000ffff) | \
> -	(((desc)->b << 16) & 0x00ff0000) | \
> -	( (desc)->b        & 0xff000000)   )
> -
> -#define GET_LIMIT(desc) ( \
> -	((desc)->a & 0x0ffff) | \
> -	 ((desc)->b & 0xf0000) )
> -	
> -#define GET_32BIT(desc)		(((desc)->b >> 22) & 1)
> -#define GET_CONTENTS(desc)	(((desc)->b >> 10) & 3)
> -#define GET_WRITABLE(desc)	(((desc)->b >>  9) & 1)
> -#define GET_LIMIT_PAGES(desc)	(((desc)->b >> 23) & 1)
> -#define GET_PRESENT(desc)	(((desc)->b >> 15) & 1)
> -#define GET_USEABLE(desc)	(((desc)->b >> 20) & 1)
> +#define GET_CONTENTS(desc)	(((desc)->raw32.b >> 10) & 3)
> +#define GET_WRITABLE(desc)	(((desc)->raw32.b >>  9) & 1)
>  
> diff -r 656f3ff2c9ce arch/i386/kernel/ptrace.c
> --- a/arch/i386/kernel/ptrace.c	Wed Jul 18 16:21:04 2007 +1000
> +++ b/arch/i386/kernel/ptrace.c	Wed Jul 18 16:21:06 2007 +1000
> @@ -283,22 +283,8 @@ ptrace_get_thread_area(struct task_struc
>  /*
>   * Get the current Thread-Local Storage area:
>   */
> -
> -#define GET_BASE(desc) ( \
> -	(((desc)->a >> 16) & 0x0000ffff) | \
> -	(((desc)->b << 16) & 0x00ff0000) | \
> -	( (desc)->b        & 0xff000000)   )
> -
> -#define GET_LIMIT(desc) ( \
> -	((desc)->a & 0x0ffff) | \
> -	 ((desc)->b & 0xf0000) )
> -
> -#define GET_32BIT(desc)		(((desc)->b >> 22) & 1)
> -#define GET_CONTENTS(desc)	(((desc)->b >> 10) & 3)
> -#define GET_WRITABLE(desc)	(((desc)->b >>  9) & 1)
> -#define GET_LIMIT_PAGES(desc)	(((desc)->b >> 23) & 1)
> -#define GET_PRESENT(desc)	(((desc)->b >> 15) & 1)
> -#define GET_USEABLE(desc)	(((desc)->b >> 20) & 1)
> +#define GET_CONTENTS(desc)	(((desc)->raw32.b >> 10) & 3)
> +#define GET_WRITABLE(desc)	(((desc)->raw32.b >>  9) & 1)
>   

You got rid of the duplicate definitions here, but then added new 
duplicates (GET_CONTENTS / WRITABLE).  Can you stick them in desc.h?

Zach

  parent reply	other threads:[~2007-07-18 16:31 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-18  7:22 [PATCH 1/3] Standardize x86_64's desc_defs.h in preparation for exposure to i386 Rusty Russell
2007-07-18  7:22 ` Rusty Russell
2007-07-18  7:23 ` [PATCH 2/3] i386: use x86_64's desc_def.h Rusty Russell
2007-07-18  7:23   ` Rusty Russell
2007-07-18  7:30   ` [PATCH 3/3] i386: Replace struct Xgt_desc_struct with struct desc_ptr Rusty Russell
2007-07-18  7:30     ` Rusty Russell
2007-07-21  1:33     ` Chris Wright
2007-07-21  1:33       ` Chris Wright
2007-07-18 16:19   ` Zachary Amsden [this message]
2007-07-18 23:27     ` [PATCH 2/3] i386: use x86_64's desc_def.h Rusty Russell
2007-07-18 23:27       ` Rusty Russell
2007-07-18 23:29       ` Rusty Russell
2007-07-18 23:29         ` Rusty Russell
2007-07-21  1:32         ` Chris Wright
2007-07-21  1:32           ` Chris Wright
2007-07-19  0:00       ` Andi Kleen
2007-07-19  0:00         ` Andi Kleen
2007-07-18  9:03 ` [PATCH 1/3] Standardize x86_64's desc_defs.h in preparation for exposure to i386 Andi Kleen
2007-07-18  9:03   ` Andi Kleen
2007-07-18 11:44   ` Rusty Russell
2007-07-18 11:44     ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=469E3DA1.3010600@vmware.com \
    --to=zach@vmware.com \
    --cc=ak@muc.de \
    --cc=akpm@linux-foundation.org \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.