public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
From: "Dave Brolley" <brolley@redhat.com>
To: <sid@sources.redhat.com>
Subject: [patch] Better checking for cache line state
Date: Mon, 10 May 2004 21:56:00 -0000	[thread overview]
Message-ID: <200405102156.i4ALuNcU015081@pobox.toronto.redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 277 bytes --]

Hi,

On the target I'm working on, the programmer can directly write into the
cache tags. This requires more vigilance regarding the state of the cache
tags. Specifically, we should check the result of valid_p () before using
the tag.

I've committed the attached patch.

Dave

[-- Attachment #2: sid-cache.patch.txt --]
[-- Type: text/plain, Size: 1290 bytes --]

Index: sid/component/cache/cacheutil.cxx
===================================================================
RCS file: /cvs/src/src/sid/component/cache/cacheutil.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -c -p -r1.8 -r1.9
*** sid/component/cache/cacheutil.cxx	29 Apr 2004 20:26:08 -0000	1.8
--- sid/component/cache/cacheutil.cxx	10 May 2004 21:51:10 -0000	1.9
*************** cache_set::find_any_dirty ()
*** 189,195 ****
    for (iterator_t it = lines.begin (); it != lines.end (); it++)
      {
        cache_line* i = * it;
!       if (i->dirty_p ()) return i;
      }
  
    return 0;
--- 189,195 ----
    for (iterator_t it = lines.begin (); it != lines.end (); it++)
      {
        cache_line* i = * it;
!       if (i->valid_p () && i->dirty_p ()) return i;
      }
  
    return 0;
*************** bool
*** 206,212 ****
  cache_set::vacancy_p () const
  {
    for (const_iterator_t it = lines.begin (); it != lines.end (); it++)
!     if (!(*it)->locked_p ())
        return true;
  
    return false;
--- 206,212 ----
  cache_set::vacancy_p () const
  {
    for (const_iterator_t it = lines.begin (); it != lines.end (); it++)
!     if (!(*it)->valid_p () || !(*it)->locked_p ())
        return true;
  
    return false;

             reply	other threads:[~2004-05-10 21:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-10 21:56 Dave Brolley [this message]
2004-05-10 23:15 ` Ben Elliston

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=200405102156.i4ALuNcU015081@pobox.toronto.redhat.com \
    --to=brolley@redhat.com \
    --cc=sid@sources.redhat.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).