/* -*- linux-c -*- * Map Header File * Copyright (C) 2005 Red Hat Inc. * * This file is part of systemtap, and is free software. You can * redistribute it and/or modify it under the terms of the GNU General * Public License (GPL); either version 2, or (at your option) any * later version. */ #ifndef _MAP_H_ #define _MAP_H_ /** @file map.h * @brief Header file for maps and lists */ /** @addtogroup maps * @todo Needs a spinlock variable to help when locks are required on the map. * @{ */ /* Include map spinlocks only on demand. Otherwise, assume that caller does the right thing. */ #ifndef NEED_MAP_LOCKS #define NEED_MAP_LOCKS 0 #endif #if NEED_MAP_LOCKS #define MAP_GET_CPU() get_cpu() #define MAP_PUT_CPU() put_cpu() #else /* get/put_cpu wrappers. Unnecessary if caller is already atomic. */ #define MAP_GET_CPU() smp_processor_id() #define MAP_PUT_CPU() do {} while (0) #endif /* This sets the size of the hash table. */ #ifndef HASH_TABLE_BITS #define HASH_TABLE_BITS 8 /* This sets the size of the hash table. */ #define HASH_TABLE_SIZE (1<