Skip to contentSkip to conversation

Declare code_gen_ptr, code_gen_max_blocks 'static'

PATCH Applied Stefan Weil 2 participants 2 messages Jul 19, 2010 – Jul 22, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Declare code_gen_ptr, code_gen_max_blocks 'static'

Both values are only used in exec.c, so there is no need to make them globally available.

---
 exec-all.h |    2 --
 exec.c     |    4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)
exec-all.h +0 -2
index a775582..58b5575 100644
@@ -191,8 +191,6 @@ void tb_link_page(TranslationBlock *tb,
 void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr);
 
 extern TranslationBlock *tb_phys_hash[CODE_GEN_PHYS_HASH_SIZE];
-extern uint8_t *code_gen_ptr;
-extern int code_gen_max_blocks;
 
 #if defined(USE_DIRECT_JUMP)
 
exec.c +2 -2
index 4641b3e..868cd7f 100644
@@ -80,7 +80,7 @@
 #define SMC_BITMAP_USE_THRESHOLD 10
 
 static TranslationBlock *tbs;
-int code_gen_max_blocks;
+static int code_gen_max_blocks;
 TranslationBlock *tb_phys_hash[CODE_GEN_PHYS_HASH_SIZE];
 static int nb_tbs;
 /* any access to the tbs or the page table must use this lock */
@@ -107,7 +107,7 @@ static uint8_t *code_gen_buffer;
 static unsigned long code_gen_buffer_size;
 /* threshold to flush the translated code buffer */
 static unsigned long code_gen_buffer_max_size;
-uint8_t *code_gen_ptr;
+static uint8_t *code_gen_ptr;
 
 #if !defined(CONFIG_USER_ONLY)
 int phys_ram_fd;
Signature · 1 line
1.7.1
#1 lore raw
Quoted 8 lines · Stefan Weil

Both values are only used in exec.c, so there is no need to make them globally available.

---
 exec-all.h |    2 --
 exec.c     |    4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

Thanks, applied.

Quoted 40 lines
exec-all.h +0 -2
index a775582..58b5575 100644
@@ -191,8 +191,6 @@ void tb_link_page(TranslationBlock *tb,
 void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr);
 
 extern TranslationBlock *tb_phys_hash[CODE_GEN_PHYS_HASH_SIZE];
-extern uint8_t *code_gen_ptr;
-extern int code_gen_max_blocks;
 
 #if defined(USE_DIRECT_JUMP)
 
exec.c +2 -2
index 4641b3e..868cd7f 100644
@@ -80,7 +80,7 @@
 #define SMC_BITMAP_USE_THRESHOLD 10
 
 static TranslationBlock *tbs;
-int code_gen_max_blocks;
+static int code_gen_max_blocks;
 TranslationBlock *tb_phys_hash[CODE_GEN_PHYS_HASH_SIZE];
 static int nb_tbs;
 /* any access to the tbs or the page table must use this lock */
@@ -107,7 +107,7 @@ static uint8_t *code_gen_buffer;
 static unsigned long code_gen_buffer_size;
 /* threshold to flush the translated code buffer */
 static unsigned long code_gen_buffer_max_size;
-uint8_t *code_gen_ptr;
+static uint8_t *code_gen_ptr;
 
 #if !defined(CONFIG_USER_ONLY)
 int phys_ram_fd;
Signature · 1 line
1.7.1
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net