linux-mips
[Top] [All Lists]

Re: [PATCH] MIPS: microMIPS: Refactor mips16 get_frame_info support

To: Tony Wu <tung7970@gmail.com>
Subject: Re: [PATCH] MIPS: microMIPS: Refactor mips16 get_frame_info support
From: David Daney <ddaney.cavm@gmail.com>
Date: Fri, 24 May 2013 10:30:13 -0700
Cc: ralf@linux-mips.org, Steven.Hill@imgtec.com, linux-mips@linux-mips.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=iQN31MTLa7fJGXI+Txj/m9afd8zh6ISmDulWuCwQwyQ=; b=Bk85gYQP9BcIBEH1xYlHh8fb0lDSjXbQhu7MczDTcT3/6m/8Y0toDsydkuplJDPCVE D5V9Qp4Z6dVhVpjZHUuMge5/158IeWhnGTizl4Ew74BB70gkadrJhiQlBYIqmaOjjd66 N4ivb/8turyGi456QTCtTYr5j+rFAoaVEZf8uO4VWlrOS063UKc0Xspgsos9kMuirknv vVlT20dmaplLXP+NWZ6t77OmblKyABNHHb0chyDFBVlSbGoGp6/ZAHJ3tHqtDuIjemH5 rph+dlMnDCSfiIWVlp2VCZLUw1dMMe870Z94Q3F6Bd0WbM8/Id3WkOst+cAAG3bLZ0bR toPg==
In-reply-to: <20130524145535.GA5369@hades>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20130524145535.GA5369@hades>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4
On 05/24/2013 07:55 AM, Tony Wu wrote:
[...]

Signed-off-by: Tony Wu <tung7970@gmail.com>
Cc: Steven J. Hill <Steven.Hill@imgtec.com>
---
  arch/mips/kernel/process.c |  214 +++++++++++++++++++++++++++++---------------
  1 file changed, 141 insertions(+), 73 deletions(-)

diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index c6a041d..c335a7f 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -211,14 +211,17 @@ struct mips_frame_info {
        int             pc_offset;
  };

+#ifdef CONFIG_CPU_MICROMIPS
+#define J_TARGET(pc,target)    \
+               (((unsigned long)(pc) & 0xf8000000) | ((target) << 1))
+#else
  #define J_TARGET(pc,target)   \
                (((unsigned long)(pc) & 0xf0000000) | ((target) << 2))
+#endif

I really dislike this #ifdefery.



  static inline int is_ra_save_ins(union mips_instruction *ip)
  {
  #ifdef CONFIG_CPU_MICROMIPS

And here too.

Would it be better to leave the existing objects alone, and add microMIPS functions and macros with new names?



[...]
+ * 2. access the fetched word using halfword (defeat endian issue)
+ * 3. assemble 16/32 bit MIPS16 instruction from halfword(s)
+ */
+static inline void MIPS16_fetch_halfword(union mips_instruction **ip,

No inline for any of these functions.

+                                        unsigned short *this_halfword,
+                                        unsigned short *prev_halfword)
+{
+       if (*prev_halfword) {
[...]
David Daney


<Prev in Thread] Current Thread [Next in Thread>