bug-hurd
[Top][All Lists]
Advanced

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

[PATCH] Fix several warnings for -Wmissing-prototypes


From: Flavio Cruz
Subject: [PATCH] Fix several warnings for -Wmissing-prototypes
Date: Fri, 20 Jan 2023 01:19:53 -0500

* ddb/db_mp.c: remove unused function.
* device/ds_routines.c: use static qualifier.
* device/subrs.c: delete unused functions.
* i386/i386/ast_check.c: include prototypes in kern/ast.h
* i386/i386/db_disasm.c: Include prototypes in ddb/db_examine.h
* i386/i386/db_interface.h: Define prototype for kdb_kentry. Expose
  debug methods feep and kd_debug_put.
* i386/i386/db_trace.c: delete left over cthreads support, functions are
  not used.
* i386/i386/model_dep.h: Define prototype for c_boot_entry.
* i386/i386at/acpi_parse_apic.c: Static qualifiers.
* i386/i386at/autoconf.c: Include header file for prototypes and remove
  dead code.
* i386/i386at/autoconf.h: Fix prototype.
* i386/i386at/com.c: Add static qualifiers, delete dead code.
* i386/i386at/com.c: ditto.
* i386/i386at/com.h: Define prototypes for debug functions.
* i386/i386at/int_init.c: Include header.
* i386/i386at/kd.c: Include header for debug interface. Remove dead
  kd_cmdreg_read and make xga_getpos static.
* i386/i386at/kd_mouse.c: Static qualifiers.
* i386/i386at/lpr.c: Dead lprpr.
* i386/i386at/model_dep.c: Remove exit function.
* kern/mach_clock.c: Include mig prototypes.
* kern/mach_clock.h: Remove duplicates of mig prototypes.
* kern/machine.c: Use static.
* kern/startup.c: slave_main is unused.
* kern/thread.h: Define thread_stats that is useful for debugging.
* kern/timer.c: Keep db_thread_times since it can be used for debugging.
* kern/timer.h: ditto.
* linux/dev/glue/misc.c: Use mig header for host_get_time.
---
 ddb/db_mp.c                   |  11 ---
 device/ds_routines.c          |   6 +-
 device/subrs.c                |  44 ----------
 i386/i386/ast_check.c         |   1 +
 i386/i386/db_disasm.c         |   1 +
 i386/i386/db_interface.h      |  13 +++
 i386/i386/db_trace.c          | 155 ----------------------------------
 i386/i386/model_dep.h         |   5 ++
 i386/i386at/acpi_parse_apic.c |   2 +-
 i386/i386at/autoconf.c        |  16 +---
 i386/i386at/autoconf.h        |   4 +-
 i386/i386at/com.c             |  24 +-----
 i386/i386at/com.h             |   2 +
 i386/i386at/int_init.c        |   1 +
 i386/i386at/kd.c              |  94 +++++++++------------
 i386/i386at/kd_mouse.c        |   8 +-
 i386/i386at/lpr.c             |   6 --
 i386/i386at/model_dep.c       |   5 --
 kern/mach_clock.c             |   1 +
 kern/mach_clock.h             |  13 ---
 kern/machine.c                |   2 +-
 kern/startup.c                |   7 --
 kern/thread.h                 |   1 +
 kern/timer.c                  |  38 +++++----
 kern/timer.h                  |   8 ++
 linux/dev/glue/misc.c         |   1 +
 26 files changed, 106 insertions(+), 363 deletions(-)

diff --git a/ddb/db_mp.c b/ddb/db_mp.c
index 7c0f6f26..dbd4abb8 100644
--- a/ddb/db_mp.c
+++ b/ddb/db_mp.c
@@ -246,17 +246,6 @@ db_on(int cpu)
            db_continue_cmd(0, 0, 0, "");
 }
 
-/*
- * Called by interprocessor interrupt when one CPU is
- * in kernel debugger and wants to stop other CPUs
- */
-void
-remote_db_enter(void)
-{
-       db_slave[cpu_number()]++;
-       kdb_kintr();
-}
-
 /*
  * Acquire kernel debugger.
  * Conditional code for forwarding characters from slave to console
diff --git a/device/ds_routines.c b/device/ds_routines.c
index e5dec6c7..6d629f69 100644
--- a/device/ds_routines.c
+++ b/device/ds_routines.c
@@ -467,7 +467,7 @@ device_deallocate (device_t dev)
  * What follows is the interface for the native Mach devices.
  */
 
-ipc_port_t
+static ipc_port_t
 mach_convert_device_to_port (mach_device_t device)
 {
   ipc_port_t port;
@@ -1429,7 +1429,7 @@ device_set_status(
                                              status_count));
 }
 
-io_return_t
+static io_return_t
 mach_device_get_status(
        void                    *dev,
        dev_flavor_t            flavor,
@@ -1545,7 +1545,7 @@ void iodone(io_req_t ior)
        splx(s);
 }
 
-void  __attribute__ ((noreturn)) io_done_thread_continue(void)
+static void  __attribute__ ((noreturn)) io_done_thread_continue(void)
 {
        for (;;) {
            spl_t               s;
diff --git a/device/subrs.c b/device/subrs.c
index 2cf7e6f4..6e90a810 100644
--- a/device/subrs.c
+++ b/device/subrs.c
@@ -38,18 +38,6 @@
 
 
 
-/*
- * Print out disk name and block number for hard disk errors.
- */
-void harderr(const io_req_t ior, const char *cp)
-{
-       printf("%s%d%c: hard error sn%lu ",
-              cp,
-              minor(ior->io_unit) >> 3,
-              'a' + (minor(ior->io_unit) & 0x7),
-              ior->io_recnum);
-}
-
 /*
  * Convert Ethernet address to printable (loggable) representation.
  */
@@ -96,35 +84,3 @@ void wakeup(vm_offset_t channel)
 {
        thread_wakeup((event_t) channel);
 }
-
-io_req_t
-geteblk(int size)
-{
-       io_req_t        ior;
-
-       io_req_alloc(ior, 0);
-       ior->io_device = (mach_device_t)0;
-       ior->io_unit = 0;
-       ior->io_op = 0;
-       ior->io_mode = 0;
-       ior->io_recnum = 0;
-       ior->io_count = size;
-       ior->io_residual = 0;
-       ior->io_error = 0;
-
-       size = round_page(size);
-       ior->io_alloc_size = size;
-       if (kmem_alloc(kernel_map, (vm_offset_t *)&ior->io_data, size)
-               != KERN_SUCCESS)
-                   panic("geteblk");
-
-       return (ior);
-}
-
-void brelse(io_req_t ior)
-{
-       (void) vm_deallocate(kernel_map,
-                       (vm_offset_t) ior->io_data,
-                       ior->io_alloc_size);
-       io_req_free(ior);
-}
diff --git a/i386/i386/ast_check.c b/i386/i386/ast_check.c
index 36c665b2..5121abf1 100644
--- a/i386/i386/ast_check.c
+++ b/i386/i386/ast_check.c
@@ -32,6 +32,7 @@
  * Initial i386 implementation does nothing.
  */
 
+#include <kern/ast.h>
 #include <kern/processor.h>
 
 /*
diff --git a/i386/i386/db_disasm.c b/i386/i386/db_disasm.c
index 9271e08c..c1f577e9 100644
--- a/i386/i386/db_disasm.c
+++ b/i386/i386/db_disasm.c
@@ -33,6 +33,7 @@
 #include <machine/db_machdep.h>
 
 #include <ddb/db_access.h>
+#include <ddb/db_examine.h>
 #include <ddb/db_output.h>
 #include <ddb/db_sym.h>
 
diff --git a/i386/i386/db_interface.h b/i386/i386/db_interface.h
index f0a748f9..69a277ae 100644
--- a/i386/i386/db_interface.h
+++ b/i386/i386/db_interface.h
@@ -32,6 +32,10 @@ extern boolean_t kdb_trap (
        int                     code,
        struct i386_saved_state *regs);
 
+struct int_regs;
+
+extern void kdb_kentry(struct int_regs *int_regs);
+
 extern boolean_t db_read_bytes (
        vm_offset_t     addr,
        int             size,
@@ -111,6 +115,15 @@ db_i386_reg_value(
        int                     flag,
        struct db_var_aux_param *ap);
 
+void feep(void);
+
+/*
+ * Put a debugging character on the screen.
+ * LOC=0 means put it in the bottom right corner, LOC=1 means put it
+ * one column to the left, etc.
+ */
+void kd_debug_put(int loc, char c);
+
 #endif
 
 extern void db_get_debug_state(
diff --git a/i386/i386/db_trace.c b/i386/i386/db_trace.c
index 5eebc727..99cb8c48 100644
--- a/i386/i386/db_trace.c
+++ b/i386/i386/db_trace.c
@@ -558,159 +558,4 @@ db_i386_stack_trace(
        }
 }
 
-#define        CTHREADS_SUPPORT        1
-
-#if    CTHREADS_SUPPORT
-
-static thread_t
-db_find_kthread(
-       vm_offset_t     ustack_base,
-       vm_size_t       ustack_top,
-       task_t          task)
-{
-       thread_t thread;
-       if (task == TASK_NULL)
-               task = db_current_task();
-
-       queue_iterate(&task->thread_list, thread, thread_t, thread_list) {
-               vm_offset_t     usp = thread->pcb->iss.uesp/*ebp works*/;
-               if (usp >= ustack_base && usp < ustack_top)
-                       return thread;
-       }
-       return THREAD_NULL;
-}
-
-static void db_cproc_state(
-       int     state,
-       char    s[4])
-{
-       if (state == 0) {
-               *s++ = 'R';
-       } else {
-               if (state & 1) *s++ = 'S';
-               if (state & 2) *s++ = 'B';
-               if (state & 4) *s++ = 'C';
-       }
-       *s = 0;
-}
-
-/* offsets in a cproc structure */
-/* TODO: longs? */
-const int db_cproc_next_offset = 0 * 4;
-const int db_cproc_incarnation_offset = 1 * 4;
-const int db_cproc_list_offset = 2 * 4;
-const int db_cproc_wait_offset = 3 * 4;
-const int db_cproc_context_offset = 5 * 4;
-const int db_cproc_state_offset = 7 * 4;
-const int db_cproc_stack_base_offset = 10 * 4 + sizeof(mach_msg_header_t);
-const int db_cproc_stack_size_offset = 11 * 4 + sizeof(mach_msg_header_t);
-
-/* offsets in a cproc_switch context structure */
-const int db_cprocsw_framep_offset = 3 * 4;
-const int db_cprocsw_pc_offset = 4 * 4;
-
-#include <machine/setjmp.h>
-
-extern jmp_buf_t *db_recover;
-
-static void db_trace_cproc(
-       vm_offset_t     cproc,
-       thread_t        thread)
-{
-       jmp_buf_t       db_jmpbuf;
-       jmp_buf_t       *prev = db_recover;
-       task_t          task;
-       db_addr_t       pc, fp, sp;
-
-       task = (thread == THREAD_NULL)? TASK_NULL: thread->task;
-
-       if (!_setjmp(db_recover = &db_jmpbuf)) {
-               char pstate[4];
-               unsigned int s, w, n, c, cth;
-
-               s = db_get_task_value(cproc + db_cproc_state_offset, 4, FALSE, 
task);
-               w = db_get_task_value(cproc + db_cproc_wait_offset, 4, FALSE, 
task);
-               n = db_get_task_value(cproc + db_cproc_next_offset, 4, FALSE, 
task);
-               c = db_get_task_value(cproc + db_cproc_context_offset, 4, 
FALSE, task);
-               cth = db_get_task_value(cproc + db_cproc_incarnation_offset, 4, 
FALSE, task);
-
-               db_cproc_state(s, pstate);
-
-               db_printf("CThread %x (cproc %x) %s", cth, cproc, pstate);
-               if (w) db_printf(" awaits %x", w);
-               if (n) db_printf(" next %x", n);
-               db_printf("\n");
-
-               if ((s != 0) && (c != 0)) {
-                       pc = db_get_task_value(c + db_cprocsw_pc_offset, 4, 
FALSE, task);
-                       fp = c + db_cprocsw_framep_offset;
-                       sp = 0; // TODO
-               } else {
-                       db_addr_t sb;
-                       vm_size_t ss;
-
-                       sb = db_get_task_value(cproc + 
db_cproc_stack_base_offset, sizeof(db_expr_t), FALSE, task);
-                       ss = db_get_task_value(cproc + 
db_cproc_stack_size_offset, sizeof(db_expr_t), FALSE, task);
-                       db_printf(" Stack base: %x\n", sb);
-                       /*
-                        *  Lessee now..
-                        */
-                       thread = db_find_kthread(sb, sb+ss, task);
-                       if (thread != THREAD_NULL) {
-                           pc = thread->pcb->iss.eip;
-                           fp = thread->pcb->iss.ebp;
-                           sp = thread->pcb->iss.uesp;
-                       } else {
-                           fp = -1;
-                       }
-               }
-
-               if (fp != -1)
-                       db_i386_stack_trace(thread, (struct i386_frame*)fp, sp, 
pc,
-                                               -1, F_USER_TRACE);
-       }
-
-       db_recover = prev;
-}
-
-void db_all_cprocs(
-       const task_t    task,
-       db_expr_t       cproc_list)
-{
-       jmp_buf_t       db_jmpbuf;
-       jmp_buf_t       *prev = db_recover;
-       thread_t        thread;
-       db_expr_t       cproc, next;
-
-
-       if (task != TASK_NULL) {
-               thread = (thread_t) queue_first(&task->thread_list);
-       } else
-               thread = current_thread();
-
-       if (cproc_list != 0)
-               next = cproc_list;
-       else
-               if (!db_value_of_name("unix::cproc_list", &next)) {
-                       db_printf("No cprocs.\n");
-                       return;
-               }
-
-
-       while (next) {
-               if (_setjmp(db_recover = &db_jmpbuf))
-                       break;
-
-               cproc = db_get_task_value(next, 4, FALSE, TASK_NULL);
-               if (cproc == 0) break;
-               next = cproc + db_cproc_list_offset;
-
-               db_trace_cproc(cproc, thread);
-       }
-
-       db_recover = prev;
-}
-
-#endif /* CTHREADS_SUPPORT */
-
 #endif /* MACH_KDB */
diff --git a/i386/i386/model_dep.h b/i386/i386/model_dep.h
index 711f07fd..095eec9b 100644
--- a/i386/i386/model_dep.h
+++ b/i386/i386/model_dep.h
@@ -55,4 +55,9 @@ extern void halt_all_cpus (boolean_t reboot) __attribute__ 
((noreturn));
  */
 extern void machine_relax (void);
 
+/*
+ * C boot entrypoint - called by boot_entry in boothdr.S.
+ */
+extern void c_boot_entry(vm_offset_t bi);
+
 #endif /* _I386AT_MODEL_DEP_H_ */
diff --git a/i386/i386at/acpi_parse_apic.c b/i386/i386at/acpi_parse_apic.c
index 22ed8979..2680d0aa 100644
--- a/i386/i386at/acpi_parse_apic.c
+++ b/i386/i386at/acpi_parse_apic.c
@@ -173,7 +173,7 @@ acpi_search_rsdp(void *addr, uint32_t length)
  *
  * Returns the reference to RDSP structure if success, NULL if failure.
  */
-struct acpi_rsdp*
+static struct acpi_rsdp*
 acpi_get_rsdp(void)
 {
     uint16_t *start = 0;
diff --git a/i386/i386at/autoconf.c b/i386/i386at/autoconf.c
index 8dc0b3ea..ef813d92 100644
--- a/i386/i386at/autoconf.c
+++ b/i386/i386at/autoconf.c
@@ -26,6 +26,7 @@
 
 #include <kern/printf.h>
 #include <mach/std_types.h>
+#include <i386at/autoconf.h>
 #include <i386/irq.h>
 #include <i386/ipl.h>
 #include <chips/busses.h>
@@ -140,18 +141,3 @@ void take_dev_irq(
        }
 
 }
-
-void take_ctlr_irq(
-       const struct bus_ctlr *ctlr)
-{
-       int pic = ctlr->sysdep1;
-       if (ivect[pic] == intnull) {
-               iunit[pic] = ctlr->unit;
-               ivect[pic] = ctlr->intr;
-       } else {
-               printf("The device below will clobber IRQ %d (%p).\n", pic, 
ivect[pic]);
-               printf("You have two devices at the same IRQ.  This won't 
work.\n");
-               printf("Reconfigure your hardware and try again.\n");
-               while (1);
-       }
-}
diff --git a/i386/i386at/autoconf.h b/i386/i386at/autoconf.h
index a16a88f9..81fc5da7 100644
--- a/i386/i386at/autoconf.h
+++ b/i386/i386at/autoconf.h
@@ -37,7 +37,7 @@
  */
 void probeio(void);
 
-extern void take_dev_irq (
-    struct bus_device *dev);
+void take_dev_irq(
+       const struct bus_device *dev);
 
 #endif /* _AUTOCONF_H_ */
diff --git a/i386/i386at/com.c b/i386/i386at/com.c
index a6d6f701..000475db 100644
--- a/i386/i386at/com.c
+++ b/i386/i386at/com.c
@@ -91,7 +91,7 @@ u_short divisorreg[] = {
  * the relevant device is present today.
  *
  */
-int
+static int
 comprobe_general(struct bus_device *dev, int noisy)
 {
        u_short addr = dev->address;
@@ -298,7 +298,7 @@ comcninit(struct consdev *cp)
  *     Used to handle PCMCIA modems, which may appear
  *     at any time.
  */
-boolean_t com_reprobe(
+static boolean_t com_reprobe(
        int     unit)
 {
        struct bus_device       *device;
@@ -617,26 +617,6 @@ comparam(int unit)
         splx(s);
 }
 
-void
-comparm(int unit, int baud, int intr, int mode, int modem)
-{
-       u_short addr = (u_short)(cominfo[unit]->address);
-       spl_t   s = spltty();
-
-       if (unit != 0 && unit != 1) {
-               printf("comparm(unit, baud, mode, intr, modem)\n");
-               splx(s);
-               return;
-       }
-       outb(LINE_CTL(addr), iDLAB);
-       outb(BAUD_LSB(addr), divisorreg[baud] & 0xff);
-       outb(BAUD_MSB(addr), divisorreg[baud] >> 8);
-       outb(LINE_CTL(addr), mode);
-       outb(INTR_ENAB(addr), intr);
-       outb(MODEM_CTL(addr), modem);
-       splx(s);
-}
-
 int comst_1, comst_2, comst_3, comst_4, comst_5 = 14;
 
 void
diff --git a/i386/i386at/com.h b/i386/i386at/com.h
index a415488c..3be29305 100644
--- a/i386/i386at/com.h
+++ b/i386/i386at/com.h
@@ -73,6 +73,8 @@ comsetstat(
 
 #if MACH_KDB
 extern void kdb_kintr(void);
+extern void compr_addr(vm_offset_t addr);
+extern int compr(int unit);
 #endif /* MACH_KDB */
 
 extern io_return_t comopen(dev_t dev, int flag, io_req_t ior);
diff --git a/i386/i386at/int_init.c b/i386/i386at/int_init.c
index 6da627dd..3fed4197 100644
--- a/i386/i386at/int_init.c
+++ b/i386/i386at/int_init.c
@@ -22,6 +22,7 @@
  */
 
 #include <i386at/idt.h>
+#include <i386at/int_init.h>
 #include <i386/gdt.h>
 
 /* defined in locore.S */
diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c
index 9abc1dd0..2fa7b60d 100644
--- a/i386/i386at/kd.c
+++ b/i386/i386at/kd.c
@@ -85,6 +85,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include <device/io_req.h>
 #include <device/buf.h>
 #include <vm/vm_kern.h>
+#include <i386/db_interface.h>
 #include <i386/locore.h>
 #include <i386/loose_ends.h>
 #include <i386/vm_param.h>
@@ -346,6 +347,15 @@ short      font_byte_width = 0;            /* num bytes in 
1 scan line of font */
 int    kd_pollc = 0;
 
 #ifdef DEBUG
+static void
+pause(void)
+{
+       int i;
+
+       for (i = 0; i < 50000; ++i)
+               ;
+}
+
 /*
  * feep:
  *
@@ -355,23 +365,11 @@ int       kd_pollc = 0;
 void
 feep(void)
 {
-       int i;
-
        kd_bellon();
-       for (i = 0; i < 50000; ++i)
-               ;
+       pause();
        kd_belloff(NULL);
 }
 
-void
-pause(void)
-{
-       int i;
-
-       for (i = 0; i < 50000; ++i)
-               ;
-}
-
 /*
  * Put a debugging character on the screen.
  * LOC=0 means put it in the bottom right corner, LOC=1 means put it
@@ -2255,20 +2253,6 @@ kd_getdata(void)
        return(inb(K_RDWR));
 }
 
-unsigned char
-kd_cmdreg_read(void)
-{
-int ch=KC_CMD_READ;
-
-       while (inb(K_STATUS) & K_IBUF_FUL)
-               ;
-       outb(K_CMD, ch);
-
-       while ((inb(K_STATUS) & K_OBUF_FUL) == 0)
-               ;
-       return(inb(K_RDWR));
-}
-
 void
 kd_cmdreg_write(int val)
 {
@@ -2473,6 +2457,33 @@ int new_button = 0;
  */
 #define        SLAMBPW 2                       /* bytes per word for "slam" 
fcns */
 
+/*
+ * xga_getpos:
+ *
+ *     This function returns the current hardware cursor position on the
+ *     screen, scaled for compatibility with kd_curpos.
+ *
+ * input       : None
+ * output      : returns the value of cursor position on screen
+ *
+ */
+static csrpos_t
+xga_getpos(void)
+
+{
+       unsigned char   low;
+       unsigned char   high;
+       short pos;
+
+       outb(kd_index_reg, C_HIGH);
+       high = inb(kd_io_reg);
+       outb(kd_index_reg, C_LOW);
+       low = inb(kd_io_reg);
+       pos = (0xff&low) + ((unsigned short)high<<8);
+
+       return(ONE_SPACE * (csrpos_t)pos);
+}
+
 
 /*
  * kd_xga_init:
@@ -2482,7 +2493,6 @@ int new_button = 0;
 void
 kd_xga_init(void)
 {
-       csrpos_t        xga_getpos(void);
        unsigned char   start, stop;
 
 #if 0
@@ -2570,34 +2580,6 @@ kd_xga_init(void)
 }
 
 
-/*
- * xga_getpos:
- *
- *     This function returns the current hardware cursor position on the
- *     screen, scaled for compatibility with kd_curpos.
- *
- * input       : None
- * output      : returns the value of cursor position on screen
- *
- */
-csrpos_t
-xga_getpos(void)
-
-{
-       unsigned char   low;
-       unsigned char   high;
-       short pos;
-
-       outb(kd_index_reg, C_HIGH);
-       high = inb(kd_io_reg);
-       outb(kd_index_reg, C_LOW);
-       low = inb(kd_io_reg);
-       pos = (0xff&low) + ((unsigned short)high<<8);
-
-       return(ONE_SPACE * (csrpos_t)pos);
-}
-
-
 /*
  * charput:
  *
diff --git a/i386/i386at/kd_mouse.c b/i386/i386at/kd_mouse.c
index 906c1d37..c870cf5a 100644
--- a/i386/i386at/kd_mouse.c
+++ b/i386/i386at/kd_mouse.c
@@ -110,7 +110,7 @@ int         mouse_char_index;               /* mouse 
response */
 /*
  * init_mouse_hw - initialize the serial port.
  */
-void
+static void
 init_mouse_hw(dev_t unit, int mode)
 {
        unsigned short base_addr  = cominfo[unit]->address;
@@ -594,7 +594,7 @@ mouse_packet_microsoft_mouse(u_char mousebuf[MOUSEBUFSIZE])
 /*
  *     Write character to mouse.  Called at spltty.
  */
-void kd_mouse_write(
+static void kd_mouse_write(
        unsigned char   ch)
 {
        while (inb(K_STATUS) & K_IBUF_FUL)
@@ -610,7 +610,7 @@ void kd_mouse_write(
  *     Read next character from mouse, waiting for interrupt
  *     to deliver it.  Called at spltty.
  */
-int kd_mouse_read(void)
+static int kd_mouse_read(void)
 {
        int     ch;
 
@@ -633,7 +633,7 @@ int kd_mouse_read(void)
 /*
  *     Prepare buffer for receiving next packet from mouse.
  */
-void kd_mouse_read_reset(void)
+static void kd_mouse_read_reset(void)
 {
        mousebufindex = 0;
        mouse_char_index = 0;
diff --git a/i386/i386at/lpr.c b/i386/i386at/lpr.c
index 3939af54..f8d42f3c 100644
--- a/i386/i386at/lpr.c
+++ b/i386/i386at/lpr.c
@@ -273,12 +273,6 @@ lprstop(
        if ((tp->t_state & TS_BUSY) && (tp->t_state & TS_TTSTOP) == 0)
                tp->t_state |= TS_FLUSH;
 }
-int
-lprpr(int unit)
-{
-       lprpr_addr(lprinfo[unit]->address);
-       return 0;
-}
 
 void
 lprpr_addr(unsigned short addr)
diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c
index 9ccc7551..7a679ba4 100644
--- a/i386/i386at/model_dep.c
+++ b/i386/i386at/model_dep.c
@@ -278,11 +278,6 @@ void halt_all_cpus(boolean_t reboot)
          machine_idle (cpu_number ());
 }
 
-void exit(int rc)
-{
-       halt_all_cpus(0);
-}
-
 void db_halt_cpu(void)
 {
        halt_all_cpus(0);
diff --git a/kern/mach_clock.c b/kern/mach_clock.c
index 06688fea..4b983fdd 100644
--- a/kern/mach_clock.c
+++ b/kern/mach_clock.c
@@ -47,6 +47,7 @@
 #include <kern/host.h>
 #include <kern/lock.h>
 #include <kern/mach_clock.h>
+#include <kern/mach_host.server.h>
 #include <kern/processor.h>
 #include <kern/queue.h>
 #include <kern/sched.h>
diff --git a/kern/mach_clock.h b/kern/mach_clock.h
index 2da311d1..7e8d3046 100644
--- a/kern/mach_clock.h
+++ b/kern/mach_clock.h
@@ -100,19 +100,6 @@ extern void record_time_stamp (time_value_t *stamp);
  */
 extern void read_time_stamp (const time_value_t *stamp, time_value_t *result);
 
-extern kern_return_t host_get_time(
-   host_t host,
-   time_value_t *current_time);
-
-extern kern_return_t host_set_time(
-   host_t host,
-   time_value_t new_time);
-
-extern kern_return_t host_adjust_time(
-   host_t host,
-   time_value_t new_adjustment,
-   time_value_t *old_adjustment);
-
 extern void mapable_time_init (void);
 
 /* For public timer elements.  */
diff --git a/kern/machine.c b/kern/machine.c
index 8da6ad66..7eead810 100644
--- a/kern/machine.c
+++ b/kern/machine.c
@@ -153,7 +153,7 @@ static void cpu_down(int cpu)
  *             a shutdown, else it's an assign and caller must donate
  *             a reference.
  */
-void
+static void
 processor_request_action(
        processor_t     processor,
        processor_set_t new_pset)
diff --git a/kern/startup.c b/kern/startup.c
index bf63ec0e..2eb3a739 100644
--- a/kern/startup.c
+++ b/kern/startup.c
@@ -273,13 +273,6 @@ void start_kernel_threads(void)
        /*NOTREACHED*/
 }
 
-#if    NCPUS > 1
-void slave_main(void)
-{
-       cpu_launch_first_thread(THREAD_NULL);
-}
-#endif /* NCPUS > 1 */
-
 /*
  *     Start up the first thread on a CPU.
  *     First thread is specified for the master CPU.
diff --git a/kern/thread.h b/kern/thread.h
index ebbbd11c..7252f410 100644
--- a/kern/thread.h
+++ b/kern/thread.h
@@ -410,6 +410,7 @@ extern void         thread_unfreeze(
 #if MACH_DEBUG
 void stack_init(vm_offset_t stack);
 void stack_finalize(vm_offset_t stack);
+void thread_stats(void);
 #endif /* MACH_DEBUG */
 
 #endif /* _KERN_THREAD_H_ */
diff --git a/kern/timer.c b/kern/timer.c
index 79ada27e..af6d4b28 100644
--- a/kern/timer.c
+++ b/kern/timer.c
@@ -374,24 +374,6 @@ static void timer_grab(
        } while ( (save)->high != (timer)->high_bits_check);
 }
 
-/*
- *
- *     Db_timer_grab(): used by db_thread_read_times. An nonblocking
- *      version of db_thread_get_times. Keep coherent with timer_grab
- *      above.
- *
- */
-void db_timer_grab(
-       timer_t         timer,
-       timer_save_t    save)
-{
-  /* Don't worry about coherency */
-
-  (save)->high = (timer)->high_bits;
-  (save)->low = (timer)->low_bits;
-}
-
-
 /*
  *     timer_read reads the value of a timer into a time_value_t.  If the
  *     timer was modified during the read, retry.  The value returned
@@ -453,6 +435,25 @@ void       thread_read_times(
        system_time_p->microseconds = temp.low % 1000000;
 }
 
+#if    MACH_DEBUG
+
+/*
+ *
+ *     Db_timer_grab(): used by db_thread_read_times. An nonblocking
+ *      version of db_thread_get_times. Keep coherent with timer_grab
+ *      above.
+ *
+ */
+static void db_timer_grab(
+       timer_t         timer,
+       timer_save_t    save)
+{
+  /* Don't worry about coherency */
+
+  (save)->high = (timer)->high_bits;
+  (save)->low = (timer)->low_bits;
+}
+
 /*
  *      Db_thread_read_times: A version of thread_read_times that
  *      can be called by the debugger. This version does not call
@@ -486,6 +487,7 @@ void        db_thread_read_times(
        system_time_p->seconds = temp.high + temp.low/1000000;
        system_time_p->microseconds = temp.low % 1000000;
 }
+#endif  /* MACH_DEBUG */
 
 /*
  *     timer_delta takes the difference of a saved timer value
diff --git a/kern/timer.h b/kern/timer.h
index 2f473cf8..35782b41 100644
--- a/kern/timer.h
+++ b/kern/timer.h
@@ -184,4 +184,12 @@ extern void init_timers(void);
 
 void timer_init(timer_t this_timer);
 
+#if    MACH_DEBUG
+void   db_thread_read_times(
+       thread_t        thread,
+       time_value_t    *user_time_p,
+       time_value_t    *system_time_p);
+#endif
+
+
 #endif /* _KERN_TIMER_H_ */
diff --git a/linux/dev/glue/misc.c b/linux/dev/glue/misc.c
index 77dc31dd..92541c7b 100644
--- a/linux/dev/glue/misc.c
+++ b/linux/dev/glue/misc.c
@@ -54,6 +54,7 @@
 #include <mach/vm_param.h>
 #include <kern/thread.h>
 #include <kern/printf.h>
+#include <kern/mach_host.server.h>
 #include <vm/vm_map.h>
 #include <vm/vm_page.h>
 #include <device/device_types.h>
-- 
2.39.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]