diff options
| author | Marc G. Fournier | 1997-03-12 21:13:19 +0000 |
|---|---|---|
| committer | Marc G. Fournier | 1997-03-12 21:13:19 +0000 |
| commit | 5dde558ce60db1f8747bbf745d56bd9cd5f4c7b7 (patch) | |
| tree | 046cc029a35d6e30af46ea08f8eae259eb739a8d /src/include | |
| parent | b66569e41fdecab3903fd8af6cbc8bb12ae653cd (diff) | |
From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] linux/alpha patches
These patches lay the groundwork for a Linux/Alpha port. The port doesn't
actually work unless you tweak the linker to put all the pointers in the
first 32 bits of the address space, but it's at least a start. It
implements the test-and-set instruction in Alpha assembly, and also fixes
a lot of pointer-to-integer conversions, which is probably good anyway.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/nodes/pg_list.h | 22 | ||||
| -rw-r--r-- | src/include/storage/ipc.h | 4 | ||||
| -rw-r--r-- | src/include/utils/memutils.h | 9 |
3 files changed, 24 insertions, 11 deletions
diff --git a/src/include/nodes/pg_list.h b/src/include/nodes/pg_list.h index d3bf7c0de96..b67b31bb194 100644 --- a/src/include/nodes/pg_list.h +++ b/src/include/nodes/pg_list.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pg_list.h,v 1.3 1996/11/04 07:18:19 scrappy Exp $ + * $Id: pg_list.h,v 1.4 1997/03/12 21:11:23 scrappy Exp $ * *------------------------------------------------------------------------- */ @@ -44,7 +44,10 @@ typedef struct Value { */ typedef struct List { NodeTag type; - void *elem; + union { + void *ptr_value; + int int_value; + } elem; struct List *next; } List; @@ -54,10 +57,15 @@ typedef struct List { * accessor macros * ---------------- */ -#define lfirst(l) ((l)->elem) + +/* anything that doesn't end in 'i' is assumed to be referring to the */ +/* pointer version of the list (where it makes a difference) */ +#define lfirst(l) ((l)->elem.ptr_value) #define lnext(l) ((l)->next) #define lsecond(l) (lfirst(lnext(l))) +#define lfirsti(l) ((l)->elem.int_value) + /* * foreach - * a convenience macro which loops through the list @@ -85,13 +93,13 @@ extern void freeList(List *list); extern void *nth(int n, List *l); extern void set_nth(List *l, int n, void *elem); -/* hack for now */ -#define lconsi(i,l) lcons((void*)(int)i,l) -#define lfirsti(l) ((int)lfirst(l)) -#define lappendi(l,i) lappend(l,(void*)i) +List *lconsi(int datum, List *list); +List *lappendi(List *list, int datum); extern bool intMember(int, List *); extern List *intAppend(List *list1, List *list2); +extern int nthi(int n, List *l); + extern List *nreverse(List *); extern List *set_difference(List *, List *); extern List *set_differencei(List *, List *); diff --git a/src/include/storage/ipc.h b/src/include/storage/ipc.h index 7cc11e0bafa..d0f17b92276 100644 --- a/src/include/storage/ipc.h +++ b/src/include/storage/ipc.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: ipc.h,v 1.15 1997/03/03 23:34:27 scrappy Exp $ + * $Id: ipc.h,v 1.16 1997/03/12 21:12:27 scrappy Exp $ * * NOTES * This file is very architecture-specific. This stuff should actually @@ -32,7 +32,7 @@ extern void S_LOCK(slock_t *lock); extern void S_UNLOCK(slock_t *lock); extern void S_INIT_LOCK(slock_t *lock); -#if defined(alpha) || \ +#if (defined(alpha) && !defined(linuxalpha)) || \ defined(hpux) || \ defined(irix5) || \ defined(nextstep) diff --git a/src/include/utils/memutils.h b/src/include/utils/memutils.h index a6dad68b222..b6f013cdbe1 100644 --- a/src/include/utils/memutils.h +++ b/src/include/utils/memutils.h @@ -15,7 +15,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: memutils.h,v 1.5 1997/03/04 05:32:26 scrappy Exp $ + * $Id: memutils.h,v 1.6 1997/03/12 21:13:19 scrappy Exp $ * * NOTES * some of the information in this file will be moved to @@ -67,7 +67,12 @@ s...) */ #if defined(sun) && ! defined(sparc) #define LONGALIGN(LEN) SHORTALIGN(LEN) -#elif defined (alpha) +#elif defined (alpha) || defined(linuxalpha) + /* even though "long alignment" should really be on 8-byte boundaries + * for linuxalpha, we want the strictest alignment to be on 4-byte (int) + * boundaries, because otherwise things break when they try to use the + * FormData_pg_* structures. --djm 12/12/96 + */ #define LONGALIGN(LEN)\ (((long)(LEN) + (sizeof (int) - 1)) & ~(sizeof (int) -1)) #else |
