Rewrite Linux insque/remque support again.

This commit is contained in:
Michael Meissner 1995-02-16 21:09:22 +00:00
parent 3aa3c59383
commit 92c6bf4d3a
2 changed files with 23 additions and 19 deletions

View file

@ -1,3 +1,7 @@
Thu Feb 16 16:06:50 1995 Michael Meissner <meissner@tiktok.cygnus.com>
* dcache.c (insque, remque): Rewrite Linux support.
Wed Feb 15 12:33:20 1995 Michael Meissner <meissner@tiktok.cygnus.com> Wed Feb 15 12:33:20 1995 Michael Meissner <meissner@tiktok.cygnus.com>
* config/powerpc/tm-ppc-eabi.h (TEXT_SEGMENT_BASE): Define as 1. * config/powerpc/tm-ppc-eabi.h (TEXT_SEGMENT_BASE): Define as 1.

View file

@ -23,20 +23,20 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "dcache.h" #include "dcache.h"
#include "gdbcmd.h" #include "gdbcmd.h"
#if defined(__STDC__) && defined(__linux__) int remote_dcache = 0;
#if defined(__linux__)
/* In case the system header files define a prototype for insque and /* In case the system header files define a prototype for insque and
remque that uses a pointer to a struct qelem, silence the warnings */ remque that uses a pointer to a struct qelem, silence the warnings */
struct qelem; struct qelem;
#define insque(a,b) (insque)((struct qelem *)(a), (struct qelem *)(b)) #define Insque(a,b) insque((struct qelem *)(a), (struct qelem *)(b))
#define remque(a) (remque)((struct qelem *)(a)) #define Remque(a) remque((struct qelem *)(a))
#else #else
#define Insque(a,b) insque(a, b)
extern int insque(); #define Remque(a) remque(a)
extern int remque();
#endif #endif
int remote_dcache = 0;
/* The data cache records all the data read from the remote machine /* The data cache records all the data read from the remote machine
since the last time it stopped. since the last time it stopped.
@ -56,8 +56,8 @@ dcache_flush (dcache)
if (remote_dcache > 0) if (remote_dcache > 0)
while ((db = dcache->dcache_valid.next) != &dcache->dcache_valid) while ((db = dcache->dcache_valid.next) != &dcache->dcache_valid)
{ {
remque (db); Remque (db);
insque (db, &dcache->dcache_free); Insque (db, &dcache->dcache_free);
} }
return; return;
@ -126,12 +126,12 @@ dcache_alloc (dcache)
/* If we can't get one from the free list, take last valid and put /* If we can't get one from the free list, take last valid and put
it on the free list. */ it on the free list. */
db = dcache->dcache_valid.last; db = dcache->dcache_valid.last;
remque (db); Remque (db);
insque (db, &dcache->dcache_free); Insque (db, &dcache->dcache_free);
} }
remque (db); Remque (db);
insque (db, &dcache->dcache_valid); Insque (db, &dcache->dcache_valid);
return (db); return (db);
} }
@ -160,8 +160,8 @@ dcache_fetch (dcache, addr)
(*dcache->read_memory) (addr & ~LINE_SIZE_MASK, (unsigned char *) db->data, LINE_SIZE); (*dcache->read_memory) (addr & ~LINE_SIZE_MASK, (unsigned char *) db->data, LINE_SIZE);
immediate_quit--; immediate_quit--;
db->addr = addr & ~LINE_SIZE_MASK; db->addr = addr & ~LINE_SIZE_MASK;
remque (db); /* Off the free list */ Remque (db); /* Off the free list */
insque (db, &dcache->dcache_valid); /* On the valid list */ Insque (db, &dcache->dcache_valid); /* On the valid list */
} }
return (dcache_value (db, addr)); return (dcache_value (db, addr));
} }
@ -190,8 +190,8 @@ dcache_poke (dcache, addr, data)
(*dcache->write_memory) (addr & ~LINE_SIZE_MASK, (unsigned char *) db->data, LINE_SIZE); (*dcache->write_memory) (addr & ~LINE_SIZE_MASK, (unsigned char *) db->data, LINE_SIZE);
immediate_quit--; immediate_quit--;
db->addr = addr & ~LINE_SIZE_MASK; db->addr = addr & ~LINE_SIZE_MASK;
remque (db); /* Off the free list */ Remque (db); /* Off the free list */
insque (db, &dcache->dcache_valid); /* On the valid list */ Insque (db, &dcache->dcache_valid); /* On the valid list */
} }
/* Modify the word in the cache. */ /* Modify the word in the cache. */
@ -222,7 +222,7 @@ dcache_init (reading, writing)
dcache->dcache_free.next = dcache->dcache_free.last = &dcache->dcache_free; dcache->dcache_free.next = dcache->dcache_free.last = &dcache->dcache_free;
dcache->dcache_valid.next = dcache->dcache_valid.last = &dcache->dcache_valid; dcache->dcache_valid.next = dcache->dcache_valid.last = &dcache->dcache_valid;
for (db = dcache->the_cache, i = 0; i < DCACHE_SIZE; i++, db++) for (db = dcache->the_cache, i = 0; i < DCACHE_SIZE; i++, db++)
insque (db, &dcache->dcache_free); Insque (db, &dcache->dcache_free);
return(dcache); return(dcache);
} }