em64t support

(Logical change 1.141)


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@505 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Steven Dake 2005-02-27 06:27:31 +00:00
parent 2d3783e067
commit 4196c44187
15 changed files with 92 additions and 57 deletions

View File

@ -1,4 +1,4 @@
# Copyright (c) 2002-2004 MontaVista Software, Inc.
# Copyright (c) 2002-2005 MontaVista Software, Inc.
#
# All rights reserved.
#
@ -29,16 +29,16 @@
# THE POSSIBILITY OF SUCH DAMAGE.
# Production mode flags
CFLAGS = -O3 -Wall -fomit-frame-pointer -fPIC
CFLAGS = -O3 -Wall -fomit-frame-pointer
LDFLAGS =
# Debug mode flags
#CFLAGS = -g -Wall -fPIC
#CFLAGS = -g -Wall
##-DDEBUG
#LDFLAGS = -g -fPIC
#LDFLAGS = -g
# Profile mode flags
#CFLAGS = -O2 -pg -fPIC
#CFLAGS = -O2 -pg
#LDFLAGS = -pg
# Code Coverage with lcov flgs
@ -51,14 +51,15 @@ TOTEM_OBJS = aispoll.o totemsrp.o totempg.o tlist.o hdb.o crypto.o
EXEC_SRC = main.c clm.c amf.c ckpt.c evt.c evs.c parse.c print.c mempool.c \
util.c
EXEC_OBJS = main.o clm.o amf.o ckpt.o evt.o evs.o parse.o print.o mempool.o \
util.o libtotem.a
util.o
EXEC_LIBS = libtotem.a
OBJS = $(TOTEM_OBJS) $(EXEC_OBJS)
all:libtotem.a libtotem.so.1.0 aisexec keygen
aisexec: $(EXEC_OBJS)
$(CC) $(LDFLAGS) $(EXEC_OBJS) $(LIBS) -o aisexec
$(CC) $(LDFLAGS) $(EXEC_OBJS) $(EXEC_LIBS) -o aisexec
libtotem.a: $(TOTEM_OBJS)
$(AR) -rc libtotem.a $(TOTEM_OBJS)
@ -78,8 +79,25 @@ clean:
depend:
makedepend -Y -- $(CFLAGS) $(EXEC_SRC) $(TOTEM_SRC) > /dev/null 2>&1
%.o: %.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
# -fPIC rules required for lib totem
aispoll.o: aispoll.c
$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
totemsrp.o: totemsrp.c
$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
totempg.o: totempg.c
$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
tlist.o: tlist.c
$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
hdb.o: hdb.c
$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
crypto.o: crypto.c
$(CC) $(CFLAGS) -fPIC -c -o $@ $(*F).c
# DO NOT DELETE
main.o: ../include/ais_types.h ../include/ais_msg.h ../include/ais_types.h

View File

@ -2846,9 +2846,6 @@ static void messages_deliver_to_app (int skip, int *start_point, int end_point)
sort_queue_item_p = ptr;
mcast = sort_queue_item_p->iovec[0].iov_base;
if (mcast == (struct mcast *)0xdeadbeef) {
printf ("seq %d\n", sort_queue_item_p->iovec[0].iov_len);
}
assert (mcast != (struct mcast *)0xdeadbeef);
/*

View File

@ -36,7 +36,7 @@
#include <netinet/in.h>
typedef unsigned long long evs_handle_t;
typedef uint64_t evs_handle_t;
typedef enum {
EVS_DISPATCH_ONE,

View File

@ -1,4 +1,4 @@
# Copyright (c) 2002-2004 MontaVista Software, Inc.
# Copyright (c) 2002-2005 MontaVista Software, Inc.
#
# All rights reserved.
#
@ -62,7 +62,7 @@ libais.so.1.0: util.o amf.o clm.o ckpt.o evt.o
ln -s libais.so.1.0 libais.so.1
ln -s libais.so.1.0 libais.so
libevs.a: util.o amf.o evs.o
libevs.a: util.o evs.o
$(AR) -rc libevs.a util.o evs.o
libevs.so.1.0: util.o evs.o

View File

@ -358,7 +358,6 @@ error_unlock:
pthread_mutex_unlock (&clmInstance->mutex);
error_put:
saHandleInstancePut (&clmHandleDatabase, clmHandle);
error_nounlock:
return (error);
}

View File

@ -46,6 +46,11 @@
#include "saCkpt.h"
int ckptinv;
struct thread_data {
int thread_no;
};
void printSaNameT (SaNameT *name)
{
int i;
@ -148,14 +153,14 @@ SaCkptIOVectorElementT WriteVectorElements[] = {
void *th_dispatch (void *arg)
{
int th = (int)arg;
struct thread_data *td = (struct thread_data *)arg;
SaCkptHandleT ckptHandle;
SaCkptCheckpointHandleT handle;
SaErrorT error;
int i;
SaUint32T erroroneousVectorIndex = 0;
error = saCkptInitialize (&ckptHandle, &callbacks, &version);
error = saCkptInitialize (&ckptHandle, &callbacks, &version);
error = saCkptCheckpointOpen (ckptHandle,
&checkpointName,
@ -166,11 +171,12 @@ void *th_dispatch (void *arg)
for (i = 0; i < 1000; i++) {
error = saCkptCheckpointWrite (handle,
WriteVectorElements,
1,/* placing two here with only one vector element causes an assertion failure !! */
1,
&erroroneousVectorIndex);
printf ("Thread %d: Attempt %d: error %d\n", th, i, error);
printf ("Thread %d: Attempt %d: error %d\n",
td->thread_no, i, error);
if (error != SA_OK) {
printf ("Thread %d: Error from write.\n", th);
printf ("Thread %d: Error from write.\n", td->thread_no);
}
}
@ -186,7 +192,7 @@ int main (void) {
int i;
pthread_t dispatch_thread;
error = saCkptInitialize (&ckptHandle, &callbacks, &version);
error = saCkptInitialize (&ckptHandle, &callbacks, &version);
error = saCkptCheckpointOpen (ckptHandle,
&checkpointName,
@ -209,7 +215,11 @@ printf ("create2 error is %d\n", error);
printf ("create2 error is %d\n", error);
for (i = 0; i < 40; i++) {
pthread_create (&dispatch_thread, NULL, th_dispatch, (void *)i);
struct thread_data *td;
td = malloc (sizeof (struct thread_data));
td->thread_no = i;
pthread_create (&dispatch_thread, NULL, th_dispatch, td);
}
pthread_join (dispatch_thread, NULL);

View File

@ -217,7 +217,7 @@ test_pub()
tv_elapsed.tv_usec / 1000000.0)) * 1000000.0));
exit (1);
printf("Published event ID: 0x%llx\n", event_id);
printf("Published event ID: %llx\n", (unsigned long long)event_id);
/*
* See if we got the event
@ -289,7 +289,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id,
printf("event_callback called\n");
printf("sub ID: %x\n", subscription_id);
printf("event_handle %llx\n", event_handle);
printf("event_handle %llx\n", (unsigned long long)event_handle);
printf("event data size %d\n", event_data_size);
evt_pat_get_array.patternsNumber = 4;
@ -312,9 +312,9 @@ event_callback( SaEvtSubscriptionIdT subscription_id,
}
printf("priority: 0x%x\n", priority);
printf("retention: 0x%llx\n", retention_time);
printf("retention: %llx\n", (unsigned long long)retention_time);
printf("publisher name content: \"%s\"\n", publisher_name.value);
printf("event id: 0x%llx\n", event_id);
printf("event id: %llx\n", (unsigned long long)event_id);
evt_free:
result = saEvtEventFree(event_handle);
printf("event free result: %d\n", result);

View File

@ -205,7 +205,7 @@ test_pub()
exit(result);
}
printf("Published event ID: 0x%llx\n", event_id);
printf("Published event ID: 0x%llx\n", (unsigned long long)event_id);
}
/*
@ -287,7 +287,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id,
printf("event_callback called\n");
printf("sub ID: %x\n", subscription_id);
printf("event_handle %llx\n", event_handle);
printf("event_handle %llx\n", (unsigned long long)event_handle);
printf("event data size %d\n", event_data_size);
evt_pat_get_array.patternsNumber = 4;
@ -311,9 +311,9 @@ event_callback( SaEvtSubscriptionIdT subscription_id,
}
printf("priority: 0x%x\n", priority);
printf("retention: 0x%llx\n", retention_time);
printf("retention: 0x%llx\n", (unsigned long long)retention_time);
printf("publisher name content: \"%s\"\n", publisher_name.value);
printf("event id: 0x%llx\n", event_id);
printf("event id: 0x%llx\n", (unsigned long long)event_id);
evt_free:
result = saEvtEventFree(event_handle);
get_sa_error(result, result_buf, result_buf_len);

View File

@ -48,11 +48,11 @@ int get_sa_error(SaErrorT error, char *str, int len)
}
char *get_sa_error_b (SaAisErrorT error) {
return (sa_error_list[error]);
return ((char *)sa_error_list[error]);
}
char *get_test_output (SaAisErrorT result, SaAisErrorT expected) {
static *test_result[256];
static char test_result[256];
if (result == expected) {
return ("PASSED");

View File

@ -235,7 +235,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id,
if (!quiet)
dprintf("sub ID: %x\n", subscription_id);
if (!quiet)
dprintf("event_handle %llx\n", event_handle);
dprintf("event_handle %llx\n", (unsigned long long)event_handle);
if (!quiet)
dprintf("event data size %d\n", event_data_size);
@ -266,7 +266,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id,
}
dprintf("priority: 0x%x\n", priority);
dprintf("retention: 0x%llx\n", retention_time);
dprintf("retention: 0x%llx\n", (unsigned long long)retention_time);
dprintf("publisher name content: \"%s\"\n",
publisher_name.value);
}
@ -282,7 +282,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id,
}
}
if (quiet < 2) {
dprintf("event id: 0x%016llx\n", event_id);
dprintf("event id: 0x%016llx\n", (unsigned long long)event_id);
}
if (quiet == 2) {
if ((++evt_count % EVT_FREQ) == 0) {
@ -305,8 +305,8 @@ event_callback( SaEvtSubscriptionIdT subscription_id,
last_event_id[idx]++;
if (last_event_id[idx] != event_id) {
dprintf("*** expected %016llx got %016llx event_id\n",
last_event_id[idx],
event_id);
(unsigned long long)last_event_id[idx],
(unsigned long long)event_id);
last_event_id[idx] = event_id;
}
break;

View File

@ -253,7 +253,6 @@ int main (int argc, char **argv) {
int select_fd;
fd_set read_fds;
SaNameT compName;
SaNameT proxyCompName;
SaNameT csiName;
SaNameT compname_get_name;
SaAmfReadinessStateT readinessState;

View File

@ -391,10 +391,10 @@ printf ("Please wait, testing expiry of checkpoint sections.\n");
if (error == SA_OK) {
printf ("Section '%s' expires %llx size %d state %x update %llx\n",
sectionDescriptor.sectionId.id,
sectionDescriptor.expirationTime,
(unsigned long long)sectionDescriptor.expirationTime,
sectionDescriptor.sectionSize,
sectionDescriptor.sectionState,
sectionDescriptor.lastUpdate);
(unsigned long long)sectionDescriptor.lastUpdate);
}
} while (error == SA_OK);
printf ("The last iteration should fail\n");

View File

@ -77,7 +77,7 @@ void printSaClmClusterNodeT (char *description, SaClmClusterNodeT *clusterNode)
printf ("\tMember is %d\n", clusterNode->member);
printf ("\tTimestamp is %llx nanoseconds\n", clusterNode->bootTimestamp);
printf ("\tTimestamp is %llx nanoseconds\n", (unsigned long long)clusterNode->bootTimestamp);
}
void NodeGetCallback (

View File

@ -689,7 +689,7 @@ event_callback(SaEvtSubscriptionIdT my_subscription_id,
if (my_event_id != event_id) {
printf("ERROR: Call back event ID error: e=%llx, a=%llx\n",
event_id, my_event_id);
(unsigned long long)event_id, (unsigned long long)my_event_id);
}
if (evt_pat_get_array.patternsNumber != 4) {
@ -726,7 +726,8 @@ event_callback(SaEvtSubscriptionIdT my_subscription_id,
}
if (retention_time != my_retention_time) {
printf("ERROR: retention: e=0x%llx a=0x%llx\n",
retention_time, my_retention_time);
(unsigned long long)retention_time,
(unsigned long long)my_retention_time);
}
if (publisher_name.length != my_publisher_name.length) {
printf("ERROR: publisher name length: e=%d, a=%d\n",
@ -867,13 +868,15 @@ test_event()
printf("ERROR: priority not lowest: 0x%x\n", priority);
}
if (retention_time != 0) {
printf("ERROR: retention time not zero: %0llx\n", retention_time);
printf("ERROR: retention time not zero: %0llx\n",
(unsigned long long)retention_time);
}
if (publisher_name.length != 0) {
printf("ERROR: publisher name not null: %s\n", publisher_name.value);
}
if (event_id != 0) {
printf("ERROR: event id not zero: 0x%llx\n", event_id);
printf("ERROR: event id not zero: 0x%llx\n",
(unsigned long long)event_id);
}
@ -940,7 +943,8 @@ test_event()
}
if (retention_time != test_ret_time) {
printf("ERROR: retention: e=0x%llx a=0x%llx\n",
test_ret_time, retention_time);
(unsigned long long)test_ret_time,
(unsigned long long)retention_time);
}
if (publisher_name.length != test_pub_name.length) {
printf("ERROR: publisher name length: e=%d, a=%d\n",
@ -956,7 +960,8 @@ test_event()
}
if (event_id != 0) {
printf("ERROR: event id not zero: 0x%llx\n", event_id);
printf("ERROR: event id not zero: 0x%llx\n",
(unsigned long long)event_id);
}
/*
@ -1190,7 +1195,8 @@ multi_test_callback1(SaEvtSubscriptionIdT my_subscription_id,
printf("ERROR: Received event 3 but not subscribed\n");
goto evt_free;
} else {
printf("ERROR: Received event %llx but not sent\n", my_event_id);
printf("ERROR: Received event %llx but not sent\n",
(unsigned long long)my_event_id);
goto evt_free;
}
@ -1764,8 +1770,11 @@ multi_test_callback3(SaEvtSubscriptionIdT my_subscription_id,
}
if ((my_event_id != event_id1) && (my_event_id != event_id2)) {
printf("ERROR: Received wrong event ID %llx\n", my_event_id);
printf(" id1 %llx, id2 %llx\n", event_id1, event_id2);
printf("ERROR: Received wrong event ID %llx\n",
(unsigned long long)my_event_id);
printf(" id1 %llx, id2 %llx\n",
(unsigned long long)event_id1,
(unsigned long long)event_id2);
goto evt_free;
}
@ -2193,7 +2202,8 @@ test_retention()
}
if (retained_id != event_id) {
printf("ERROR: received the wrong event: e=%llx, a=%llx\n",
event_id, retained_id);
(unsigned long long)event_id,
(unsigned long long)retained_id);
goto evt_free;
}
@ -2316,7 +2326,8 @@ test_retention()
}
if (retained_id != event_id) {
printf("ERROR: received the wrong event: e=%llx, a=%llx\n",
event_id, retained_id);
(unsigned long long)event_id,
(unsigned long long)retained_id);
goto evt_free;
}
@ -2418,7 +2429,8 @@ unlink_chan_callback(SaEvtSubscriptionIdT my_subscription_id,
} else if (my_event_id == event_id2) {
exp_sub_id = sub2;
} else {
printf("ERROR: Received event %llx but not sent\n", my_event_id);
printf("ERROR: Received event %llx but not sent\n",
(unsigned long long)my_event_id);
goto evt_free;
}

View File

@ -39,10 +39,10 @@
int main (void)
{
char *error;
int result;
#ifdef CODE_COVERAGE_COMPILE_OUT
int result;
int error;
result = amfReadGroups (&error);
if (result == -1) {
printf ("Parse Error: %s\n", error);