Project

General

Profile

Actions

Feature #497

open

Ajouter une fonction retournant l'etat du cache

Added by Veronique bouzid over 9 years ago. Updated over 9 years ago.

Status:
In Progress
Priority:
Normal
Target version:
-
Start date:
18/09/2015
Due date:
% Done:

0%

Estimated time:
Actions #1

Updated by Alexis Jeandet over 9 years ago

  • Status changed from New to In Progress

J'ai ajouté la fonction:

 bool cacheIsEnable();


Il faut noter aussi que cette fonction vérifie si le DCache et le ICache sont activés en même temps.

Le patch pour cette fonction:

diff -r 039eabb0d39f dsu3plugin/dsu3plugin.cpp
--- a/dsu3plugin/dsu3plugin.cpp    Tue Sep 15 09:03:48 2015 +0200
+++ b/dsu3plugin/dsu3plugin.cpp    Fri Sep 18 17:03:22 2015 +0200
@@ -170,6 +170,18 @@
     return setCacheEnable(true);
 }

+bool dsu3plugin::cacheIsEnable()
+{
+    if(parent==NULL)
+        return false;
+    unsigned int DSUBASEADDRESS = SocExplorerEngine::self()->getEnumDeviceBaseAddress(this,0x01 , 0x004,0);
+    if(DSUBASEADDRESS == (unsigned int)-1)
+        DSUBASEADDRESS = 0x90000000;
+    WriteRegs(uIntlist()<<2,DSUBASEADDRESS+0x400024);
+    unsigned int reg = ReadReg(DSUBASEADDRESS+0x700000);
+    return ((reg&0x0F)==0x0F);
+}
+
 bool dsu3plugin::setCacheEnable(bool enabled)
 {
     if(parent==NULL)
diff -r 039eabb0d39f dsu3plugin/dsu3plugin.h
--- a/dsu3plugin/dsu3plugin.h    Tue Sep 15 09:03:48 2015 +0200
+++ b/dsu3plugin/dsu3plugin.h    Fri Sep 18 17:03:22 2015 +0200
@@ -49,6 +49,7 @@
     bool configureTarget();
     bool cacheDisable();
     bool cacheEnable();
+    bool cacheIsEnable();
     bool setCacheEnable(bool enabled);
     bool flashTarget();
     void run();

Actions

Also available in: Atom PDF