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.
This commit is contained in:
parent
127826978a
commit
b66569e41f
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.12 1996/11/10 02:56:51 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.13 1997/03/12 20:56:32 scrappy Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -62,13 +62,13 @@ index_keytest(IndexTuple tuple,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (key[0].sk_flags & SK_COMMUTE) {
|
if (key[0].sk_flags & SK_COMMUTE) {
|
||||||
test = (int) (*(key[0].sk_func))
|
test = (*(key[0].sk_func))
|
||||||
(DatumGetPointer(key[0].sk_argument),
|
(DatumGetPointer(key[0].sk_argument),
|
||||||
datum);
|
datum) ? 1 : 0;
|
||||||
} else {
|
} else {
|
||||||
test = (int) (*(key[0].sk_func))
|
test = (*(key[0].sk_func))
|
||||||
(datum,
|
(datum,
|
||||||
DatumGetPointer(key[0].sk_argument));
|
DatumGetPointer(key[0].sk_argument)) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!test == !(key[0].sk_flags & SK_NEGATE)) {
|
if (!test == !(key[0].sk_flags & SK_NEGATE)) {
|
||||||
|
@ -250,14 +250,14 @@ gistindex_keytest(IndexTuple tuple,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (key[0].sk_flags & SK_COMMUTE) {
|
if (key[0].sk_flags & SK_COMMUTE) {
|
||||||
test = (int) (*(key[0].sk_func))
|
test = (*(key[0].sk_func))
|
||||||
(DatumGetPointer(key[0].sk_argument),
|
(DatumGetPointer(key[0].sk_argument),
|
||||||
&de, key[0].sk_procedure);
|
&de, key[0].sk_procedure) ? 1 : 0;
|
||||||
} else {
|
} else {
|
||||||
test = (int) (*(key[0].sk_func))
|
test = (*(key[0].sk_func))
|
||||||
(&de,
|
(&de,
|
||||||
DatumGetPointer(key[0].sk_argument),
|
DatumGetPointer(key[0].sk_argument),
|
||||||
key[0].sk_procedure);
|
key[0].sk_procedure) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!test == !(key[0].sk_flags & SK_NEGATE)) {
|
if (!test == !(key[0].sk_flags & SK_NEGATE)) {
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.15 1997/01/24 22:42:30 scrappy Exp $
|
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.16 1997/03/12 20:57:33 scrappy Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -485,7 +485,7 @@ boot_openrel(char *relname)
|
|||||||
|
|
||||||
if (!Quiet)
|
if (!Quiet)
|
||||||
printf("Amopen: relation %s. attrsize %d\n", relname,
|
printf("Amopen: relation %s. attrsize %d\n", relname,
|
||||||
ATTRIBUTE_TUPLE_SIZE);
|
(int)ATTRIBUTE_TUPLE_SIZE);
|
||||||
|
|
||||||
reldesc = heap_openr(relname);
|
reldesc = heap_openr(relname);
|
||||||
Assert(reldesc);
|
Assert(reldesc);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.6 1997/01/22 05:26:50 vadim Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.7 1997/03/12 20:58:26 scrappy Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -905,7 +905,7 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
|
|||||||
for (i=0; i < numIndices; i++) {
|
for (i=0; i < numIndices; i++) {
|
||||||
Oid indexOid;
|
Oid indexOid;
|
||||||
|
|
||||||
indexOid = (Oid)nth(i, indxid);
|
indexOid = (Oid)nthi(i, indxid);
|
||||||
|
|
||||||
if (indexOid != 0) {
|
if (indexOid != 0) {
|
||||||
ExecOpenScanR(indexOid, /* relation */
|
ExecOpenScanR(indexOid, /* relation */
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.2 1996/12/20 20:31:31 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.3 1997/03/12 20:59:27 scrappy Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* XXX a few of the following functions are duplicated to handle
|
* XXX a few of the following functions are duplicated to handle
|
||||||
@ -65,12 +65,27 @@ lcons(void *obj, List *list)
|
|||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List *
|
||||||
|
lconsi(int datum, List *list)
|
||||||
|
{
|
||||||
|
List *l = makeNode(List);
|
||||||
|
lfirsti(l) = datum;
|
||||||
|
lnext(l) = list;
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
|
||||||
List *
|
List *
|
||||||
lappend(List *list, void *obj)
|
lappend(List *list, void *obj)
|
||||||
{
|
{
|
||||||
return nconc(list, lcons(obj, NIL));
|
return nconc(list, lcons(obj, NIL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List *
|
||||||
|
lappendi(List *list, int datum)
|
||||||
|
{
|
||||||
|
return nconc(list, lconsi(datum, NIL));
|
||||||
|
}
|
||||||
|
|
||||||
Value *
|
Value *
|
||||||
makeInteger(long i)
|
makeInteger(long i)
|
||||||
{
|
{
|
||||||
@ -110,6 +125,17 @@ nth(int n, List *l)
|
|||||||
return lfirst(l);
|
return lfirst(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
nthi(int n, List *l)
|
||||||
|
{
|
||||||
|
/* XXX assume list is long enough */
|
||||||
|
while(n > 0) {
|
||||||
|
l = lnext(l);
|
||||||
|
n--;
|
||||||
|
}
|
||||||
|
return lfirsti(l);
|
||||||
|
}
|
||||||
|
|
||||||
/* this is here solely for rt_store. Get rid of me some day! */
|
/* this is here solely for rt_store. Get rid of me some day! */
|
||||||
void
|
void
|
||||||
set_nth(List *l, int n, void *elem)
|
set_nth(List *l, int n, void *elem)
|
||||||
@ -244,7 +270,7 @@ same(List *foo, List *bar)
|
|||||||
return (foo==NULL);
|
return (foo==NULL);
|
||||||
if (length(foo) == length(bar)) {
|
if (length(foo) == length(bar)) {
|
||||||
foreach (temp,foo) {
|
foreach (temp,foo) {
|
||||||
if (!intMember((int)lfirst(temp),bar))
|
if (!intMember(lfirsti(temp),bar))
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
return(true);
|
return(true);
|
||||||
@ -297,7 +323,7 @@ LispUnioni(List *foo, List *bar)
|
|||||||
foreach (i,foo) {
|
foreach (i,foo) {
|
||||||
foreach (j,bar) {
|
foreach (j,bar) {
|
||||||
if (lfirsti(i) != lfirsti(j)) {
|
if (lfirsti(i) != lfirsti(j)) {
|
||||||
retval = lappendi(retval,lfirst(i));
|
retval = lappendi(retval,lfirsti(i));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -329,7 +355,7 @@ intMember(int foo, List *bar)
|
|||||||
{
|
{
|
||||||
List *i;
|
List *i;
|
||||||
foreach (i,bar)
|
foreach (i,bar)
|
||||||
if (foo == (int)lfirst(i))
|
if (foo == lfirsti(i))
|
||||||
return(true);
|
return(true);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
@ -388,13 +414,13 @@ intLispRemove(int elem, List *list)
|
|||||||
List *temp = NIL;
|
List *temp = NIL;
|
||||||
List *prev = NIL;
|
List *prev = NIL;
|
||||||
|
|
||||||
if (elem == (int)lfirst(list))
|
if (elem == lfirsti(list))
|
||||||
return lnext(list);
|
return lnext(list);
|
||||||
|
|
||||||
temp = lnext(list);
|
temp = lnext(list);
|
||||||
prev = list;
|
prev = list;
|
||||||
while(temp!=NIL) {
|
while(temp!=NIL) {
|
||||||
if (elem == (int)lfirst(temp)) {
|
if (elem == lfirsti(temp)) {
|
||||||
lnext(prev) = lnext(temp);
|
lnext(prev) = lnext(temp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -431,7 +457,7 @@ set_differencei(List *list1, List *list2)
|
|||||||
|
|
||||||
foreach (temp1, list1) {
|
foreach (temp1, list1) {
|
||||||
if (!intMember(lfirsti(temp1), list2))
|
if (!intMember(lfirsti(temp1), list2))
|
||||||
result = lappendi(result, lfirst(temp1));
|
result = lappendi(result, lfirsti(temp1));
|
||||||
}
|
}
|
||||||
return(result);
|
return(result);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.5 1997/01/22 06:25:42 vadim Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.6 1997/03/12 21:00:17 scrappy Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1045,7 +1045,7 @@ index_innerjoin(Query *root, Rel *rel, List *clausegroup_list, Rel *index)
|
|||||||
index_selectivity(lfirsti(index->relids),
|
index_selectivity(lfirsti(index->relids),
|
||||||
index->classlist,
|
index->classlist,
|
||||||
get_opnos(clausegroup),
|
get_opnos(clausegroup),
|
||||||
getrelid((int)lfirst(rel->relids),
|
getrelid(lfirsti(rel->relids),
|
||||||
root->rtable),
|
root->rtable),
|
||||||
attnos,
|
attnos,
|
||||||
values,
|
values,
|
||||||
@ -1061,7 +1061,7 @@ index_innerjoin(Query *root, Rel *rel, List *clausegroup_list, Rel *index)
|
|||||||
pathnode->path.joinid = ((CInfo*)lfirst(clausegroup))->cinfojoinid;
|
pathnode->path.joinid = ((CInfo*)lfirst(clausegroup))->cinfojoinid;
|
||||||
|
|
||||||
pathnode->path.path_cost =
|
pathnode->path.path_cost =
|
||||||
cost_index((Oid)lfirst(index->relids),
|
cost_index((Oid)lfirsti(index->relids),
|
||||||
(int)temp_pages,
|
(int)temp_pages,
|
||||||
temp_selec,
|
temp_selec,
|
||||||
rel->pages,
|
rel->pages,
|
||||||
@ -1150,7 +1150,7 @@ add_index_paths(List *indexpaths, List *new_indexpaths)
|
|||||||
static bool
|
static bool
|
||||||
function_index_operand(Expr *funcOpnd, Rel *rel, Rel *index)
|
function_index_operand(Expr *funcOpnd, Rel *rel, Rel *index)
|
||||||
{
|
{
|
||||||
Oid heapRelid = (Oid)lfirst(rel->relids);
|
Oid heapRelid = (Oid)lfirsti(rel->relids);
|
||||||
Func *function;
|
Func *function;
|
||||||
List *funcargs;
|
List *funcargs;
|
||||||
int *indexKeys = index->indexkeys;
|
int *indexKeys = index->indexkeys;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user