]> sourceware.org Git - systemtap.git/commitdiff
2005-12-07 Martin Hunt <hunt@redhat.com>
authorhunt <hunt>
Wed, 7 Dec 2005 20:05:59 +0000 (20:05 +0000)
committerhunt <hunt>
Wed, 7 Dec 2005 20:05:59 +0000 (20:05 +0000)
* alloc.c: Remove all unused functions.
* io.c: Add vprintf() prototype.

runtime/user/ChangeLog
runtime/user/alloc.c
runtime/user/io.c

index 2cad66717f37aa014ff335adfc4a1a040ce5bf69..f55340f2cc87f306bbeada6153c9a2df0ed3b146 100644 (file)
@@ -1,3 +1,8 @@
+2005-12-07  Martin Hunt  <hunt@redhat.com>
+
+       * alloc.c: Remove all unused functions.
+       * io.c: Add vprintf() prototype.
+
 2005-11-29  Martin Hunt  <hunt@redhat.com>
 
        * recreate_links: Remove links to deleted files.
index 2691a36adf4f7c7bb78a243d79d137862287fa74..9ba720ab90f2cf9222cc3e47434e09ede01bebce 100644 (file)
@@ -1,21 +1,7 @@
 #ifndef _ALLOC_C_
 #define _ALLOC_C_
 
-/* -*- linux-c -*- */
-/** @file alloc.c
- * @brief Memory functions.
- */
-/** @addtogroup alloc Memory Functions
- * Basic malloc/calloc/free functions. These will be changed so 
- * that memory allocation errors will call a handler.  The default will
- * send a signal to the user-space daemon that will trigger the module to
- * be unloaded.
- * @todo Need error handling for memory allocations
- * @todo Some of these currently use kmalloc (GFP_ATOMIC) for
- * small allocations.  This should be evaluated for performance
- * and stability.
- * @{
- */
+/* emulated memory allocation functions */
 
 void *malloc(size_t size);
 void free(void *ptr);
@@ -23,87 +9,9 @@ void free(void *ptr);
 enum errorcode { ERR_NONE=0, ERR_NO_MEM };
 enum errorcode _stp_errorcode = ERR_NONE;
 
-/** Allocates memory within a probe.
- * This is used for small allocations from within a running
- * probe where the process cannot sleep. 
- * @param len Number of bytes to allocate.
- * @return a valid pointer on success or NULL on failure.
- * @bug Currently uses kmalloc (GFP_ATOMIC).
- */
-
-void *_stp_alloc(size_t len)
-{
-       void *ptr = malloc(len);
-       if (unlikely(ptr == NULL))
-               _stp_errorcode = ERR_NO_MEM;
-       return ptr;
-}
-#define _stp_alloc_cpu(len, cpu) _stp_alloc(len)
-
-/** Allocates and clears memory within a probe.
- * This is used for small allocations from within a running
- * probe where the process cannot sleep. 
- * @param len Number of bytes to allocate.
- * @return a valid pointer on success or NULL on failure.
- * @bug Currently uses kmalloc (GFP_ATOMIC).
- */
-
-void *_stp_calloc(size_t len)
-{
-       void *ptr = malloc(len);
-       if (likely(ptr))
-               memset(ptr, 0, len);
-       return ptr;
-}
-
-/** Allocates and clears memory outside a probe.
- * This is typically used in the module initialization to
- * allocate new maps, lists, etc.
- * @param len Number of bytes to allocate.
- * @return a valid pointer on success or NULL on failure.
- */
-
-void *_stp_valloc(size_t len)
-{
-       void *ptr = malloc(len);
-       if (likely(ptr))
-               memset(ptr, 0, len);
-       else
-               _stp_errorcode = ERR_NO_MEM;
-       return ptr;
-}
-#define _stp_valloc_cpu(len, cpu) _stp_valloc(len)
-#define __stp_valloc_percpu(size,align) __alloc_percpu(size,align)
-#define _stp_vfree_percpu(objp) free_percpu(objp)
-#define _stp_valloc_percpu(type) \
-       ((type *)(__stp_valloc_percpu(sizeof(type), __alignof__(type))))
-#define _stp_percpu_dptr(ptr)  (((struct percpu_data *)~(unsigned long)(ptr))->blkp)
-#define _stp_per_cpu_ptr(ptr, cpu)             \
-({                                              \
-        struct percpu_data *__p = (struct percpu_data *)~(unsigned long)(ptr); \
-        (__typeof__(ptr))__p->ptrs[(cpu)];      \
-})
-
-
-/** Frees memory allocated by _stp_alloc or _stp_calloc.
- * @param ptr pointer to memory to free
- */
-
-void _stp_free(void *ptr)
-{
-       if (likely(ptr))
-               free(ptr);
-}
-
-/** Frees memory allocated by _stp_valloc.
- * @param ptr pointer to memory to free
- */
-
-void _stp_vfree(void *ptr)
+void *__kmalloc(size_t size, gfp_t flags)
 {
-       if (likely(ptr))
-               free(ptr);
+  return malloc(size);
 }
 
-/** @} */
 #endif /* _ALLOC_C_ */
index 2da0de821d6e6d4ef0376482cfaf98f3b0c6e043..ff4a06a72f556e175ec486923c2f0437def05f5a 100644 (file)
@@ -9,6 +9,7 @@
 
 #ifndef _IO_C_
 #define _IO_C_
+int vprintf(const char *format, va_list ap);
 
 /** Logs Data.
  * This function sends the message immediately to stpd. It
This page took 0.029043 seconds and 5 git commands to generate.