arch: x86: nxstyle fixes

Nxstyle fixes to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
Alin Jerpelea
2021-03-30 10:55:38 +02:00
committed by Xiang Xiao
parent 32339d55c6
commit 8c1456da6b
19 changed files with 229 additions and 139 deletions
+9 -9
View File
@@ -96,9 +96,9 @@ typedef void (*up_vector_t)(void);
extern volatile uint32_t *g_current_regs; extern volatile uint32_t *g_current_regs;
/* This is the beginning of heap as provided from up_head.S. This is the first /* This is the beginning of heap as provided from up_head.S. This is the
* address in DRAM after the loaded program+bss+idle stack. The end of the * first address in DRAM after the loaded program+bss+idle stack. The end
* heap is CONFIG_RAM_END * of the heap is CONFIG_RAM_END
*/ */
extern uint32_t g_idle_topstack; extern uint32_t g_idle_topstack;
@@ -109,14 +109,14 @@ extern uint32_t g_idle_topstack;
extern uint32_t g_intstackbase; extern uint32_t g_intstackbase;
#endif #endif
/* These 'addresses' of these values are setup by the linker script. They are /* These 'addresses' of these values are setup by the linker script. They
* not actual uint32_t storage locations! They are only used meaningfully in the * are not actual uint32_t storage locations! They are only used meaningfully
* following way: * in the following way:
* *
* - The linker script defines, for example, the symbol_sdata. * - The linker script defines, for example, the symbol_sdata.
* - The declareion extern uint32_t _sdata; makes C happy. C will believe * - The declareion extern uint32_t _sdata; makes C happy. C will believe
* that the value _sdata is the address of a uint32_t variable _data (it is * that the value _sdata is the address of a uint32_t variable _data
* not!). * (it is not!).
* - We can recoved the linker value then by simply taking the address of * - We can recoved the linker value then by simply taking the address of
* of _data. like: uint32_t *pdata = &_sdata; * of _data. like: uint32_t *pdata = &_sdata;
*/ */
@@ -135,7 +135,7 @@ extern uint32_t _ebss; /* End+1 of .bss */
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions Prototypes
****************************************************************************/ ****************************************************************************/
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
+4
View File
@@ -85,6 +85,7 @@ void up_udelay(useconds_t microseconds)
for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++) for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++)
{ {
} }
microseconds -= 1000; microseconds -= 1000;
} }
@@ -93,6 +94,7 @@ void up_udelay(useconds_t microseconds)
for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++) for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++)
{ {
} }
microseconds -= 100; microseconds -= 100;
} }
@@ -101,6 +103,7 @@ void up_udelay(useconds_t microseconds)
for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++) for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++)
{ {
} }
microseconds -= 10; microseconds -= 10;
} }
@@ -109,6 +112,7 @@ void up_udelay(useconds_t microseconds)
for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++) for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++)
{ {
} }
microseconds--; microseconds--;
} }
} }
+8 -6
View File
@@ -96,16 +96,18 @@ static void up_remappic(void)
idt_outb(PIC1_IMR_ALL, PIC1_IMR); idt_outb(PIC1_IMR_ALL, PIC1_IMR);
idt_outb(PIC2_IMR_ALL, PIC2_IMR); idt_outb(PIC2_IMR_ALL, PIC2_IMR);
/* If the PIC has been reset, it must be initialized with 2 to 4 Initialization /* If the PIC has been reset, it must be initialized with 2 to 4
* Command Words (ICW) before it will accept and process Interrupt Requests. The * Initialization Command Words (ICW) before it will accept and process
* following outlines the four possible Initialization Command Words. * Interrupt Requests. The following outlines the four possible
* Initialization Command Words.
*/ */
/* Remap the irq table for primary: /* Remap the irq table for primary:
* *
* ICW1 - We will be sending ICW4 * ICW1 - We will be sending ICW4
* ICW2 - Address * ICW2 - Address
* ICW3 */ * ICW3
*/
idt_outb(PIC_ICW1_ICW4 | PIC_ICW1_ICW1, PIC1_ICW1); idt_outb(PIC_ICW1_ICW4 | PIC_ICW1_ICW1, PIC1_ICW1);
idt_outb(0x20, PIC1_ICW2); idt_outb(0x20, PIC1_ICW2);
@@ -144,8 +146,8 @@ static void up_idtentry(unsigned int index, uint32_t base, uint16_t sel,
entry->sel = sel; entry->sel = sel;
entry->zero = 0; entry->zero = 0;
/* We must uncomment the OR below when we get to using user-mode. It sets the /* We must uncomment the OR below when we get to using user-mode. It sets
* interrupt gate's privilege level to 3. * the interrupt gate's privilege level to 3.
*/ */
entry->flags = flags /* | 0x60 */; entry->flags = flags /* | 0x60 */;
+3 -2
View File
@@ -46,6 +46,7 @@
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_savestate * Name: up_savestate
* *
@@ -84,8 +85,8 @@ void up_savestate(uint32_t *regs)
{ {
/* No priority change, SP and SS are not present in the stack frame. /* No priority change, SP and SS are not present in the stack frame.
* *
* The value saved in the REG_ESP will be the stackpointer value prior to * The value saved in the REG_ESP will be the stackpointer value prior
* the execution of the PUSHA. It will point at REG_IRQNO. * to the execution of the PUSHA. It will point at REG_IRQNO.
*/ */
regs[REG_SP] = g_current_regs[REG_ESP] + 4*BOTTOM_NOPRIO; regs[REG_SP] = g_current_regs[REG_ESP] + 4*BOTTOM_NOPRIO;
+5 -5
View File
@@ -27,10 +27,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/* Get customizations for each supported QEMU emulation */ /* Get customizations for each supported QEMU emulation */
#ifdef CONFIG_ARCH_CHIP_QEMU #ifdef CONFIG_ARCH_CHIP_QEMU
@@ -44,6 +40,10 @@
#include "qemu_memorymap.h" #include "qemu_memorymap.h"
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/************************************************************************************ /************************************************************************************
* Public Types * Public Types
************************************************************************************/ ************************************************************************************/
@@ -53,7 +53,7 @@
************************************************************************************/ ************************************************************************************/
/************************************************************************************ /************************************************************************************
* Public Functions * Public Functions Prototypes
************************************************************************************/ ************************************************************************************/
#endif /* __ARCH_X86_SRC_QEMU_QEMU_CHIP_H */ #endif /* __ARCH_X86_SRC_QEMU_QEMU_CHIP_H */
+64 -59
View File
@@ -1,4 +1,4 @@
/************************************************************************************ /****************************************************************************
* arch/x86/src/qemu/qemu.h * arch/x86/src/qemu/qemu.h
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -16,14 +16,14 @@
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
************************************************************************************/ ****************************************************************************/
#ifndef __ARCH_X86_SRC_QEMU_QEMU_H #ifndef __ARCH_X86_SRC_QEMU_QEMU_H
#define __ARCH_X86_SRC_QEMU_QEMU_H #define __ARCH_X86_SRC_QEMU_QEMU_H
/************************************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/compiler.h> #include <nuttx/compiler.h>
@@ -35,25 +35,25 @@
#include "up_internal.h" #include "up_internal.h"
#include "chip.h" #include "chip.h"
/************************************************************************************ /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
************************************************************************************/ ****************************************************************************/
/* Configuration ********************************************************************/ /* Configuration ************************************************************/
/************************************************************************************ /****************************************************************************
* Public Types * Public Types
************************************************************************************/ ****************************************************************************/
/************************************************************************************ /****************************************************************************
* Inline Functions * Inline Functions
************************************************************************************/ ****************************************************************************/
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
/************************************************************************************ /****************************************************************************
* Public Data * Public Data
************************************************************************************/ ****************************************************************************/
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
@@ -64,43 +64,45 @@ extern "C"
#define EXTERN extern #define EXTERN extern
#endif #endif
/************************************************************************************ /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
************************************************************************************/ ****************************************************************************/
struct spi_dev_s; /* Forward reference */ struct spi_dev_s; /* Forward reference */
/************************************************************************************ /****************************************************************************
* Name: i486_clockconfig * Name: i486_clockconfig
* *
* Description: * Description:
* Called to initialize the i486. This does whatever setup is needed to put the * Called to initialize the i486. This does whatever setup is needed to
* MCU in a usable state. This includes the initialization of clocking using the * put the MCU in a usable state. This includes the initialization of
* settings in board.h. * clocking using the settings in board.h.
* *
************************************************************************************/ ****************************************************************************/
void i486_clockconfig(void); void i486_clockconfig(void);
/************************************************************************************ /****************************************************************************
* Name: i486_lowsetup * Name: i486_lowsetup
* *
* Description: * Description:
* Called at the very beginning of _start. Performs low level initialization * Called at the very beginning of _start. Performs low level
* including setup of the console UART. This UART done early so that the serial * initialization including setup of the console UART. This UART done
* console is available for debugging very early in the boot sequence. * early so that the serial console is available for debugging very early
* in the boot sequence.
* *
************************************************************************************/ ****************************************************************************/
void i486_lowsetup(void); void i486_lowsetup(void);
/************************************************************************************ /****************************************************************************
* Name: i486_gpioirqinitialize * Name: i486_gpioirqinitialize
* *
* Description: * Description:
* Initialize logic to support a second level of interrupt decoding for GPIO pins. * Initialize logic to support a second level of interrupt decoding for
* GPIO pins.
* *
************************************************************************************/ ****************************************************************************/
#ifdef CONFIG_QEMU_GPIOIRQ #ifdef CONFIG_QEMU_GPIOIRQ
void i486_gpioirqinitialize(void); void i486_gpioirqinitialize(void);
@@ -108,43 +110,43 @@ void i486_gpioirqinitialize(void);
# define i486_gpioirqinitialize() # define i486_gpioirqinitialize()
#endif #endif
/************************************************************************************ /****************************************************************************
* Name: i486_configgpio * Name: i486_configgpio
* *
* Description: * Description:
* Configure a GPIO pin based on bit-encoded description of the pin. * Configure a GPIO pin based on bit-encoded description of the pin.
* *
************************************************************************************/ ****************************************************************************/
int i486_configgpio(uint16_t cfgset); int i486_configgpio(uint16_t cfgset);
/************************************************************************************ /****************************************************************************
* Name: i486_gpiowrite * Name: i486_gpiowrite
* *
* Description: * Description:
* Write one or zero to the selected GPIO pin * Write one or zero to the selected GPIO pin
* *
************************************************************************************/ ****************************************************************************/
void i486_gpiowrite(uint16_t pinset, bool value); void i486_gpiowrite(uint16_t pinset, bool value);
/************************************************************************************ /****************************************************************************
* Name: i486_gpioread * Name: i486_gpioread
* *
* Description: * Description:
* Read one or zero from the selected GPIO pin * Read one or zero from the selected GPIO pin
* *
************************************************************************************/ ****************************************************************************/
bool i486_gpioread(uint16_t pinset); bool i486_gpioread(uint16_t pinset);
/************************************************************************************ /****************************************************************************
* Name: i486_gpioirqenable * Name: i486_gpioirqenable
* *
* Description: * Description:
* Enable the interrupt for specified GPIO IRQ * Enable the interrupt for specified GPIO IRQ
* *
************************************************************************************/ ****************************************************************************/
#ifdef CONFIG_QEMU_GPIOIRQ #ifdef CONFIG_QEMU_GPIOIRQ
void i486_gpioirqenable(int irq); void i486_gpioirqenable(int irq);
@@ -152,13 +154,13 @@ void i486_gpioirqenable(int irq);
# define i486_gpioirqenable(irq) # define i486_gpioirqenable(irq)
#endif #endif
/************************************************************************************ /****************************************************************************
* Name: i486_gpioirqdisable * Name: i486_gpioirqdisable
* *
* Description: * Description:
* Disable the interrupt for specified GPIO IRQ * Disable the interrupt for specified GPIO IRQ
* *
************************************************************************************/ ****************************************************************************/
#ifdef CONFIG_QEMU_GPIOIRQ #ifdef CONFIG_QEMU_GPIOIRQ
void i486_gpioirqdisable(int irq); void i486_gpioirqdisable(int irq);
@@ -166,13 +168,14 @@ void i486_gpioirqdisable(int irq);
# define i486_gpioirqdisable(irq) # define i486_gpioirqdisable(irq)
#endif #endif
/************************************************************************************ /****************************************************************************
* Function: i486_dumpgpio * Function: i486_dumpgpio
* *
* Description: * Description:
* Dump all GPIO registers associated with the base address of the provided pinset. * Dump all GPIO registers associated with the base address of the provided
* pinset.
* *
************************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DEBUG_GPIO_INFO #ifdef CONFIG_DEBUG_GPIO_INFO
int i486_dumpgpio(uint16_t pinset, const char *msg); int i486_dumpgpio(uint16_t pinset, const char *msg);
@@ -196,37 +199,39 @@ int i486_dumpgpio(uint16_t pinset, const char *msg);
FAR struct spi_dev_s *i486_spibus_initialize(int port); FAR struct spi_dev_s *i486_spibus_initialize(int port);
/************************************************************************************ /****************************************************************************
* Name: i486_spi/ssp0/ssp1select, i486_spi/ssp0/ssp1status, and * Name: i486_spi/ssp0/ssp1select, i486_spi/ssp0/ssp1status, and
* i486_spi/ssp0/ssp1cmddata * i486_spi/ssp0/ssp1cmddata
* *
* Description: * Description:
* These external functions must be provided by board-specific logic. They are * These external functions must be provided by board-specific logic. They
* implementations of the select, status, and cmddata methods of the SPI interface * are implementations of the select, status, and cmddata methods of the
* defined by struct spi_ops_s (see include/nuttx/spi/spi.h). All other methods * SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
* including i486_spibus_initialize()) are provided by common i486 logic. To use * All other methods including i486_spibus_initialize()) are provided by
* this common SPI logic on your board: * common i486 logic. To use this common SPI logic on your board:
* *
* 1. Provide logic in i486_boardinitialize() to configure SPI/SSP chip select * 1. Provide logic in i486_boardinitialize() to configure SPI/SSP chip
* pins. * select pins.
* 2. Provide i486_spi/ssp0/ssp1select() and i486_spi/ssp0/ssp1status() functions * 2. Provide i486_spi/ssp0/ssp1select() and i486_spi/ssp0/ssp1status()
* in your board-specific logic. These functions will perform chip selection * functions in your board-specific logic. These functions will perform
* and status operations using GPIOs in the way your board is configured. * chip selection and status operations using GPIOs in the way your
* board is configured.
* 2. If CONFIG_SPI_CMDDATA is defined in the NuttX configuration, provide * 2. If CONFIG_SPI_CMDDATA is defined in the NuttX configuration, provide
* i486_spi/ssp0/ssp1cmddata() functions in your board-specific logic. These * i486_spi/ssp0/ssp1cmddata() functions in your board-specific logic.
* functions will perform cmd/data selection operations using GPIOs in the way * These functions will perform cmd/data selection operations using
* your board is configured. * GPIOs in the way your board is configured.
* 3. Add a call to i486_spibus_initialize() in your low level application * 3. Add a call to i486_spibus_initialize() in your low level application
* initialization logic * initialization logic
* 4. The handle returned by i486_spibus_initialize() may then be used to bind the * 4. The handle returned by i486_spibus_initialize() may then be used to
* SPI driver to higher level logic (e.g., calling * bind the SPI driver to higher level logic (e.g., calling
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to * mmcsd_spislotinitialize(), for example, will bind the SPI driver to
* the SPI MMC/SD driver). * the SPI MMC/SD driver).
* *
************************************************************************************/ ****************************************************************************/
#ifdef CONFIG_I486_SPI #ifdef CONFIG_I486_SPI
void i486_spiselect(FAR struct spi_dev_s *dev, uint32_t devid, bool selected); void i486_spiselect(FAR struct spi_dev_s *dev,
uint32_t devid, bool selected);
uint8_t i486_spistatus(FAR struct spi_dev_s *dev, uint32_t devid); uint8_t i486_spistatus(FAR struct spi_dev_s *dev, uint32_t devid);
#ifdef CONFIG_SPI_CMDDATA #ifdef CONFIG_SPI_CMDDATA
int i486_spicmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); int i486_spicmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
+1
View File
@@ -306,6 +306,7 @@ static ssize_t keypad_read(struct file *filep, FAR char *buf, size_t buflen)
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: qemu_keypad * Name: qemu_keypad
* *
+2 -1
View File
@@ -40,8 +40,9 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions Prototypes
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: qemu_keypad * Name: qemu_keypad
* *
+1 -1
View File
@@ -46,7 +46,7 @@
************************************************************************************/ ************************************************************************************/
/************************************************************************************ /************************************************************************************
* Public Functions * Public Functions Prototypes
************************************************************************************/ ************************************************************************************/
#endif /* __ARCH_X86_SRC_QEMU_QEMU_MEMORYMAP_H */ #endif /* __ARCH_X86_SRC_QEMU_QEMU_MEMORYMAP_H */
+2 -1
View File
@@ -56,7 +56,8 @@ uart_datawidth_t uart_getreg(uart_addrwidth_t base, unsigned int offset)
return inb(base + offset); return inb(base + offset);
} }
void uart_putreg(uart_addrwidth_t base, unsigned int offset, uart_datawidth_t value) void uart_putreg(uart_addrwidth_t base,
unsigned int offset, uart_datawidth_t value)
{ {
outb(value, base + offset); outb(value, base + offset);
} }
+6 -5
View File
@@ -58,10 +58,10 @@
* Fpit = The desired interrupt frequency. * Fpit = The desired interrupt frequency.
* Fin = PIT input frequency (PIT_CLOCK provided in board.h) * Fin = PIT input frequency (PIT_CLOCK provided in board.h)
* *
* The desired timer interrupt frequency is provided by the definition CLK_TCK * The desired timer interrupt frequency is provided by the definition
* (see include/time.h). CLK_TCK defines the desired number of system clock * CLK_TCK (see include/time.h). CLK_TCK defines the desired number of
* ticks per second. That value is a user configurable setting that defaults * system clock ticks per second. That value is a user configurable setting
* to 100 (100 ticks per second = 10 MS interval). * that defaults to 100 (100 ticks per second = 10 MS interval).
*/ */
#define PIT_DIVISOR ((uint32_t)PIT_CLOCK/(uint32_t)CLK_TCK) #define PIT_DIVISOR ((uint32_t)PIT_CLOCK/(uint32_t)CLK_TCK)
@@ -113,7 +113,8 @@ void up_timer_initialize(void)
/* Send the command byte to configure counter 0 */ /* Send the command byte to configure counter 0 */
outb(PIT_OCW_MODE_SQUARE|PIT_OCW_RL_DATA|PIT_OCW_COUNTER_0, PIT_REG_COMMAND); outb(PIT_OCW_MODE_SQUARE | PIT_OCW_RL_DATA |
PIT_OCW_COUNTER_0, PIT_REG_COMMAND);
/* Set the PIT input frequency divisor */ /* Set the PIT input frequency divisor */
+95 -22
View File
@@ -96,7 +96,8 @@
****************************************************************************/ ****************************************************************************/
static int init_graph_vga(int width, int height, int chain4); static int init_graph_vga(int width, int height, int chain4);
static int vga_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, static int vga_putrun(fb_coord_t row,
fb_coord_t col, FAR const uint8_t *buffer,
size_t npixels); size_t npixels);
static int vga_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, static int vga_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
size_t npixels); size_t npixels);
@@ -111,34 +112,103 @@ static int vga_setcontrast(struct lcd_dev_s *dev, unsigned int contrast);
static int vga_open(struct file *filep); static int vga_open(struct file *filep);
static int vga_close(struct file *filep); static int vga_close(struct file *filep);
static ssize_t vga_read(struct file *filep, FAR char *buf, size_t buflen); static ssize_t vga_read(struct file *filep, FAR char *buf, size_t buflen);
static ssize_t vga_write(struct file *filep, FAR const char *buf, size_t buflen); static ssize_t vga_write(struct file *filep,
FAR const char *buf, size_t buflen);
static off_t vga_seek(FAR struct file *filp, off_t offset, int whence); static off_t vga_seek(FAR struct file *filp, off_t offset, int whence);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
static const uint8_t g_hor_regs[] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x13 }; static const uint8_t g_hor_regs[] =
{
0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x13
};
static const uint8_t g_width_256[] = { 0x5f, 0x3f, 0x40, 0x82, 0x4a,0x9a, 0x20 }; static const uint8_t g_width_256[] =
static const uint8_t g_width_320[] = { 0x5f, 0x4f, 0x50, 0x82, 0x54,0x80, 0x28 }; {
static const uint8_t g_width_360[] = { 0x6b, 0x59, 0x5a, 0x8e, 0x5e,0x8a, 0x2d }; 0x5f, 0x3f, 0x40, 0x82, 0x4a, 0x9a, 0x20
static const uint8_t g_width_376[] = { 0x6e, 0x5d, 0x5e, 0x91, 0x62,0x8f, 0x2f }; };
static const uint8_t g_width_400[] = { 0x70, 0x63, 0x64, 0x92, 0x65,0x82, 0x32 };
static const uint8_t g_ver_regs[] = { 0x6, 0x7, 0x9, 0x10, 0x11,0x12, 0x15, 0x16 }; static const uint8_t g_width_320[] =
{
0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0x28
};
static const uint8_t height_200[] = { 0xbf, 0x1f, 0x41, 0x9c, 0x8e,0x8f, 0x96, 0xb9 }; static const uint8_t g_width_360[] =
static const uint8_t height_224[] = { 0x0b, 0x3e, 0x41, 0xda, 0x9c,0xbf, 0xc7, 0x04 }; {
static const uint8_t height_240[] = { 0x0d, 0x3e, 0x41, 0xea, 0xac,0xdf, 0xe7, 0x06 }; 0x6b, 0x59, 0x5a, 0x8e, 0x5e, 0x8a, 0x2d
static const uint8_t height_256[] = { 0x23, 0xb2, 0x61, 0x0a, 0xac,0xff, 0x07, 0x1a }; };
static const uint8_t height_270[] = { 0x30, 0xf0, 0x61, 0x20, 0xa9,0x1b, 0x1f, 0x2f };
static const uint8_t height_300[] = { 0x70, 0xf0, 0x61, 0x5b, 0x8c,0x57, 0x58, 0x70 }; static const uint8_t g_width_376[] =
static const uint8_t height_360[] = { 0xbf, 0x1f, 0x40, 0x88, 0x85,0x67, 0x6d, 0xba }; {
static const uint8_t height_400[] = { 0xbf, 0x1f, 0x40, 0x9c, 0x8e,0x8f, 0x96, 0xb9 }; 0x6e, 0x5d, 0x5e, 0x91, 0x62, 0x8f, 0x2f
static const uint8_t height_480[] = { 0x0d, 0x3e, 0x40, 0xea, 0xac,0xdf, 0xe7, 0x06 }; };
static const uint8_t height_564[] = { 0x62, 0xf0, 0x60, 0x37, 0x89,0x33, 0x3c, 0x5c };
static const uint8_t height_600[] = { 0x70, 0xf0, 0x60, 0x5b, 0x8c,0x57, 0x58, 0x70 }; static const uint8_t g_width_400[] =
{
0x70, 0x63, 0x64, 0x92, 0x65, 0x82, 0x32
};
static const uint8_t g_ver_regs[] =
{
0x6, 0x7, 0x9, 0x10, 0x11, 0x12, 0x15, 0x16
};
static const uint8_t height_200[] =
{
0xbf, 0x1f, 0x41, 0x9c, 0x8e, 0x8f, 0x96, 0xb9
};
static const uint8_t height_224[] =
{
0x0b, 0x3e, 0x41, 0xda, 0x9c, 0xbf, 0xc7, 0x04
};
static const uint8_t height_240[] =
{
0x0d, 0x3e, 0x41, 0xea, 0xac, 0xdf, 0xe7, 0x06
};
static const uint8_t height_256[] =
{
0x23, 0xb2, 0x61, 0x0a, 0xac, 0xff, 0x07, 0x1a
};
static const uint8_t height_270[] =
{
0x30, 0xf0, 0x61, 0x20, 0xa9, 0x1b, 0x1f, 0x2f
};
static const uint8_t height_300[] =
{
0x70, 0xf0, 0x61, 0x5b, 0x8c, 0x57, 0x58, 0x70
};
static const uint8_t height_360[] =
{
0xbf, 0x1f, 0x40, 0x88, 0x85, 0x67, 0x6d, 0xba
};
static const uint8_t height_400[] =
{
0xbf, 0x1f, 0x40, 0x9c, 0x8e, 0x8f, 0x96, 0xb9
};
static const uint8_t height_480[] =
{
0x0d, 0x3e, 0x40, 0xea, 0xac, 0xdf, 0xe7, 0x06
};
static const uint8_t height_564[] =
{
0x62, 0xf0, 0x60, 0x37, 0x89, 0x33, 0x3c, 0x5c
};
static const uint8_t height_600[] =
{
0x70, 0xf0, 0x60, 0x5b, 0x8c, 0x57, 0x58, 0x70
};
static const uint8_t g_bg_color = 0x0f; static const uint8_t g_bg_color = 0x0f;
static const uint8_t g_fg_color = 0x01; static const uint8_t g_fg_color = 0x01;
@@ -342,7 +412,8 @@ static int init_graph_vga(int width, int height,int chain4)
return 0; return 0;
} }
static int vga_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, static int vga_putrun(fb_coord_t row,
fb_coord_t col, FAR const uint8_t *buffer,
size_t npixels) size_t npixels)
{ {
memcpy(&g_pscreen[row*VGA_XRES + col], buffer, npixels); memcpy(&g_pscreen[row*VGA_XRES + col], buffer, npixels);
@@ -415,10 +486,12 @@ static ssize_t vga_read(struct file *filep, FAR char *buf, size_t buflen)
} }
/* memcpy(&buf,&g_pscreen[y*VGA_XRES + x],buflen); */ /* memcpy(&buf,&g_pscreen[y*VGA_XRES + x],buflen); */
return buflen; return buflen;
} }
static ssize_t vga_write(struct file *filep, FAR const char *buf, size_t buflen) static ssize_t vga_write(struct file *filep,
FAR const char *buf, size_t buflen)
{ {
int i; int i;
int j; int j;
+2 -1
View File
@@ -40,8 +40,9 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions Prototypes
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: qemu_vga_initialize * Name: qemu_vga_initialize
* *