public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc: kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [PATCH 02 of 17] Make static slot & kvm_memory region funcions public
Date: Tue, 06 Nov 2007 10:48:43 -0600	[thread overview]
Message-ID: <e564a557782efc234287.1194367723@thinkpad> (raw)
In-Reply-To: <patchbomb.1194367721@thinkpad>

# HG changeset patch
# User Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
# Date 1194367645 21600
# Node ID e564a557782efc23428705de12cd3e8b9517e11c
# Parent  dc86d46f1d10fd53c332f1cb7c2f1e880616694a
Make static slot & kvm_memory region funcions public

This patch changes static functions for manipulation of memory slots
and regions public in libkvm.c. This also makes a decleration for these
functions in kvm-common.h.

This allow for breaking out code into other files and still keep this
functionality. These functions can later be broken up some to
move there x86 specific stuff (ex. TSS).

Signed-off-by: Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

diff --git a/libkvm/kvm-common.h b/libkvm/kvm-common.h
--- a/libkvm/kvm-common.h
+++ b/libkvm/kvm-common.h
@@ -49,4 +49,14 @@ struct kvm_context {
 	int irqchip_in_kernel;
 };
 
+void init_slots(void);
+int get_free_slot(kvm_context_t kvm);
+void register_slot(int slot, unsigned long phys_addr);
+int get_slot(unsigned long phys_addr);
+void kvm_memory_region_save_params(kvm_context_t kvm,
+                                        struct kvm_memory_region *mem);
+void kvm_userspace_memory_region_save_params(kvm_context_t kvm,
+                                struct kvm_userspace_memory_region *mem);
+void kvm_memory_region_clear_params(kvm_context_t kvm, int regnum);
+
 #endif
diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c
--- a/libkvm/libkvm.c
+++ b/libkvm/libkvm.c
@@ -46,7 +46,7 @@ int free_slots[KVM_MAX_NUM_MEM_REGIONS];
 int free_slots[KVM_MAX_NUM_MEM_REGIONS];
 unsigned long phys_addr_slots[KVM_MAX_NUM_MEM_REGIONS];
 
-static void init_slots()
+void init_slots(void)
 {
 	int i;
 
@@ -54,7 +54,7 @@ static void init_slots()
 		free_slots[i] = 0;
 }
 
-static int get_free_slot(kvm_context_t kvm)
+int get_free_slot(kvm_context_t kvm)
 {
 	int i;
 	int tss_ext;
@@ -81,13 +81,13 @@ static int get_free_slot(kvm_context_t k
 	return -1;
 }
 
-static void register_slot(int slot, unsigned long phys_addr)
+void register_slot(int slot, unsigned long phys_addr)
 {
 	free_slots[slot] = 1;
 	phys_addr_slots[slot] = phys_addr;
 }
 
-static int get_slot(unsigned long phys_addr)
+int get_slot(unsigned long phys_addr)
 {
 	int i;
 
@@ -100,7 +100,7 @@ static int get_slot(unsigned long phys_a
 /*
  * memory regions parameters
  */
-static void kvm_memory_region_save_params(kvm_context_t kvm, 
+void kvm_memory_region_save_params(kvm_context_t kvm, 
 					 struct kvm_memory_region *mem)
 {
 	if (!mem || (mem->slot >= KVM_MAX_NUM_MEM_REGIONS)) {
@@ -112,7 +112,7 @@ static void kvm_memory_region_save_param
 
 #ifdef KVM_CAP_USER_MEMORY
 
-static void kvm_userspace_memory_region_save_params(kvm_context_t kvm,
+void kvm_userspace_memory_region_save_params(kvm_context_t kvm,
 					struct kvm_userspace_memory_region *mem)
 {
 	struct kvm_memory_region kvm_mem;
@@ -126,7 +126,7 @@ static void kvm_userspace_memory_region_
 
 #endif
 
-static void kvm_memory_region_clear_params(kvm_context_t kvm, int regnum)
+void kvm_memory_region_clear_params(kvm_context_t kvm, int regnum)
 {
 	if (regnum >= KVM_MAX_NUM_MEM_REGIONS) {
 		fprintf(stderr, "BUG: %s: invalid parameters\n", __FUNCTION__);

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

  parent reply	other threads:[~2007-11-06 16:48 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-06 16:48 [PATCH 00 of 17] [v4] libkvm refactor Jerone Young
2007-11-06 16:48 ` [PATCH 01 of 17] Move kvm_context to kvm-common.h & add CFLAGS to config-* filese Jerone Young
2007-11-06 16:48 ` Jerone Young [this message]
2007-11-06 16:48 ` [PATCH 03 of 17] Move fuction kvm_alloc_kernel_memory to libkvm-x86.c Jerone Young
2007-11-06 16:48 ` [PATCH 04 of 17] Move kvm_alloc_userspace_memory " Jerone Young
2007-11-06 16:48 ` [PATCH 05 of 17] Modify out arch specific code from kvm_create function Jerone Young
2007-11-06 16:48 ` [PATCH 06 of 17] Move kvm_create_kernel_phys_mem to libkvm-x86.c Jerone Young
2007-11-06 16:48 ` [PATCH 07 of 17] Move kvm_create_memory_alias & kvm_destroy_memory_alias " Jerone Young
2007-11-07 13:52   ` Avi Kivity
2007-11-06 16:48 ` [PATCH 08 of 17] Move kvm_get & kmv_set_lapci functions " Jerone Young
2007-11-06 16:48 ` [PATCH 09 of 17] Make functions in libkvm.c nonstatic Jerone Young
2007-11-06 16:48 ` [PATCH 10 of 17] Move abi 10 functions to libkvm-x86.c Jerone Young
2007-11-06 16:48 ` [PATCH 11 of 17] Move msrs " Jerone Young
2007-11-08  5:57   ` Carlo Marcelo Arenas Belon
2007-11-08  5:54     ` Avi Kivity
     [not found]       ` <4732A4AE.30100-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-08  6:34         ` [PATCH] make msrs functions public for x86 Carlo Marcelo Arenas Belon
2007-11-08  8:30           ` Avi Kivity
2007-11-08 17:10           ` Jerone Young
2007-11-08 18:59         ` [PATCH 11 of 17] Move msrs functions to libkvm-x86.c Hollis Blanchard
2007-11-11 10:01           ` Avi Kivity
2007-11-06 16:48 ` [PATCH 12 of 17] Move print_seg & Move kvm_show_regs " Jerone Young
2007-11-06 16:48 ` [PATCH 13 of 17] Declare kvm_abi as a global variable in kvm-common.h Jerone Young
2007-11-06 16:48 ` [PATCH 14 of 17] Move kvm_get_apic to libkvm-x86.c Jerone Young
2007-11-06 16:48 ` [PATCH 15 of 17] Move cr8 functions " Jerone Young
2007-11-06 16:48 ` [PATCH 16 of 17] Move kvm_setup_cpuid " Jerone Young
2007-11-06 16:48 ` [PATCH 17 of 17] Remove unsued inclusion of linux/kvm_parah.h in userspace libkvm.h Jerone Young
2007-11-07 13:52 ` [PATCH 00 of 17] [v4] libkvm refactor Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e564a557782efc234287.1194367723@thinkpad \
    --to=jyoung5-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox