[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] tools: Declare functions static where they should be, and provide



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1216124366 -3600
# Node ID 750eee596adf2836b510b76c5cdd0768371f8ec1
# Parent  63317b6c3eab23148bb16648e3246f3fd5cd3516
tools: Declare functions static where they should be, and provide
proper prototypes for others as required.

Signed-off-by: Christoph Egger <Christoph.Egger@xxxxxxx>
---
 tools/console/daemon/io.c                          |    2 
 tools/firmware/hvmloader/hvmloader.c               |    4 
 tools/firmware/hvmloader/mp_tables.c               |   19 +---
 tools/firmware/hvmloader/smp.c                     |    3 
 tools/firmware/hvmloader/util.h                    |    6 +
 tools/firmware/rombios/32bit/tcgbios/tcgbios.c     |    4 
 tools/firmware/rombios/32bit/tcgbios/tpm_drivers.c |   12 +-
 tools/firmware/rombios/32bit/util.c                |    6 -
 tools/xenmon/xenbaked.c                            |   89 ++++++++++-----------
 tools/xenstore/talloc.c                            |    2 
 tools/xenstore/tdb.c                               |    4 
 tools/xenstore/xenstore_client.c                   |    2 
 tools/xenstore/xenstored_core.c                    |   17 ----
 tools/xentrace/xenctx.c                            |   32 ++++---
 tools/xentrace/xentrace.c                          |   28 +++---
 15 files changed, 105 insertions(+), 125 deletions(-)

diff -r 63317b6c3eab -r 750eee596adf tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Mon Jul 14 15:21:03 2008 +0100
+++ b/tools/console/daemon/io.c Tue Jul 15 13:19:26 2008 +0100
@@ -471,7 +471,7 @@ out:
 }
  
 /* Takes tuples of names, scanf-style args, and void **, NULL terminated. */
-int xs_gather(struct xs_handle *xs, const char *dir, ...)
+static int xs_gather(struct xs_handle *xs, const char *dir, ...)
 {
        va_list ap;
        const char *name;
diff -r 63317b6c3eab -r 750eee596adf tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c      Mon Jul 14 15:21:03 2008 +0100
+++ b/tools/firmware/hvmloader/hvmloader.c      Tue Jul 15 13:19:26 2008 +0100
@@ -99,10 +99,6 @@ asm (
     "    .text                       \n"
     );
 
-void smp_initialise(void);
-void create_mp_tables(void);
-int hvm_write_smbios_tables(void);
-
 static enum { VGA_none, VGA_std, VGA_cirrus } virtual_vga = VGA_none;
 
 static void
diff -r 63317b6c3eab -r 750eee596adf tools/firmware/hvmloader/mp_tables.c
--- a/tools/firmware/hvmloader/mp_tables.c      Mon Jul 14 15:21:03 2008 +0100
+++ b/tools/firmware/hvmloader/mp_tables.c      Tue Jul 15 13:19:26 2008 +0100
@@ -69,8 +69,6 @@
 
 #include "util.h"
 
-extern int get_vcpu_nr(void);  /* for the guest's VCPU count */
-
 /*
  * The following structures are defined in the MuliProcessor Specifiation v1.4
  */
@@ -152,7 +150,7 @@ struct mp_local_intr_entry {
 };
 
 
-void fill_mp_config_table(struct mp_config_table *mpct, int length)
+static void fill_mp_config_table(struct mp_config_table *mpct, int length)
 {
     int vcpu_nr, i;
     uint8_t checksum;
@@ -199,7 +197,7 @@ void fill_mp_config_table(struct mp_conf
 }
 
 /* fills in an MP processor entry for VCPU 'vcpu_id' */
-void fill_mp_proc_entry(struct mp_proc_entry *mppe, int vcpu_id)
+static void fill_mp_proc_entry(struct mp_proc_entry *mppe, int vcpu_id)
 {
     mppe->type = ENTRY_TYPE_PROCESSOR;
     mppe->lapic_id = LAPIC_ID(vcpu_id);
@@ -213,7 +211,7 @@ void fill_mp_proc_entry(struct mp_proc_e
 
 
 /* fills in an MP bus entry of type 'type' and bus ID 'bus_id' */
-void fill_mp_bus_entry(struct mp_bus_entry *mpbe, int bus_id, const char *type)
+static void fill_mp_bus_entry(struct mp_bus_entry *mpbe, int bus_id, const 
char *type)
 {
     int i;
 
@@ -225,7 +223,7 @@ void fill_mp_bus_entry(struct mp_bus_ent
 
 
 /* fills in an MP IOAPIC entry for IOAPIC 'ioapic_id' */
-void fill_mp_ioapic_entry(struct mp_ioapic_entry *mpie)
+static void fill_mp_ioapic_entry(struct mp_ioapic_entry *mpie)
 {
     mpie->type = ENTRY_TYPE_IOAPIC;
     mpie->ioapic_id = IOAPIC_ID;
@@ -236,7 +234,7 @@ void fill_mp_ioapic_entry(struct mp_ioap
 
 
 /* fills in an IO interrupt entry for IOAPIC 'ioapic_id' */
-void fill_mp_io_intr_entry(
+static void fill_mp_io_intr_entry(
     struct mp_io_intr_entry *mpiie,
     int src_bus_id, int src_bus_irq, int ioapic_id, int dst_ioapic_intin)
 {
@@ -251,7 +249,7 @@ void fill_mp_io_intr_entry(
 
 
 /* fill in the mp floating processor structure */
-void fill_mpfps(struct mp_floating_pointer_struct *mpfps, uint32_t mpct)
+static void fill_mpfps(struct mp_floating_pointer_struct *mpfps, uint32_t mpct)
 {
     int i;
     uint8_t checksum;
@@ -283,7 +281,7 @@ void fill_mpfps(struct mp_floating_point
  * The '___HVMMP' signature is created by the ROMBIOS and designates a chunk
  * of space inside the ROMBIOS that is safe for us to write our MP table info
  */
-void* get_mp_table_start(void)
+static void *get_mp_table_start(void)
 {
     char *bios_mem;
 
@@ -300,7 +298,7 @@ void* get_mp_table_start(void)
 
 
 /* recalculate the new ROMBIOS checksum after adding MP tables */
-void reset_bios_checksum(void)
+static void reset_bios_checksum(void)
 {
     uint32_t i;
     uint8_t checksum;
@@ -311,7 +309,6 @@ void reset_bios_checksum(void)
 
     *((uint8_t *)(ROMBIOS_BEGIN + ROMBIOS_MAXOFFSET)) = -checksum;
 }
-
 
 /* create_mp_tables - creates MP tables for the guest based upon config data */
 void create_mp_tables(void)
diff -r 63317b6c3eab -r 750eee596adf tools/firmware/hvmloader/smp.c
--- a/tools/firmware/hvmloader/smp.c    Mon Jul 14 15:21:03 2008 +0100
+++ b/tools/firmware/hvmloader/smp.c    Tue Jul 15 13:19:26 2008 +0100
@@ -69,8 +69,7 @@ asm (
     "    .text                       \n"
     );
 
-extern void cacheattr_init(void);
-
+void ap_start(void); /* non-static avoids unused-function compiler warning */
 /*static*/ void ap_start(void)
 {
     printf(" - CPU%d ... ", ap_cpuid);
diff -r 63317b6c3eab -r 750eee596adf tools/firmware/hvmloader/util.h
--- a/tools/firmware/hvmloader/util.h   Mon Jul 14 15:21:03 2008 +0100
+++ b/tools/firmware/hvmloader/util.h   Tue Jul 15 13:19:26 2008 +0100
@@ -137,6 +137,12 @@ uint32_t e820_malloc(uint32_t size);
 /* Prepare the 32bit BIOS */
 void highbios_setup(void);
 
+/* Miscellaneous. */
+void cacheattr_init(void);
+void create_mp_tables(void);
+int hvm_write_smbios_tables(void);
+void smp_initialise(void);
+
 #define isdigit(c) ((c) >= '0' && (c) <= '9')
 
 #endif /* __HVMLOADER_UTIL_H__ */
diff -r 63317b6c3eab -r 750eee596adf 
tools/firmware/rombios/32bit/tcgbios/tcgbios.c
--- a/tools/firmware/rombios/32bit/tcgbios/tcgbios.c    Mon Jul 14 15:21:03 
2008 +0100
+++ b/tools/firmware/rombios/32bit/tcgbios/tcgbios.c    Tue Jul 15 13:19:26 
2008 +0100
@@ -581,7 +581,7 @@ static char wake_event_1[]    = "Wake Ev
  * data       : additional parameter; used as parameter for 10.4.3
  *              'action index'
  */
-void tcpa_add_measurement(uint32_t pcrIndex,
+static void tcpa_add_measurement(uint32_t pcrIndex,
                           uint16_t event_type,
                           uint32_t data)
 {
@@ -863,7 +863,7 @@ uint32_t tcpa_initialize_tpm(uint32_t ph
 }
 
 
-uint16_t TCG_IsShutdownPreBootInterface(void)
+static uint16_t TCG_IsShutdownPreBootInterface(void)
 {
        return tcpa_acpi.flags & STATUS_FLAG_SHUTDOWN;
 }
diff -r 63317b6c3eab -r 750eee596adf 
tools/firmware/rombios/32bit/tcgbios/tpm_drivers.c
--- a/tools/firmware/rombios/32bit/tcgbios/tpm_drivers.c        Mon Jul 14 
15:21:03 2008 +0100
+++ b/tools/firmware/rombios/32bit/tcgbios/tpm_drivers.c        Tue Jul 15 
13:19:26 2008 +0100
@@ -75,7 +75,7 @@ static uint32_t tis_activate(uint32_t ba
        return rc;
 }
 
-uint32_t tis_ready(uint32_t baseaddr)
+static uint32_t tis_ready(uint32_t baseaddr)
 {
        uint32_t rc = 0;
        uint8_t *tis_addr = (uint8_t*)baseaddr;
@@ -86,7 +86,7 @@ uint32_t tis_ready(uint32_t baseaddr)
        return rc;
 }
 
-uint32_t tis_senddata(uint32_t baseaddr, unsigned char *data, uint32_t len)
+static uint32_t tis_senddata(uint32_t baseaddr, unsigned char *data, uint32_t 
len)
 {
        uint32_t rc = 0;
        uint8_t *tis_addr = (uint8_t*)baseaddr;
@@ -127,7 +127,7 @@ uint32_t tis_senddata(uint32_t baseaddr,
        return rc;
 }
 
-uint32_t tis_readresp(uint32_t baseaddr, unsigned char *buffer, uint32_t len)
+static uint32_t tis_readresp(uint32_t baseaddr, unsigned char *buffer, 
uint32_t len)
 {
        uint32_t rc = 0;
        uint32_t offset = 0;
@@ -147,7 +147,7 @@ uint32_t tis_readresp(uint32_t baseaddr,
 }
 
 
-uint32_t tis_waitdatavalid(uint32_t baseaddr)
+static uint32_t tis_waitdatavalid(uint32_t baseaddr)
 {
        uint8_t *tis_addr = (uint8_t*)baseaddr;
        uint32_t rc = 0;
@@ -157,7 +157,7 @@ uint32_t tis_waitdatavalid(uint32_t base
        return rc;
 }
 
-uint32_t tis_waitrespready(uint32_t baseaddr, uint32_t timeout)
+static uint32_t tis_waitrespready(uint32_t baseaddr, uint32_t timeout)
 {
        uint32_t rc = 0;
        uint8_t *tis_addr = (uint8_t*)baseaddr;
@@ -170,7 +170,7 @@ uint32_t tis_waitrespready(uint32_t base
 }
 
 /* if device is not there, return '0', '1' otherwise */
-uint32_t tis_probe(uint32_t baseaddr)
+static uint32_t tis_probe(uint32_t baseaddr)
 {
        uint32_t rc = 0;
        uint8_t *tis_addr = (uint8_t*)baseaddr;
diff -r 63317b6c3eab -r 750eee596adf tools/firmware/rombios/32bit/util.c
--- a/tools/firmware/rombios/32bit/util.c       Mon Jul 14 15:21:03 2008 +0100
+++ b/tools/firmware/rombios/32bit/util.c       Tue Jul 15 13:19:26 2008 +0100
@@ -388,12 +388,6 @@ int printf(const char *fmt, ...)
     return 0;
 }
 
-int vprintf(const char *fmt, va_list ap)
-{
-    _doprint(putchar, fmt, ap);
-    return 0;
-}
-
 void mssleep(uint32_t waittime)
 {
     uint32_t i;
diff -r 63317b6c3eab -r 750eee596adf tools/xenmon/xenbaked.c
--- a/tools/xenmon/xenbaked.c   Mon Jul 14 15:21:03 2008 +0100
+++ b/tools/xenmon/xenbaked.c   Tue Jul 15 13:19:26 2008 +0100
@@ -104,14 +104,20 @@ int NCPU = 0;
 int NCPU = 0;
 
 
-void init_current(int ncpu)
+static void advance_next_datapoint(uint64_t);
+static void alloc_qos_data(int ncpu);
+static int process_record(int, struct t_rec *);
+static void qos_kill_thread(int domid);
+
+
+static void init_current(int ncpu)
 {
     running = calloc(ncpu, sizeof(int));
     NCPU = ncpu;
     printf("Initialized with %d %s\n", ncpu, (ncpu == 1) ? "cpu" : "cpu's");
 }
 
-int is_current(int domain, int cpu)
+static int is_current(int domain, int cpu)
 {
     //  int i;
   
@@ -122,20 +128,22 @@ int is_current(int domain, int cpu)
 }
 
 
+#if 0 /* unused */
 // return the domain that's currently running on the given cpu
-int current(int cpu)
+static int current(int cpu)
 {
     return running[cpu];
 }
-
-void set_current(int cpu, int domain)
+#endif
+
+static void set_current(int cpu, int domain)
 {
     running[cpu] = domain;
 }
 
 
 
-void close_handler(int signal)
+static void close_handler(int signal)
 {
     interrupted = 1;
 }
@@ -152,7 +160,7 @@ void dump_record(int cpu, struct t_rec *
  * millis_to_timespec - convert a time in milliseconds to a struct timespec
  * @millis:             time interval in milliseconds
  */
-struct timespec millis_to_timespec(unsigned long millis)
+static struct timespec millis_to_timespec(unsigned long millis)
 {
     struct timespec spec;
 
@@ -188,7 +196,7 @@ stat_map_t stat_map[] = {
 };
 
 
-void check_gotten_sum(void)
+static void check_gotten_sum(void)
 {
 #if 0
     uint64_t sum, ns;
@@ -212,7 +220,7 @@ void check_gotten_sum(void)
 
 
 
-void dump_stats(void) 
+static void dump_stats(void) 
 {
     stat_map_t *smt = stat_map;
     time_t end_time, run_time;
@@ -236,7 +244,7 @@ void dump_stats(void)
     check_gotten_sum();
 }
 
-void log_event(int event_id) 
+static void log_event(int event_id) 
 {
     stat_map_t *smt = stat_map;
 
@@ -258,7 +266,7 @@ int xce_handle = -1;
 
 /* Returns the event channel handle. */
 /* Stolen from xenstore code */
-int eventchn_init(void)
+static int eventchn_init(void)
 {
     int rc;
   
@@ -278,7 +286,7 @@ int eventchn_init(void)
     return xce_handle;
 }
 
-void wait_for_event(void)
+static void wait_for_event(void)
 {
     int ret;
     fd_set inset;
@@ -333,7 +341,7 @@ static void get_tbufs(unsigned long *mfn
     xc_interface_close(xc_handle);
 }
 
-void disable_tracing(void)
+static void disable_tracing(void)
 {
     int xc_handle = xc_interface_open();
     xc_tbuf_disable(xc_handle);  
@@ -348,7 +356,7 @@ void disable_tracing(void)
  *
  * Maps the Xen trace buffers them into process address space.
  */
-struct t_buf *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
+static struct t_buf *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
                         unsigned long size)
 {
     int xc_handle;
@@ -385,7 +393,7 @@ struct t_buf *map_tbufs(unsigned long tb
  * Initialises an array of pointers to individual trace buffers within the
  * mapped region containing all trace buffers.
  */
-struct t_buf **init_bufs_ptrs(void *bufs_mapped, unsigned int num,
+static struct t_buf **init_bufs_ptrs(void *bufs_mapped, unsigned int num,
                               unsigned long size)
 {
     int i;
@@ -418,7 +426,7 @@ struct t_buf **init_bufs_ptrs(void *bufs
  * mapped in user space.  Note that the trace buffer metadata contains machine
  * pointers - the array returned allows more convenient access to them.
  */
-struct t_rec **init_rec_ptrs(struct t_buf **meta, unsigned int num)
+static struct t_rec **init_rec_ptrs(struct t_buf **meta, unsigned int num)
 {
     int i;
     struct t_rec **data;
@@ -441,7 +449,7 @@ struct t_rec **init_rec_ptrs(struct t_bu
 /**
  * get_num_cpus - get the number of logical CPUs
  */
-unsigned int get_num_cpus(void)
+static unsigned int get_num_cpus(void)
 {
     xc_physinfo_t physinfo = { 0 };
     int xc_handle = xc_interface_open();
@@ -465,11 +473,9 @@ unsigned int get_num_cpus(void)
 /**
  * monitor_tbufs - monitor the contents of tbufs
  */
-int monitor_tbufs(void)
+static int monitor_tbufs(void)
 {
     int i;
-    extern int process_record(int, struct t_rec *);
-    extern void alloc_qos_data(int ncpu);
 
     void *tbufs_mapped;          /* pointer to where the tbufs are mapped    */
     struct t_buf **meta;         /* pointers to the trace buffer metadata    */
@@ -564,7 +570,7 @@ const char *program_bug_address = "<rob.
 #define xstr(x) str(x)
 #define str(x) #x
 
-void usage(void)
+static void usage(void)
 {
 #define USAGE_STR \
 "Usage: xenbaked [OPTION...]\n" \
@@ -591,7 +597,7 @@ void usage(void)
 }
 
 /* convert the argument string pointed to by arg to a long int representation 
*/
-long argtol(const char *restrict arg, int base)
+static long argtol(const char *restrict arg, int base)
 {
     char *endp; 
     long val;
@@ -612,7 +618,7 @@ long argtol(const char *restrict arg, in
 }
 
 /* parse command line arguments */
-void parse_args(int argc, char **argv)
+static void parse_args(int argc, char **argv)
 {
     int option;
     static struct option long_options[] = {
@@ -658,12 +664,11 @@ void parse_args(int argc, char **argv)
 }
 
 #define SHARED_MEM_FILE "/var/run/xenq-shm"
-void alloc_qos_data(int ncpu)
+static void alloc_qos_data(int ncpu)
 {
     int i, n, pgsize, off=0;
     char *dummy;
     int qos_fd;
-    void advance_next_datapoint(uint64_t);
 
     cpu_qos_data = (_new_qos_data **) calloc(ncpu, sizeof(_new_qos_data *));
 
@@ -737,7 +742,7 @@ int main(int argc, char **argv)
     return ret;
 }
 
-void qos_init_domain(int domid, int idx)
+static void qos_init_domain(int domid, int idx)
 {
     int i;
 
@@ -767,7 +772,7 @@ void qos_init_domain(int domid, int idx)
     }
 }
 
-void global_init_domain(int domid, int idx) 
+static void global_init_domain(int domid, int idx) 
 {
     int cpu;
     _new_qos_data *saved_qos;
@@ -781,14 +786,12 @@ void global_init_domain(int domid, int i
     new_qos = saved_qos;
 }
 
-
 // give index of this domain in the qos data array
-int indexof(int domid)
+static int indexof(int domid)
 {
     int idx;
     xc_dominfo_t dominfo[NDOMAINS];
     int xc_handle, ndomains;
-    extern void qos_kill_thread(int domid);
   
     if (domid < 0) {   // shouldn't happen
         printf("bad domain id: %d\r\n", domid);
@@ -840,13 +843,13 @@ int indexof(int domid)
     exit(2);
 }
 
-int domain_runnable(int domid)
+static int domain_runnable(int domid)
 {
     return new_qos->domain_info[indexof(domid)].runnable;
 }
 
 
-void update_blocked_time(int domid, uint64_t now)
+static void update_blocked_time(int domid, uint64_t now)
 {
     uint64_t t_blocked;
     int id = indexof(domid);
@@ -867,7 +870,7 @@ void update_blocked_time(int domid, uint
 
 
 // advance to next datapoint for all domains
-void advance_next_datapoint(uint64_t now)
+static void advance_next_datapoint(uint64_t now)
 {
     int new, old, didx;
 
@@ -892,7 +895,7 @@ void advance_next_datapoint(uint64_t now
 
 
 
-void qos_update_thread(int cpu, int domid, uint64_t now)
+static void qos_update_thread(int cpu, int domid, uint64_t now)
 {
     int n, id;
     uint64_t last_update_time, start;
@@ -970,7 +973,7 @@ void qos_update_thread(int cpu, int domi
 
 
 // called by dump routines to update all structures
-void qos_update_all(uint64_t now, int cpu)
+static void qos_update_all(uint64_t now, int cpu)
 {
     int i;
 
@@ -980,7 +983,7 @@ void qos_update_all(uint64_t now, int cp
 }
 
 
-void qos_update_thread_stats(int cpu, int domid, uint64_t now)
+static void qos_update_thread_stats(int cpu, int domid, uint64_t now)
 {
     if (new_qos->qdata[new_qos->next_datapoint].ns_passed > 
(million*opts.ms_per_sample)) {
         qos_update_all(now, cpu);
@@ -993,7 +996,7 @@ void qos_update_thread_stats(int cpu, in
 
 
 // called when a new thread gets the cpu
-void qos_switch_in(int cpu, int domid, uint64_t now, unsigned long ns_alloc, 
unsigned long ns_waited)
+static void qos_switch_in(int cpu, int domid, uint64_t now, unsigned long 
ns_alloc, unsigned long ns_waited)
 {
     int idx = indexof(domid);
 
@@ -1016,7 +1019,7 @@ void qos_switch_in(int cpu, int domid, u
 }
 
 // called when the current thread is taken off the cpu
-void qos_switch_out(int cpu, int domid, uint64_t now, unsigned long gotten)
+static void qos_switch_out(int cpu, int domid, uint64_t now, unsigned long 
gotten)
 {
     int idx = indexof(domid);
     int n;
@@ -1054,7 +1057,7 @@ void qos_switch_out(int cpu, int domid, 
 
 // called when domain is put to sleep, may also be called
 // when thread is already asleep
-void qos_state_sleeping(int cpu, int domid, uint64_t now) 
+static void qos_state_sleeping(int cpu, int domid, uint64_t now) 
 {
     int idx;
 
@@ -1072,7 +1075,7 @@ void qos_state_sleeping(int cpu, int dom
 
 
 // domain died, presume it's dead on all cpu's, not just mostly dead
-void qos_kill_thread(int domid)
+static void qos_kill_thread(int domid)
 {
     int cpu;
   
@@ -1085,7 +1088,7 @@ void qos_kill_thread(int domid)
 
 // called when thread becomes runnable, may also be called
 // when thread is already runnable
-void qos_state_runnable(int cpu, int domid, uint64_t now)
+static void qos_state_runnable(int cpu, int domid, uint64_t now)
 {
     int idx;
   
@@ -1105,7 +1108,7 @@ void qos_state_runnable(int cpu, int dom
 }
 
 
-void qos_count_packets(domid_t domid, uint64_t now)
+static void qos_count_packets(domid_t domid, uint64_t now)
 {
     int i, idx = indexof(domid);
     _new_qos_data *cpu_data;
@@ -1122,7 +1125,7 @@ void qos_count_packets(domid_t domid, ui
 }
 
 
-int process_record(int cpu, struct t_rec *r)
+static int process_record(int cpu, struct t_rec *r)
 {
     uint64_t now = 0;
     uint32_t *extra_u32 = r->u.nocycles.extra_u32;
diff -r 63317b6c3eab -r 750eee596adf tools/xenstore/talloc.c
--- a/tools/xenstore/talloc.c   Mon Jul 14 15:21:03 2008 +0100
+++ b/tools/xenstore/talloc.c   Tue Jul 15 13:19:26 2008 +0100
@@ -500,7 +500,7 @@ void *talloc_init(const char *fmt, ...)
   should probably not be used in new code. It's in here to keep the talloc
   code consistent across Samba 3 and 4.
 */
-void talloc_free_children(void *ptr)
+static void talloc_free_children(void *ptr)
 {
        struct talloc_chunk *tc;
 
diff -r 63317b6c3eab -r 750eee596adf tools/xenstore/tdb.c
--- a/tools/xenstore/tdb.c      Mon Jul 14 15:21:03 2008 +0100
+++ b/tools/xenstore/tdb.c      Tue Jul 15 13:19:26 2008 +0100
@@ -28,7 +28,7 @@
 
 
 #ifndef _SAMBA_BUILD_
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
@@ -731,7 +731,7 @@ static int expand_file(TDB_CONTEXT *tdb,
 static int expand_file(TDB_CONTEXT *tdb, tdb_off size, tdb_off addition)
 {
        char buf[1024];
-#if HAVE_FTRUNCATE_EXTEND
+#ifdef HAVE_FTRUNCATE_EXTEND
        if (ftruncate(tdb->fd, size+addition) != 0) {
                TDB_LOG((tdb, 0, "expand_file ftruncate to %d failed (%s)\n", 
                           size+addition, strerror(errno)));
diff -r 63317b6c3eab -r 750eee596adf tools/xenstore/xenstore_client.c
--- a/tools/xenstore/xenstore_client.c  Mon Jul 14 15:21:03 2008 +0100
+++ b/tools/xenstore/xenstore_client.c  Tue Jul 15 13:19:26 2008 +0100
@@ -121,7 +121,7 @@ static int show_whole_path = 0;
 
 #define MIN(a, b) (((a) < (b))? (a) : (b))
 
-void do_ls(struct xs_handle *h, char *path, int cur_depth, int show_perms)
+static void do_ls(struct xs_handle *h, char *path, int cur_depth, int 
show_perms)
 {
     static struct expanding_buffer ebuf;
     char **e;
diff -r 63317b6c3eab -r 750eee596adf tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c   Mon Jul 14 15:21:03 2008 +0100
+++ b/tools/xenstore/xenstored_core.c   Tue Jul 15 13:19:26 2008 +0100
@@ -347,23 +347,6 @@ static int destroy_fd(void *_fd)
        int *fd = _fd;
        close(*fd);
        return 0;
-}
-
-/* Return a pointer to an fd, self-closing and attached to this pathname. */
-int *talloc_open(const char *pathname, int flags, int mode)
-{
-       int *fd;
-
-       fd = talloc(pathname, int);
-       *fd = open(pathname, flags, mode);
-       if (*fd < 0) {
-               int saved_errno = errno;
-               talloc_free(fd);
-               errno = saved_errno;
-               return NULL;
-       }
-       talloc_set_destructor(fd, destroy_fd);
-       return fd;
 }
 
 /* Is child a subnode of parent, or equal? */
diff -r 63317b6c3eab -r 750eee596adf tools/xentrace/xenctx.c
--- a/tools/xentrace/xenctx.c   Mon Jul 14 15:21:03 2008 +0100
+++ b/tools/xentrace/xenctx.c   Tue Jul 15 13:19:26 2008 +0100
@@ -71,7 +71,7 @@ struct symbol {
 
 size_t kernel_stext, kernel_etext, kernel_sinittext, kernel_einittext, 
kernel_hypercallpage;
 
-int is_kernel_text(size_t addr)
+static int is_kernel_text(size_t addr)
 {
 #if defined (__i386__)
     if (symbol_table == NULL)
@@ -96,7 +96,8 @@ int is_kernel_text(size_t addr)
     return 0;
 }
 
-void free_symbol(struct symbol *symbol)
+#if 0
+static void free_symbol(struct symbol *symbol)
 {
     if (symbol == NULL)
         return;
@@ -104,8 +105,9 @@ void free_symbol(struct symbol *symbol)
         free(symbol->name);
     free(symbol);
 }
-
-void insert_symbol(struct symbol *symbol)
+#endif
+
+static void insert_symbol(struct symbol *symbol)
 {
     static struct symbol *prev = NULL;
     struct symbol *s = symbol_table;
@@ -132,7 +134,7 @@ void insert_symbol(struct symbol *symbol
     prev = symbol;
 }
 
-struct symbol *lookup_symbol(size_t address)
+static struct symbol *lookup_symbol(size_t address)
 {
     struct symbol *s = symbol_table;
 
@@ -145,7 +147,7 @@ struct symbol *lookup_symbol(size_t addr
     return NULL;
 }
 
-void print_symbol(size_t addr)
+static void print_symbol(size_t addr)
 {
     struct symbol *s;
 
@@ -163,7 +165,7 @@ void print_symbol(size_t addr)
         printf("%s+%#x ", s->name, (unsigned int)(addr - s->address));
 }
 
-void read_symbol_table(const char *symtab)
+static void read_symbol_table(const char *symtab)
 {
     char line[256];
     char *p;
@@ -240,7 +242,7 @@ char *flag_values[22][2] =
     { NULL,     "cid"  }  // 21       Cpuid Identification Flag
 };
 
-void print_flags(uint64_t flags)
+static void print_flags(uint64_t flags)
 {
     int i;
 
@@ -253,7 +255,7 @@ void print_flags(uint64_t flags)
     printf("\n");
 }
 
-void print_special(unsigned long *regs, const char *name, unsigned int mask)
+static void print_special(unsigned long *regs, const char *name, unsigned int 
mask)
 {
     unsigned int i;
 
@@ -265,7 +267,7 @@ void print_special(unsigned long *regs, 
 #endif
 
 #ifdef __i386__
-void print_ctx(vcpu_guest_context_t *ctx1)
+static void print_ctx(vcpu_guest_context_t *ctx1)
 {
     struct cpu_user_regs *regs = &ctx1->user_regs;
 
@@ -294,7 +296,7 @@ void print_ctx(vcpu_guest_context_t *ctx
     }
 }
 #elif defined(__x86_64__)
-void print_ctx(vcpu_guest_context_t *ctx1)
+static void print_ctx(vcpu_guest_context_t *ctx1)
 {
     struct cpu_user_regs *regs = &ctx1->user_regs;
 
@@ -582,7 +584,7 @@ void print_ctx(vcpu_guest_context_t *ctx
 #endif
 
 #ifndef NO_TRANSLATION
-void *map_page(vcpu_guest_context_t *ctx, int vcpu, size_t virt)
+static void *map_page(vcpu_guest_context_t *ctx, int vcpu, size_t virt)
 {
     static unsigned long previous_mfn = 0;
     static void *mapped = NULL;
@@ -609,7 +611,7 @@ void *map_page(vcpu_guest_context_t *ctx
     return (void *)(mapped + offset);
 }
 
-void print_stack(vcpu_guest_context_t *ctx, int vcpu)
+static void print_stack(vcpu_guest_context_t *ctx, int vcpu)
 {
     struct cpu_user_regs *regs = &ctx->user_regs;
     size_t stack = STACK_POINTER(regs);
@@ -699,7 +701,7 @@ void print_stack(vcpu_guest_context_t *c
 }
 #endif
 
-void dump_ctx(int vcpu)
+static void dump_ctx(int vcpu)
 {
     int ret;
     vcpu_guest_context_any_t ctx;
@@ -748,7 +750,7 @@ void dump_ctx(int vcpu)
     }
 }
 
-void usage(void)
+static void usage(void)
 {
     printf("usage:\n\n");
 
diff -r 63317b6c3eab -r 750eee596adf tools/xentrace/xentrace.c
--- a/tools/xentrace/xentrace.c Mon Jul 14 15:21:03 2008 +0100
+++ b/tools/xentrace/xentrace.c Tue Jul 15 13:19:26 2008 +0100
@@ -68,7 +68,7 @@ static int event_fd = -1;
 static int event_fd = -1;
 static int virq_port = -1;
 
-void close_handler(int signal)
+static void close_handler(int signal)
 {
     interrupted = 1;
 }
@@ -84,7 +84,7 @@ void close_handler(int signal)
  * Outputs the trace buffer to a filestream, prepending the CPU and size
  * of the buffer write.
  */
-void write_buffer(unsigned int cpu, unsigned char *start, int size,
+static void write_buffer(unsigned int cpu, unsigned char *start, int size,
                int total_size, int outfd)
 {
     struct statvfs stat;
@@ -206,7 +206,7 @@ static void get_tbufs(unsigned long *mfn
  *
  * Maps the Xen trace buffers them into process address space.
  */
-struct t_buf *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
+static struct t_buf *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
                         unsigned long size)
 {
     struct t_buf *tbufs_mapped;
@@ -230,7 +230,7 @@ struct t_buf *map_tbufs(unsigned long tb
  * @type:           the new mask type,0-event mask, 1-cpu mask
  *
  */
-void set_mask(uint32_t mask, int type)
+static void set_mask(uint32_t mask, int type)
 {
     int ret = 0;
 
@@ -258,7 +258,7 @@ void set_mask(uint32_t mask, int type)
  * Initialises an array of pointers to individual trace buffers within the
  * mapped region containing all trace buffers.
  */
-struct t_buf **init_bufs_ptrs(void *bufs_mapped, unsigned int num,
+static struct t_buf **init_bufs_ptrs(void *bufs_mapped, unsigned int num,
                               unsigned long size)
 {
     int i;
@@ -291,7 +291,7 @@ struct t_buf **init_bufs_ptrs(void *bufs
  * mapped in user space.  Note that the trace buffer metadata contains machine
  * pointers - the array returned allows more convenient access to them.
  */
-unsigned char **init_rec_ptrs(struct t_buf **meta, unsigned int num)
+static unsigned char **init_rec_ptrs(struct t_buf **meta, unsigned int num)
 {
     int i;
     unsigned char **data;
@@ -312,7 +312,7 @@ unsigned char **init_rec_ptrs(struct t_b
 /**
  * get_num_cpus - get the number of logical CPUs
  */
-unsigned int get_num_cpus(void)
+static unsigned int get_num_cpus(void)
 {
     xc_physinfo_t physinfo = { 0 };
     int ret;
@@ -331,7 +331,7 @@ unsigned int get_num_cpus(void)
 /**
  * event_init - setup to receive the VIRQ_TBUF event
  */
-void event_init(void)
+static void event_init(void)
 {
     int rc;
 
@@ -354,7 +354,7 @@ void event_init(void)
  * wait_for_event_or_timeout - sleep for the specified number of milliseconds,
  *                             or until an VIRQ_TBUF event occurs
  */
-void wait_for_event_or_timeout(unsigned long milliseconds)
+static void wait_for_event_or_timeout(unsigned long milliseconds)
 {
     int rc;
     struct pollfd fd = { .fd = event_fd,
@@ -394,7 +394,7 @@ void wait_for_event_or_timeout(unsigned 
  * monitor_tbufs - monitor the contents of tbufs and output to a file
  * @logfile:       the FILE * representing the file to log to
  */
-int monitor_tbufs(int outfd)
+static int monitor_tbufs(int outfd)
 {
     int i;
 
@@ -512,7 +512,7 @@ const char *program_version     = "xentr
 const char *program_version     = "xentrace v1.2";
 const char *program_bug_address = "<mark.a.williamson@xxxxxxxxx>";
 
-void usage(void)
+static void usage(void)
 {
 #define USAGE_STR \
 "Usage: xentrace [OPTION...] [output file]\n" \
@@ -554,7 +554,7 @@ void usage(void)
 }
 
 /* convert the argument string pointed to by arg to a long int representation 
*/
-long argtol(const char *restrict arg, int base)
+static long argtol(const char *restrict arg, int base)
 {
     char *endp;
     long val;
@@ -574,7 +574,7 @@ long argtol(const char *restrict arg, in
     return val;
 }
 
-int parse_evtmask(char *arg)
+static int parse_evtmask(char *arg)
 {
     /* search filtering class */
     if (strcmp(arg, "gen") == 0){ 
@@ -595,7 +595,7 @@ int parse_evtmask(char *arg)
 }
 
 /* parse command line arguments */
-void parse_args(int argc, char **argv)
+static void parse_args(int argc, char **argv)
 {
     int option;
     static struct option long_options[] = {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.