This is the mail archive of the sid@sources.redhat.com mailing list for the SID project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

API change for bus latency


I am about to commit the following change to sidcomp.h that expands
the type "sid::bus::status" to include latency information, which
clients may manipulate as they see fit.

Documentation and testsuite updates will be included, of course.

Ben


2001-06-21  Ben Elliston  <bje@redhat.com>

	* sidcomp.h (API_MAJOR_VERSION): Bump to 3.
	(API_MINOR_VERSION): Zero.
	(bus::status_t): New name for enum status.
	(bus::status): New struct.

Index: sidcomp.h
===================================================================
RCS file: /cvs/cvsfiles/devo/sid/include/sidcomp.h,v
retrieving revision 1.32
diff -u -r1.32 sidcomp.h
--- sidcomp.h   2000/12/01 16:32:41     1.32
+++ sidcomp.h   2001/06/21 05:30:22
@@ -1,7 +1,7 @@
 // sidcomp.h - Define the external interface of a SID component, that
 // is, the SID component API expressed in -*- C++ -*-.
 
-// Copyright (C) 1999, 2000 Red Hat.
+// Copyright (C) 1999, 2000, 2001 Red Hat.
 // This file is part of SID and is licensed under the GPL.
 // See the file COPYING.SID for conditions for redistribution.
 
@@ -22,8 +22,8 @@
   // COMPONENT_LIBRARY_MAGIC mechanism in sidso.h, and prevents
   // interopration attempts with obsolete component objects.
 
-  const unsigned API_MAJOR_VERSION = 2;
-  const unsigned API_MINOR_VERSION = 2;
+  const unsigned API_MAJOR_VERSION = 3;
+  const unsigned API_MINOR_VERSION = 0;
 
   // PART 1: Buses
   //
@@ -39,7 +39,7 @@
   {
   public:
     // status values from read/write calls.
-    enum status
+    enum status_t
     {
       ok           = 0x00, // done, no problems
       misaligned   = 0x01, // address misaligned
@@ -47,7 +47,21 @@
       unpermitted  = 0x04, // may not read or may not write at
address
       delayed      = 0x10, // data not yet available - try again
after yielding
     };
-    
+
+    struct status
+    {
+      status ()
+       :code (ok), latency (0) {}
+      status (enum status_t c)
+       :code (c), latency (0) {}
+      status (enum status_t c, host_int_2 lat)
+          :code (c), latency (lat) {}
+      operator int() const { return static_cast<int>(code); }
+
+      enum status_t code;
+      host_int_2 latency;
+    };
+
 
     // These member functions enumerate the Cartesian product of all
     // possible access requests to a bus:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]