Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: SH7034 and File API
From: Alan Korr (post_at_pegasmail.com)
Date: 2002-03-28


>> Just a request :
>> I prefer to be able to choose a byte or a word access thru
>> on-chip addresses depending what I need to do. So avoid to
>> defines this address with a fixed size access.
>
>I am a little curious, since I am new to this processor. When it is
>interesting to select between byte and word accesses on a single on-chip
>address?

When I use 'clear_bit' or 'set-bit', I use a byte access because it is the only way to use atomic READ-MODIFY-WRITE operation on SH1.

When I want to setup values for ports A and B, I prefer to use a 32-bit word access to setup both instead of two 16-bit words accesses for each (more compact and clever code).

I chose to use gcc convention :

- SI : single integer => 32-bit word
- HI : half interger => 16-bit word
- QI : quarter (?) integer => 8-bit word

So when I want access one port as a byte, just do :

  value = QI(port_address);
or
  QI(port_address) = value;

Quite a simple and clear form, isn't it ?

To be flexible enough is not a crime :).

>>>Yes. Did anyone of you filesystem fiddlers (Linus, Alan,
>> anyone?) think in terms of upper level api yet? I mean, not
>> the specific details but in concepts?
>>
>> Too early. I prefer to do things in incremental order :
>
>I agree. First things first.

Daniel, don't wait for us to have a file API if you need one.

I first want to explore how to implement a clever way to handle file and folder with a maximal efficiency and a minimal waste space, before proposing a file API. So be free to have yours for the moment.

_______________________________________________________________________
This mail was sent using http://www.pegasmail.com - Send Your Mail Now!



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa