Rename VISIBLE macro for better control.
authorKevin O'Connor <kevin@koconnor.net>
Thu, 6 Mar 2008 02:09:59 +0000 (21:09 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 6 Mar 2008 02:09:59 +0000 (21:09 -0500)
VISIBLE16 is used to mark functions externally available in 16bit code.
VISIBLE32 is for 32bit functions.

src/boot.c
src/clock.c
src/disk.c
src/floppy.c
src/floppy_dbt.c
src/kbd.c
src/mouse.c
src/post.c
src/serial.c
src/system.c
src/types.h

index a21136ed6b439587c84a97f19d62cf71519864b8..944eb21e556a6d82d2c95d0e856e9fc59c5421f5 100644 (file)
@@ -15,7 +15,7 @@
 // We need a copy of this string, but we are not actually a PnP BIOS,
 // so make sure it is *not* aligned, so OSes will not see it if they
 // scan.
-char pnp_string[] VISIBLE __attribute__((aligned (2))) = " $PnP";
+char pnp_string[] VISIBLE16 __attribute__((aligned (2))) = " $PnP";
 
 //--------------------------------------------------------------------------
 // print_boot_device
@@ -178,7 +178,7 @@ try_boot(u16 seq_nr)
 }
 
 // Boot Failure recovery: try the next device.
-void VISIBLE
+void VISIBLE16
 handle_18()
 {
     debug_enter(NULL);
@@ -187,7 +187,7 @@ handle_18()
 }
 
 // INT 19h Boot Load Service Entry Point
-void VISIBLE
+void VISIBLE16
 handle_19()
 {
     debug_enter(NULL);
@@ -195,7 +195,7 @@ handle_19()
 }
 
 // Called from 32bit code - start boot process
-void VISIBLE
+void VISIBLE16
 begin_boot()
 {
     if (CONFIG_ATA)
index a8c1d2ec1a3d08ba8b8c6ce19afcd5a7ee13ff7f..6b1213713659ad76900be2a225d1e9a8dadad3c1 100644 (file)
@@ -230,7 +230,7 @@ handle_1aXX(struct bregs *regs)
 }
 
 // INT 1Ah Time-of-day Service Entry Point
-void VISIBLE
+void VISIBLE16
 handle_1a(struct bregs *regs)
 {
     //debug_enter(regs);
@@ -250,14 +250,14 @@ handle_1a(struct bregs *regs)
 }
 
 // User Timer Tick
-void VISIBLE
+void VISIBLE16
 handle_1c(struct bregs *regs)
 {
     //debug_enter(regs);
 }
 
 // INT 08h System Timer ISR Entry Point
-void VISIBLE
+void VISIBLE16
 handle_08(struct bregs *regs)
 {
 //    debug_isr(regs);
@@ -338,7 +338,7 @@ handle_1583(struct bregs *regs)
 }
 
 // int70h: IRQ8 - CMOS RTC
-void VISIBLE
+void VISIBLE16
 handle_70(struct bregs *regs)
 {
     debug_isr(regs);
index 5a2f069f647c34a3c12614b96a5e583264359b81..50882178056012a4b192c03a3ac357e866dedc0c 100644 (file)
@@ -702,7 +702,7 @@ handle_legacy_disk(struct bregs *regs, u8 drive)
     disk_13(regs, device);
 }
 
-void VISIBLE
+void VISIBLE16
 handle_40(struct bregs *regs)
 {
     debug_enter(regs);
@@ -711,7 +711,7 @@ handle_40(struct bregs *regs)
 }
 
 // INT 13h Fixed Disk Services Entry Point
-void VISIBLE
+void VISIBLE16
 handle_13(struct bregs *regs)
 {
     debug_enter(regs);
@@ -737,7 +737,7 @@ done:
 }
 
 // record completion in BIOS task complete flag
-void VISIBLE
+void VISIBLE16
 handle_76(struct bregs *regs)
 {
     debug_isr(regs);
index 5a7513b237dcb300a45fc82aa1cc55efce67b367..a03523849bb17b75beab7c57389ec1ea4585ea8d 100644 (file)
@@ -21,7 +21,7 @@
 // Since no provisions are made for multiple drive types, most
 // values in this table are ignored.  I set parameters for 1.44M
 // floppy here
-struct floppy_ext_dbt_s diskette_param_table2 VISIBLE = {
+struct floppy_ext_dbt_s diskette_param_table2 VISIBLE16 = {
     .dbt = {
         .specify1       = 0xAF,
         .specify2       = 0x02, // head load time 0000001, DMA used
@@ -714,7 +714,7 @@ floppy_13(struct bregs *regs, u8 drive)
 }
 
 // INT 0Eh Diskette Hardware ISR Entry Point
-void VISIBLE
+void VISIBLE16
 handle_0e(struct bregs *regs)
 {
     //debug_isr(regs);
index dc8ebc0acde023156170f9e0bc59ecc9d8e5c574..4c83f6939988aeb4213758ce6ae75efb94e04b08 100644 (file)
@@ -9,7 +9,7 @@
 // Since no provisions are made for multiple drive types, most
 // values in this table are ignored.  I set parameters for 1.44M
 // floppy here
-struct floppy_dbt_s diskette_param_table VISIBLE = {
+struct floppy_dbt_s diskette_param_table VISIBLE16 = {
     .specify1       = 0xAF,
     .specify2       = 0x02, // head load time 0000001, DMA used
     .shutoff_ticks  = 0x25,
index e1f01a5b6d17d7f133762544c36830626d0b37ea..c89899fe6a0c8ef2cbbebc86364a96cae748dc81 100644 (file)
--- a/src/kbd.c
+++ b/src/kbd.c
@@ -234,7 +234,7 @@ set_leds()
 }
 
 // INT 16h Keyboard Service Entry Point
-void VISIBLE
+void VISIBLE16
 handle_16(struct bregs *regs)
 {
 //    debug_enter(regs);
@@ -541,7 +541,7 @@ process_key(u8 scancode)
 }
 
 // INT09h : Keyboard Hardware Service Entry Point
-void VISIBLE
+void VISIBLE16
 handle_09(struct bregs *regs)
 {
     //debug_isr(regs);
index fd462193bac753e6d1fe1bf2c4cdf9d6f890a173..aeb1ef4fc3b16bb70b1df458bd47dac9bc4a7ff3 100644 (file)
@@ -412,7 +412,7 @@ int74_function()
 }
 
 // INT74h : PS/2 mouse hardware interrupt
-void VISIBLE
+void VISIBLE16
 handle_74(struct bregs *regs)
 {
     //debug_isr(regs);
index b157a98c9edc43da8f8ea8b885050710a0ca647f..acd35db71db9af5c6029845d0ccb50ef2b2de2f4 100644 (file)
@@ -641,7 +641,7 @@ check_restart_status()
     call16(&br);
 }
 
-void VISIBLE
+void VISIBLE32
 _start()
 {
     init_dma();
index 63d17666fd88adf4b162c92a769d029174ff4abf..e6cb0523d50eea9bb420dd15f04f2a5357b69d84 100644 (file)
@@ -113,7 +113,7 @@ handle_14XX(struct bregs *regs)
 }
 
 // INT 14h Serial Communications Service Entry Point
-void VISIBLE
+void VISIBLE16
 handle_14(struct bregs *regs)
 {
     debug_enter(regs);
@@ -215,7 +215,7 @@ handle_17XX(struct bregs *regs)
 }
 
 // INT17h : Printer Service Entry Point
-void VISIBLE
+void VISIBLE16
 handle_17(struct bregs *regs)
 {
     debug_enter(regs);
index 6f581ef84138ea841c351e343d14ef56324fac00..67fdb630b69cec79a2b072aaa49f9a21d491168e 100644 (file)
@@ -403,7 +403,7 @@ handle_15XX(struct bregs *regs)
 }
 
 // INT 15h System Services Entry Point
-void VISIBLE
+void VISIBLE16
 handle_15(struct bregs *regs)
 {
     //debug_enter(regs);
@@ -428,7 +428,7 @@ handle_15(struct bregs *regs)
 }
 
 // INT 12h Memory Size Service Entry Point
-void VISIBLE
+void VISIBLE16
 handle_12(struct bregs *regs)
 {
     debug_enter(regs);
@@ -437,7 +437,7 @@ handle_12(struct bregs *regs)
 }
 
 // INT 11h Equipment List Service Entry Point
-void VISIBLE
+void VISIBLE16
 handle_11(struct bregs *regs)
 {
     debug_enter(regs);
@@ -446,21 +446,21 @@ handle_11(struct bregs *regs)
 }
 
 // INT 05h Print Screen Service Entry Point
-void VISIBLE
+void VISIBLE16
 handle_05(struct bregs *regs)
 {
     debug_enter(regs);
 }
 
 // INT 10h Video Support Service Entry Point
-void VISIBLE
+void VISIBLE16
 handle_10(struct bregs *regs)
 {
     debug_enter(regs);
     // dont do anything, since the VGA BIOS handles int10h requests
 }
 
-void VISIBLE
+void VISIBLE16
 handle_nmi(struct bregs *regs)
 {
     debug_isr(regs);
@@ -468,7 +468,7 @@ handle_nmi(struct bregs *regs)
 }
 
 // INT 75 - IRQ13 - MATH COPROCESSOR EXCEPTION
-void VISIBLE
+void VISIBLE16
 handle_75(struct bregs *regs)
 {
     debug_isr(regs);
index 10c3dfe54241f6f9db1b279aba3d55a520f3b371..197bb95e05ad40f7ccd45d4a1e41c860e6427872 100644 (file)
@@ -15,7 +15,16 @@ typedef signed int s32;
 typedef u32 size_t;
 typedef unsigned long long u64;
 
-#define VISIBLE __attribute__((externally_visible))
+#define __VISIBLE __attribute__((externally_visible))
+#ifdef MODE16
+// Notes a function as externally visible in the 16bit code chunk.
+#define VISIBLE16 __VISIBLE
+// Notes a function as externally visible in the 32bit code chunk.
+#define VISIBLE32
+#else
+#define VISIBLE16
+#define VISIBLE32 __VISIBLE
+#endif
 
 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))