1/* BEGIN LICENSE BLOCK 2 * Version: CMPL 1.1 3 * 4 * The contents of this file are subject to the Cisco-style Mozilla Public 5 * License Version 1.1 (the "License"); you may not use this file except 6 * in compliance with the License. You may obtain a copy of the License 7 * at www.eclipse-clp.org/license. 8 * 9 * Software distributed under the License is distributed on an "AS IS" 10 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 11 * the License for the specific language governing rights and limitations 12 * under the License. 13 * 14 * The Original Code is The ECLiPSe Constraint Logic Programming System. 15 * The Initial Developer of the Original Code is Cisco Systems, Inc. 16 * Portions created by the Initial Developer are 17 * Copyright (C) 1992-2006 Cisco Systems, Inc. All Rights Reserved. 18 * 19 * Contributor(s): Joachim Schimpf, ECRC. 20 * 21 * END LICENSE BLOCK */ 22 23#include "memman.h" 24 25void 26panic(what, where) 27char *what, *where; 28{ 29 printf("Panic: %s in %s\n", what, where); 30 exit(-1); 31} 32 33struct heap_descriptor h1, h2; 34 35main() 36{ 37 char *addr = (char *) 0x2180000; 38 char *p1, *p2; 39 40char *shared_mem_init(int create_flag, 41 char* mapfile, char* start, 42 int size, int increment, 43 void (*panic_fct)(), 44 struct heap_descriptor *hd); 45 if ((int) shared_mem_init(1, "map1", 0, 0, 0, panic, &h1) == -1) 46 { 47 printf("shared_mem_init 1 failed"); 48 exit(-1); 49 } 50 51 if ((int) shared_mem_init(1, "map2", 0, 0, 0, panic, &h2) == -1) 52 { 53 printf("shared_mem_init 2 failed"); 54 exit(-1); 55 } 56 57 p1 = (char *) alloc_size(&h1, 50); 58 p2 = (char *) alloc_size(&h2, 50); 59 free_size(&h1, (void *) p1, 50); 60 free_size(&h2, (void *) p2, 50); 61 exit(0); 62} 63