Changeset 4977f07e in rtems
- Timestamp:
- 10/09/14 17:56:18 (9 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 20cb691
- Parents:
- ab31e8e1
- git-author:
- Joel Sherrill <joel.sherrill@…> (10/09/14 17:56:18)
- git-committer:
- Joel Sherrill <joel.sherrill@…> (10/10/14 15:17:17)
- Location:
- c/src/lib/libbsp/i386
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/i386/pc386/console/conscfg.c
rab31e8e1 r4977f07e 6 6 7 7 /* 8 * COPYRIGHT (c) 1989-201 1.8 * COPYRIGHT (c) 1989-2014. 9 9 * On-Line Applications Research Corporation (OAR). 10 10 * … … 22 22 #include <bsp/irq.h> 23 23 #include <rtems/pci.h> 24 #include <bsp/rtd316.h> 24 25 25 26 #define VGA_CONSOLE_FUNCTIONS &vgacons_fns … … 40 41 #define CLOCK_RATE (115200 * 16) 41 42 42 uint8_t com_get_register(uint32_t addr, uint8_t i)43 static uint8_t com_get_register(uint32_t addr, uint8_t i) 43 44 { 44 45 register uint8_t val; … … 48 49 } 49 50 50 void com_set_register(uint32_t addr, uint8_t i, uint8_t val)51 static void com_set_register(uint32_t addr, uint8_t i, uint8_t val) 51 52 { 52 53 outport_byte( (addr + i),val ); -
c/src/lib/libbsp/i386/pc386/console/keyboard.c
rab31e8e1 r4977f07e 29 29 #endif 30 30 31 int set_bit(int nr, unsigned long * addr)31 static int set_bit(int nr, unsigned long * addr) 32 32 { 33 33 int mask; … … 44 44 } 45 45 46 int clear_bit(int nr, unsigned long * addr)46 static int clear_bit(int nr, unsigned long * addr) 47 47 { 48 48 int mask; … … 59 59 } 60 60 61 int test_bit(int nr, unsigned long * addr)61 static int test_bit(int nr, unsigned long * addr) 62 62 { 63 63 int mask; … … 168 168 * in utf-8 already. 169 169 */ 170 void to_utf8(ushort c) { 171 if (c < 0x80) 172 put_queue(c); /* 0******* */ 173 else if (c < 0x800) { 174 put_queue(0xc0 | (c >> 6)); /* 110***** 10****** */ 175 put_queue(0x80 | (c & 0x3f)); 176 } else { 177 put_queue(0xe0 | (c >> 12)); /* 1110**** 10****** 10****** */ 178 put_queue(0x80 | ((c >> 6) & 0x3f)); 179 put_queue(0x80 | (c & 0x3f)); 180 } 181 /* UTF-8 is defined for words of up to 31 bits, 182 but we need only 16 bits here */ 170 static void to_utf8(ushort c) 171 { 172 if (c < 0x80) 173 put_queue(c); /* 0******* */ 174 else if (c < 0x800) { 175 put_queue(0xc0 | (c >> 6)); /* 110***** 10****** */ 176 put_queue(0x80 | (c & 0x3f)); 177 } else { 178 put_queue(0xe0 | (c >> 12)); /* 1110**** 10****** 10****** */ 179 put_queue(0x80 | ((c >> 6) & 0x3f)); 180 put_queue(0x80 | (c & 0x3f)); 181 } 182 /* UTF-8 is defined for words of up to 31 bits, 183 but we need only 16 bits here */ 183 184 } 184 185 … … 334 335 /* 335 336 */ 336 void kbd_set_driver_handler( void ( *handler )( void *, unsigned short, unsigned long ) ) 337 void kbd_set_driver_handler( 338 void ( *handler )( void *, unsigned short, unsigned long ) 339 ) 337 340 { 338 341 driver_input_handler_kbd = handler; … … 341 344 static void put_queue(int ch) 342 345 { 343 if( driver_input_handler_kbd ) 344 { 345 driver_input_handler_kbd( ( void *)kbd, (unsigned short)ch, 0 ); 346 } 347 else 348 { 349 add_to_queue( ch ); 346 if ( driver_input_handler_kbd ) { 347 driver_input_handler_kbd( ( void *)kbd, (unsigned short)ch, 0 ); 348 } else { 349 add_to_queue( ch ); 350 350 } 351 351 } … … 378 378 if (vc_kbd_mode(kbd,VC_CRLF)) 379 379 put_queue(10); 380 381 380 } 382 381 … … 404 403 return; 405 404 chg_vc_kbd_led(kbd, VC_SCROLLOCK ); 406 407 405 } 408 406 409 407 static void num(void) 410 408 { 411 412 409 if (vc_kbd_mode(kbd,VC_APPLIC)) 413 410 applkey('P', 1); … … 772 769 773 770 unsigned char getledstate(void) { 774 771 return ledstate; 775 772 } 776 773 777 774 void setledstate(struct kbd_struct *kbd, unsigned int led) { 778 779 ledioctl = led;780 kbd->ledmode = LED_SHOW_IOCTL;781 775 if (!(led & ~7)) { 776 ledioctl = led; 777 kbd->ledmode = LED_SHOW_IOCTL; 778 } else 782 779 ; 783 784 780 kbd->ledmode = LED_SHOW_FLAGS; 781 set_leds(); 785 782 } 786 783 787 784 static struct ledptr { 788 789 790 785 unsigned int *addr; 786 unsigned int mask; 787 unsigned char valid:1; 791 788 } ledptrs[3]; 792 789 793 void register_leds(int console, unsigned int led, 794 unsigned int *addr, unsigned int mask) { 795 struct kbd_struct *kbd = kbd_table + console; 796 797 if (led < 3) { 798 ledptrs[led].addr = addr; 799 ledptrs[led].mask = mask; 800 ledptrs[led].valid = 1; 801 kbd->ledmode = LED_SHOW_MEM; 802 } else 803 kbd->ledmode = LED_SHOW_FLAGS; 804 } 805 806 static inline unsigned char getleds(void){ 790 void register_leds( 791 int console, 792 unsigned int led, 793 unsigned int *addr, 794 unsigned int mask 795 ) 796 { 797 struct kbd_struct *kbd = kbd_table + console; 798 799 if (led < 3) { 800 ledptrs[led].addr = addr; 801 ledptrs[led].mask = mask; 802 ledptrs[led].valid = 1; 803 kbd->ledmode = LED_SHOW_MEM; 804 } else 805 kbd->ledmode = LED_SHOW_FLAGS; 806 } 807 808 static inline unsigned char getleds(void) 809 { 807 810 808 811 struct kbd_struct *kbd = kbd_table + fg_console; -
c/src/lib/libbsp/i386/pc386/console/outch.c
rab31e8e1 r4977f07e 240 240 } 241 241 242 void242 static void 243 243 clear_screen(void) 244 244 { … … 309 309 310 310 /* for old DOS compatibility n-curses type of applications */ 311 void gotoxy( int x, int y ); 312 int whereX( void ); 313 int whereY( void ); 314 311 315 void gotoxy( int x, int y ) 312 316 { -
c/src/lib/libbsp/i386/pc386/console/rtd316.c
rab31e8e1 r4977f07e 8 8 9 9 /* 10 * COPYRIGHT (c) 1989-201 2.10 * COPYRIGHT (c) 1989-2014. 11 11 * On-Line Applications Research Corporation (OAR). 12 12 * … … 27 27 #include <bsp/rtd316.h> 28 28 #include <rtems/score/i386.h> 29 #include <rtems/console_private.h> 29 30 30 31 #define RTD_CLOCK_RATE (460800 * 32) -
c/src/lib/libbsp/i386/pc386/console/rtd316.h
rab31e8e1 r4977f07e 8 8 9 9 /* 10 * COPYRIGHT (c) 1989-201 2.10 * COPYRIGHT (c) 1989-2014. 11 11 * On-Line Applications Research Corporation (OAR). 12 12 * … … 48 48 ); 49 49 50 /** 51 * @brief RTD316 Obtain Register Helper 52 * 53 * This method is used to read registers on the RTD316. 54 * 55 * @param[in] addr is the base address 56 * @param[in] reg is the register number 57 * 58 * @return This method returns the value of the register. 59 */ 60 uint8_t rtd316_com_get_register(uint32_t addr, uint8_t reg); 61 62 /** 63 * @brief RTD316 Set Register Helper 64 * 65 * This method is used to set registers on the RTD316. 66 * 67 * @param[in] addr is the base address 68 * @param[in] reg is the register number 69 */ 70 void rtd316_com_set_register(uint32_t addr,uint8_t reg, uint8_t val); 71 50 72 #ifdef __cplusplus 51 73 } -
c/src/lib/libbsp/i386/pc386/ide/ide.c
rab31e8e1 r4977f07e 231 231 bool data_ready; 232 232 233 (void) cur_multiple_sectors; /* avoid set but not used warning */ 234 233 235 memset(model_number, 0, sizeof(model_number)); 234 236 -
c/src/lib/libbsp/i386/pc386/include/bsp.h
rab31e8e1 r4977f07e 180 180 181 181 void Wait_X_ms(unsigned int timeToWait); /* from 'timer.c' */ 182 void Calibrate_loop_1ms(void); /* from 'timer.c' */ 183 184 void rtems_irq_mngt_init(void); /* from 'irq_init.c' */ 185 186 void bsp_size_memory(void); /* from 'bspstart.c' */ 182 187 183 188 void Clock_driver_install_handler(void); /* from 'ckinit.c' */ 184 189 void Clock_driver_support_initialize_hardware(void); /* from 'ckinit.c' */ 190 185 191 size_t read_aux(char * buffer, size_t count); /* from 'ps2_mouse.c' */ 186 192 -
c/src/lib/libbsp/i386/pc386/startup/bspstart.c
rab31e8e1 r4977f07e 37 37 * External routines 38 38 */ 39 extern void Calibrate_loop_1ms(void);40 extern void rtems_irq_mngt_init(void);41 extern void bsp_size_memory(void);42 39 void Clock_driver_install_handler(void); 43 40 -
c/src/lib/libbsp/i386/pc386/timer/timer.c
rab31e8e1 r4977f07e 66 66 67 67 /* 68 * Timer cleanup routine at RTEMS exit. NOTE: This routine is 69 * not really necessary, since there will be a reset at exit. 70 */ 71 72 void tsc_timer_exit(void) 73 { 74 } 75 76 void tsc_timer_initialize(void) 68 * Timer cleanup routine at RTEMS exit. 69 * 70 * NOTE: This routine is not really necessary, since there will be 71 * a reset at exit. 72 */ 73 static void tsc_timer_exit(void) 74 { 75 } 76 77 static void tsc_timer_initialize(void) 77 78 { 78 79 static bool First = true; … … 87 88 88 89 /* 89 * 90 */ 91 uint32_t tsc_read_timer(void)90 * Read TSC timer value. 91 */ 92 static uint32_t tsc_read_timer(void) 92 93 { 93 94 register uint32_t total; … … 152 153 153 154 /* 154 * Timer cleanup routine at RTEMS exit. NOTE: This routine is 155 * not really necessary, since there will be a reset at exit. 156 */ void 157 i386_timer_exit(void) 155 * Timer cleanup routine at RTEMS exit. 156 * 157 * NOTE: This routine is not really necessary, since there will be 158 * a reset at exit. 159 */ 160 static void i386_timer_exit(void) 158 161 { 159 162 i386_delete_idt_entry (&timer_raw_irq_data); … … 161 164 162 165 extern void rtems_irq_prologue_0(void); 163 void i386_timer_initialize(void)166 static void i386_timer_initialize(void) 164 167 { 165 168 static bool First = true; … … 193 196 * Read hardware timer value. 194 197 */ 195 uint32_t i386_read_timer(void)198 static uint32_t i386_read_timer(void) 196 199 { 197 200 register uint32_t total, clicks; … … 269 272 * Returns: Nothing. Loaded value must be a number of clock bits... 270 273 */ 271 void loadTimerValue( unsigned short loadedValue )274 static void loadTimerValue( unsigned short loadedValue ) 272 275 { 273 276 lastLoadedValue = loadedValue; … … 283 286 * Returns: number of clock bits elapsed since last load. 284 287 */ 285 unsigned int readTimer0(void)288 static unsigned int readTimer0(void) 286 289 { 287 290 unsigned short lsb, msb; … … 303 306 } 304 307 305 void Timer0Reset(void)308 static void Timer0Reset(void) 306 309 { 307 310 loadTimerValue(0xffff); … … 309 312 } 310 313 311 void fastLoop (unsigned int loopCount)314 static void fastLoop (unsigned int loopCount) 312 315 { 313 316 unsigned int i; … … 315 318 } 316 319 317 void slowLoop (unsigned int loopCount)320 static void slowLoop (unsigned int loopCount) 318 321 { 319 322 unsigned int j; -
c/src/lib/libbsp/i386/shared/comm/i386-stub.c
rab31e8e1 r4977f07e 608 608 /* If MAY_FAULT is non-zero, then we should set mem_err in response to 609 609 a fault; if zero treat a fault like any other fault in the stub. */ 610 char *610 static char * 611 611 mem2hex (char *mem, char *buf, int count, int may_fault) 612 612 { … … 655 655 /* this function takes the 386 exception vector and attempts to 656 656 translate this number into a unix compatible signal value */ 657 int657 static int 658 658 computeSignal (int exceptionVector) 659 659 { … … 716 716 /* RETURN NUMBER OF CHARS PROCESSED */ 717 717 /**********************************************/ 718 int718 static int 719 719 hexToInt (char **ptr, int *intValue) 720 720 { … … 743 743 /* 744 744 * This function does all command procesing for interfacing to gdb. 745 * 746 * NOTE: This method is called from assembly code so must be marked 747 * as used. 745 748 */ 746 void 749 static void handle_exception (int exceptionVector) __attribute__((used)); 750 static void 747 751 handle_exception (int exceptionVector) 748 752 {
Note: See TracChangeset
for help on using the changeset viewer.