public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] ftsmc020: enhance for features and asm support.
Date: Fri, 25 Mar 2011 10:03:15 +0100	[thread overview]
Message-ID: <20110325090315.1FFE41537B0@gemini.denx.de> (raw)
In-Reply-To: <50FD90C65C53FB45BADEEBCD84FF07F202EC05C3@ATCPCS06.andestech.com>

Dear macpaul at andestech.com,

In message <50FD90C65C53FB45BADEEBCD84FF07F202EC05C3@ATCPCS06.andestech.com> you wrote:
> >
> Neither I ran the command
> 
> "tools/scripts/make-asm-offsets include/faraday/ftsmc020.h
> include/faraday/ftsmc020-genasm.h"
> nor I ran
> sed -ne "/^->/{s:->#\(.*\):/* \1 */:; \
> s:^->\([^ ]*\) [\$#]*\([-0-9]*\) \(.*\):#define \1 (\2) /* \3 */:; \
> s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
> s:->::; p;}" include/faraday/ftsmc020-genasm.h could be work.
> 
> I also tested file faraday/ftpmu010.h.
> It get the same output with output 'sed: -e expression #1, char 47:
> unknown command: `['.'
> Did I execute the script in wrong method? Is there a problem about this
> script?

There is no (known) problem with it, but you have to be careful about
the context you are running in - the script as is is supposed to be
run in "make" context, which means different $ expansion rules then
when you try running directly under a shell.

> Moreover, the structure of ftsmc020 was nested like
> struct ftsmc020 {
>         struct {
>                 unsigned int    cr;     /* 0x00, 0x08, 0x10, 0x18 */
>                 unsigned int    tpr;    /* 0x04, 0x0c, 0x14, 0x1c */
>         } bank[4];
>         unsigned int    pad[8]; /* 0x20 - 0x3c */
>         unsigned int    ssr;    /* 0x40 */
> };
> 
> I didn't see the sed script could support this kind of nested structure
> declaration.
> I guess the sed script could be applied to plain structure declareation.
> Maybe I have a diffcult here.

You could simply un-nest the structure declarations.

> If the script is needed to be rewrote to adapt nested declaration,
> It might need have some complicaticity about parse difference kind of
> nested structure and array.

If I were in your situation I'd probably rather unnest the structs.

> It seems I need to rewrite the structure to be adaptable to the sed
> script.

That seems straightforward to do, indeed.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Whoever undertakes to set himself up as a judge of Truth  and  Know-
ledge is shipwrecked by the laughter of the gods."  - Albert Einstein

  reply	other threads:[~2011-03-25  9:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-25  8:33 [U-Boot] [PATCH] ftsmc020: enhance for features and asm support macpaul at andestech.com
2011-03-25  9:03 ` Wolfgang Denk [this message]
2011-03-31  2:38   ` Macpaul Lin
2011-03-31  6:48     ` Wolfgang Denk
2011-03-31  8:12       ` Macpaul Lin
2011-03-31  8:24         ` Wolfgang Denk
     [not found]           ` <AANLkTinYJhoGrA7ZAVUQxwByrkWNqomCBFWiJG_+3+0e@mail.gmail.com>
2011-03-31  9:02             ` Wolfgang Denk
2011-04-01  7:58               ` Macpaul Lin
  -- strict thread matches above, loose matches on Subject: below --
2011-03-24 11:25 Macpaul Lin
2011-03-24 13:21 ` Wolfgang Denk

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=20110325090315.1FFE41537B0@gemini.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox