use stdint types only where needed

This commit is contained in:
Markus Fröschle
2017-04-15 07:34:51 +00:00
parent 4f45b21484
commit 900d83eca7
5 changed files with 141 additions and 110 deletions

View File

@@ -237,8 +237,8 @@ struct fb_bitfield
#define FB_SYNC_EXT 4 /* external sync */
#define FB_SYNC_COMP_HIGH_ACT 8 /* composite sync high active */
#define FB_SYNC_BROADCAST 16 /* broadcast video timings */
/* vtotal = 144d/288n/576i => PAL */
/* vtotal = 121d/242n/484i => NTSC */
/* vtotal = 144d/288n/576i => PAL */
/* vtotal = 121d/242n/484i => NTSC */
#define FB_SYNC_ON_GREEN 32 /* sync on green */
#define FB_VMODE_NONINTERLACED 0 /* non interlaced */
@@ -412,22 +412,32 @@ struct fb_ops
/* checks var and eventually tweaks if to something supported,
* DO NOT MODIFY PAR */
int32_t (*fb_check_var)(struct fb_var_screeninfo *var, struct fb_info *info);
/* set the video mode according to info->var */
int32_t (*fb_set_par)(struct fb_info *info);
/* set color register */
int32_t (*fb_setcolreg)(uint32_t regno, uint32_t red, uint32_t green,
uint32_t blue, uint32_t transp, struct fb_info *info);
/* pan display */
int32_t (*fb_pan_display)(struct fb_var_screeninfo *var, struct fb_info *info);
/* blank display */
int32_t (*fb_blank)(int32_t blank, struct fb_info *info);
/* wait for blit idle */
int32_t (*fb_sync)(struct fb_info *info);
/* perform fb specific ioctl */
int32_t (*fb_ioctl)(uint32_t cmd, uint32_t arg, struct fb_info *info);
/* Buildthe modedb for head 1 (head 2 will come later), check panel infos
* from either BIOS or EDID, and pick up the default mode */
/*
* Build the modedb for head 1 (head 2 will come later), check panel infos
* from either BIOS or EDID, and pick up the default mode
*/
void (*fb_check_modes)(struct fb_info *info, struct mode_option *resolution);
/* Accel functions */
#define DEGREES_0 0
#define DEGREES_90 1
@@ -453,8 +463,10 @@ struct fb_ops
void (*SubsequentScanlineImageWriteRect)(struct fb_info *info, int32_t x, int32_t y, int32_t w, int32_t h, int32_t skipleft);
void (*SetClippingRectangle)(struct fb_info *info, int32_t xa, int32_t ya, int32_t xb, int32_t yb);
void (*DisableClipping)(struct fb_info *info);
int32_t (*SetupForCPUToScreenAlphaTexture)(struct fb_info *info,
int32_t op, uint16_t red, uint16_t green, uint16_t blue, uint16_t alpha, uint32_t maskFormat, uint32_t dstFormat, uint8_t *alphaPtr, int32_t alphaPitch, int32_t width, int32_t height, int32_t flags);
int (*SetupForCPUToScreenAlphaTexture)(struct fb_info *info,
int32_t op, uint16_t red, uint16_t green, uint16_t blue, uint16_t alpha,
uint32_t maskFormat, uint32_t dstFormat, uint8_t *alphaPtr, int32_t alphaPitch,
int32_t width, int32_t height, int32_t flags);
int32_t (*SetupForCPUToScreenTexture)(struct fb_info *info, int32_t op, uint32_t srcFormat, uint32_t dstFormat, uint8_t *texPtr, int32_t texPitch, int32_t width, int32_t height, int32_t flags);
void (*SubsequentCPUToScreenTexture)(struct fb_info *info, int32_t dstx, int32_t dsty, int32_t srcx, int32_t srcy, int32_t width, int32_t height);
/* Cursor functions */
@@ -473,7 +485,7 @@ struct fb_info
struct fb_fix_screeninfo fix; /* Current fix */
struct fb_monspecs monspecs; /* Current Monitor specs */
struct fb_videomode *mode; /* current mode */
char *screen_base; /* Virtual address */
char *screen_base; /* virtual address */
uint32_t screen_size;
char *ram_base; /* base vram */
uint32_t ram_size; /* vram size */
@@ -520,13 +532,13 @@ extern int32_t fb_validate_mode(const struct fb_var_screeninfo *var, struct fb_i
/* modedb.c */
#define VESA_MODEDB_SIZE 34
extern int32_t fb_find_mode(struct fb_var_screeninfo *var,
extern int fb_find_mode(struct fb_var_screeninfo *var,
struct fb_info *info, struct mode_option *resolution ,
const struct fb_videomode *db, uint32_t dbsize,
const struct fb_videomode *default_mode, uint32_t default_bpp);
const struct fb_videomode *db, unsigned int dbsize,
const struct fb_videomode *default_mode, unsigned int default_bpp);
extern void fb_var_to_videomode(struct fb_videomode *mode, struct fb_var_screeninfo *var);
extern void fb_videomode_to_var(struct fb_var_screeninfo *var, struct fb_videomode *mode);
extern int32_t fb_mode_is_equal(struct fb_videomode *mode1, struct fb_videomode *mode2);
extern int fb_mode_is_equal(struct fb_videomode *mode1, struct fb_videomode *mode2);
struct fb_videomode
{

View File

@@ -356,6 +356,15 @@ void init_isr(void)
dbg("Error: unable to register isr for XLB PCI interrupts\r\n");
}
/*
* initialize arbiter timeout registers
*/
MCF_XLB_XARB_ADRTO = 0x1fffff;
MCF_XLB_XARB_DATTO = 0x1fffff;
MCF_XLB_XARB_BUSTO = 0xffffff;
MCF_XLB_XARB_IMR = MCF_XLB_XARB_IMR_SEAE | /* slave error acknowledge interrupt */
MCF_XLB_XARB_IMR_MME | /* multiple master at prio 0 interrupt */
MCF_XLB_XARB_IMR_TTAE | /* TT address only interrupt */
@@ -390,7 +399,7 @@ struct rom_header
/*
* fix ST RAM header (address 0x0 and 0x4). FreeMiNT uses these vectors on CTRL-ALT-DEL.
*
* Beware: Newer compilers refuse to dereference pointers to NULL and abort if the following
* Beware: Newer compilers refuse to dereference pointers to NULL and abort (trap #7) if the following
* attribute isn't set.
*/
static void fix_stram_header() __attribute__((optimize("no-delete-null-pointer-checks")));
@@ -469,7 +478,7 @@ void BaS(void)
/*
* memory setup
*/
// memset((void *) 0x200, 0, 0x400);
memset((void *) 0x200, 0, 0x400);
#if defined(MACHINE_FIREBEE)
/* set Falcon bus control register */
@@ -478,6 +487,12 @@ void BaS(void)
* (volatile uint8_t *) 0xffff8007 = 0x48;
#endif /* MACHINE_FIREBEE */
/*
* FireTOS wants to have the TOS system variables cleared
* Do the same for EmuTOS. "warm resets" don't seem to be reliable
*/
memset((void *) 0x400, 0, 0x400);
/* ST RAM */
* (uint32_t *) 0x42e = STRAM_END; /* phystop TOS system variable */
@@ -508,6 +523,7 @@ void BaS(void)
enable_pci_interrupts();
init_pci();
video_init();
/* initialize USB devices */
@@ -528,11 +544,6 @@ void BaS(void)
NOP(); /* force pipeline sync */
/*
* FireTOS wants to have the TOS system variables cleared
*/
memset((void *) 0x400, 0, 0x400);
/* ST RAM */
* (uint32_t *) 0x42e = STRAM_END; /* phystop TOS system variable */

View File

@@ -474,7 +474,7 @@ bool xlbarb_interrupt_handler(void *arg1, void *arg2)
*/
MCF_XLB_XARB_SR = status; /* rwc bits */
return false;
return true;
}
#if defined(MACHINE_FIREBEE)

View File

@@ -470,17 +470,24 @@ static int32_t fb_try_mode(struct fb_var_screeninfo *var, struct fb_info *info,
*
*/
int32_t fb_find_mode(struct fb_var_screeninfo *var,
int fb_find_mode(struct fb_var_screeninfo *var,
struct fb_info *info, struct mode_option *resolution ,
const struct fb_videomode *db, uint32_t dbsize,
const struct fb_videomode *db, unsigned int dbsize,
const struct fb_videomode *default_mode,
uint32_t default_bpp)
unsigned int default_bpp)
{
int32_t i,abs;
int32_t res_specified = 0, bpp_specified = 0, refresh_specified = 0;
uint32_t xres = 0, yres = 0, bpp = default_bpp, refresh = 0;
int32_t yres_specified = 0;
unsigned long best, diff;
int i;
int abs;
int res_specified = 0;
int bpp_specified = 0;
int refresh_specified = 0;
unsigned int xres = 0;
unsigned int yres = 0;
unsigned int bpp = default_bpp;
unsigned int refresh = 0;
int yres_specified = 0;
unsigned long best;
unsigned long diff;
dbg("fb_find_mode\r\n");
@@ -513,18 +520,18 @@ int32_t fb_find_mode(struct fb_var_screeninfo *var,
/* Did the user specify a video mode? */
if (resolution->used) /* fVDI mode */
{
refresh = (uint32_t)resolution->freq;
refresh = resolution->freq;
if (refresh)
refresh_specified = 1;
bpp = (uint32_t)resolution->bpp;
bpp = resolution->bpp;
if (resolution->flags & MODE_EMUL_MONO_FLAG)
bpp = 8;
if (bpp)
bpp_specified = 1;
yres = (uint32_t)resolution->height;
yres = resolution->height;
if (yres)
yres_specified = 1;
xres = (uint32_t)resolution->width;
xres = resolution->width;
if (xres)
res_specified = 1;
}

View File

@@ -342,6 +342,7 @@ struct mode_option resolution =
.freq = 60,
.flags = 0,
};
int16_t force_measure_pll = 0;
void install_vbl_timer(void *func, int32_t remove)