use stdint types only where needed

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

View File

@@ -184,23 +184,23 @@ extern struct mode_option resolution; /* fVDI */
struct fb_fix_screeninfo struct fb_fix_screeninfo
{ {
char id[16]; /* identification string eg "TT Builtin" */ char id[16]; /* identification string eg "TT Builtin" */
uint32_t smem_start; /* Start of frame buffer mem */ uint32_t smem_start; /* Start of frame buffer mem */
/* (physical address) */ /* (physical address) */
uint32_t smem_len; /* Length of frame buffer mem */ uint32_t smem_len; /* Length of frame buffer mem */
uint32_t type; /* see FB_TYPE_* */ uint32_t type; /* see FB_TYPE_* */
uint32_t type_aux; /* Interleave for interleaved Planes */ uint32_t type_aux; /* Interleave for interleaved Planes */
uint32_t visual; /* see FB_VISUAL_* */ uint32_t visual; /* see FB_VISUAL_* */
uint16_t xpanstep; /* zero if no hardware panning */ uint16_t xpanstep; /* zero if no hardware panning */
uint16_t ypanstep; /* zero if no hardware panning */ uint16_t ypanstep; /* zero if no hardware panning */
uint16_t ywrapstep; /* zero if no hardware ywrap */ uint16_t ywrapstep; /* zero if no hardware ywrap */
uint32_t line_length; /* length of a line in bytes */ uint32_t line_length; /* length of a line in bytes */
uint32_t mmio_start; /* Start of Memory Mapped I/O */ uint32_t mmio_start; /* Start of Memory Mapped I/O */
/* (physical address) */ /* (physical address) */
uint32_t mmio_len; /* Length of Memory Mapped I/O */ uint32_t mmio_len; /* Length of Memory Mapped I/O */
uint32_t accel; /* Indicate to driver which */ uint32_t accel; /* Indicate to driver which */
/* specific chip/card we have */ /* specific chip/card we have */
uint16_t reserved[3]; /* Reserved for future compatibility */ uint16_t reserved[3]; /* Reserved for future compatibility */
}; };
/* Interpretation of offset for color fields: All offsets are from the right, /* Interpretation of offset for color fields: All offsets are from the right,
@@ -211,10 +211,10 @@ struct fb_fix_screeninfo
*/ */
struct fb_bitfield struct fb_bitfield
{ {
uint32_t offset; /* beginning of bitfield */ uint32_t offset; /* beginning of bitfield */
uint32_t length; /* length of bitfield */ uint32_t length; /* length of bitfield */
uint32_t msb_right; /* != 0 : Most significant bit is */ uint32_t msb_right; /* != 0 : Most significant bit is */
/* right */ /* right */
}; };
#define FB_NONSTD_HAM 1 /* Hold-And-Modify (HAM) */ #define FB_NONSTD_HAM 1 /* Hold-And-Modify (HAM) */
@@ -237,8 +237,8 @@ struct fb_bitfield
#define FB_SYNC_EXT 4 /* external sync */ #define FB_SYNC_EXT 4 /* external sync */
#define FB_SYNC_COMP_HIGH_ACT 8 /* composite sync high active */ #define FB_SYNC_COMP_HIGH_ACT 8 /* composite sync high active */
#define FB_SYNC_BROADCAST 16 /* broadcast video timings */ #define FB_SYNC_BROADCAST 16 /* broadcast video timings */
/* vtotal = 144d/288n/576i => PAL */ /* vtotal = 144d/288n/576i => PAL */
/* vtotal = 121d/242n/484i => NTSC */ /* vtotal = 121d/242n/484i => NTSC */
#define FB_SYNC_ON_GREEN 32 /* sync on green */ #define FB_SYNC_ON_GREEN 32 /* sync on green */
#define FB_VMODE_NONINTERLACED 0 /* non interlaced */ #define FB_VMODE_NONINTERLACED 0 /* non interlaced */
@@ -255,43 +255,43 @@ struct fb_bitfield
struct fb_var_screeninfo struct fb_var_screeninfo
{ {
uint32_t xres; /* visible resolution */ uint32_t xres; /* visible resolution */
uint32_t yres; uint32_t yres;
uint32_t xres_virtual; /* virtual resolution */ uint32_t xres_virtual; /* virtual resolution */
uint32_t yres_virtual; uint32_t yres_virtual;
uint32_t xoffset; /* offset from virtual to visible */ uint32_t xoffset; /* offset from virtual to visible */
uint32_t yoffset; /* resolution */ uint32_t yoffset; /* resolution */
uint32_t bits_per_pixel; /* guess what */ uint32_t bits_per_pixel; /* guess what */
uint32_t grayscale; /* != 0 Graylevels instead of colors */ uint32_t grayscale; /* != 0 Graylevels instead of colors */
struct fb_bitfield red; /* bitfield in fb mem if true color, */ struct fb_bitfield red; /* bitfield in fb mem if true color, */
struct fb_bitfield green; /* else only length is significant */ struct fb_bitfield green; /* else only length is significant */
struct fb_bitfield blue; struct fb_bitfield blue;
struct fb_bitfield transp; /* transparency */ struct fb_bitfield transp; /* transparency */
uint32_t nonstd; /* != 0 Non standard pixel format */ uint32_t nonstd; /* != 0 Non standard pixel format */
uint32_t activate; /* see FB_ACTIVATE_* */ uint32_t activate; /* see FB_ACTIVATE_* */
uint32_t height; /* height of picture in mm */ uint32_t height; /* height of picture in mm */
uint32_t width; /* width of picture in mm */ uint32_t width; /* width of picture in mm */
uint32_t accel_flags; /* (OBSOLETE) see fb_info.flags */ uint32_t accel_flags; /* (OBSOLETE) see fb_info.flags */
/* Timing: All values in pixclocks, except pixclock (of course) */ /* Timing: All values in pixclocks, except pixclock (of course) */
uint32_t pixclock; /* pixel clock in ps (pico seconds) */ uint32_t pixclock; /* pixel clock in ps (pico seconds) */
uint32_t left_margin; /* time from sync to picture */ uint32_t left_margin; /* time from sync to picture */
uint32_t right_margin; /* time from picture to sync */ uint32_t right_margin; /* time from picture to sync */
uint32_t upper_margin; /* time from sync to picture */ uint32_t upper_margin; /* time from sync to picture */
uint32_t lower_margin; uint32_t lower_margin;
uint32_t hsync_len; /* length of horizontal sync */ uint32_t hsync_len; /* length of horizontal sync */
uint32_t vsync_len; /* length of vertical sync */ uint32_t vsync_len; /* length of vertical sync */
uint32_t sync; /* see FB_SYNC_* */ uint32_t sync; /* see FB_SYNC_* */
uint32_t vmode; /* see FB_VMODE_* */ uint32_t vmode; /* see FB_VMODE_* */
uint32_t rotate; /* angle we rotate counter clockwise */ uint32_t rotate; /* angle we rotate counter clockwise */
uint32_t refresh; uint32_t refresh;
uint32_t reserved[4]; /* Reserved for future compatibility */ uint32_t reserved[4]; /* Reserved for future compatibility */
}; };
/* VESA Blanking Levels */ /* VESA Blanking Levels */
@@ -326,11 +326,11 @@ enum
struct fb_vblank struct fb_vblank
{ {
uint32_t flags; /* FB_VBLANK flags */ uint32_t flags; /* FB_VBLANK flags */
uint32_t count; /* counter of retraces since boot */ uint32_t count; /* counter of retraces since boot */
uint32_t vcount; /* current scanline position */ uint32_t vcount; /* current scanline position */
uint32_t hcount; /* current scandot position */ uint32_t hcount; /* current scandot position */
uint32_t reserved[4]; /* reserved for future compatibility */ uint32_t reserved[4]; /* reserved for future compatibility */
}; };
struct vm_area_struct; struct vm_area_struct;
@@ -366,7 +366,7 @@ struct file;
struct fb_chroma struct fb_chroma
{ {
uint32_t redx; /* in fraction of 1024 */ uint32_t redx; /* in fraction of 1024 */
uint32_t greenx; uint32_t greenx;
uint32_t bluex; uint32_t bluex;
uint32_t whitex; uint32_t whitex;
@@ -379,32 +379,32 @@ struct fb_chroma
struct fb_monspecs struct fb_monspecs
{ {
struct fb_chroma chroma; struct fb_chroma chroma;
struct fb_videomode *modedb; /* mode database */ struct fb_videomode *modedb; /* mode database */
uint8_t manufacturer[4]; /* Manufacturer */ uint8_t manufacturer[4]; /* Manufacturer */
uint8_t monitor[14]; /* Monitor String */ uint8_t monitor[14]; /* Monitor String */
uint8_t serial_no[14]; /* Serial Number */ uint8_t serial_no[14]; /* Serial Number */
uint8_t ascii[14]; /* ? */ uint8_t ascii[14]; /* ? */
uint32_t modedb_len; /* mode database length */ uint32_t modedb_len; /* mode database length */
uint32_t model; /* Monitor Model */ uint32_t model; /* Monitor Model */
uint32_t serial; /* Serial Number - Integer */ uint32_t serial; /* Serial Number - Integer */
uint32_t year; /* Year manufactured */ uint32_t year; /* Year manufactured */
uint32_t week; /* Week Manufactured */ uint32_t week; /* Week Manufactured */
uint32_t hfmin; /* hfreq lower limit (Hz) */ uint32_t hfmin; /* hfreq lower limit (Hz) */
uint32_t hfmax; /* hfreq upper limit (Hz) */ uint32_t hfmax; /* hfreq upper limit (Hz) */
uint32_t dclkmin; /* pixelclock lower limit (Hz) */ uint32_t dclkmin; /* pixelclock lower limit (Hz) */
uint32_t dclkmax; /* pixelclock upper limit (Hz) */ uint32_t dclkmax; /* pixelclock upper limit (Hz) */
uint16_t input; /* display type - see FB_DISP_* */ uint16_t input; /* display type - see FB_DISP_* */
uint16_t dpms; /* DPMS support - see FB_DPMS_ */ uint16_t dpms; /* DPMS support - see FB_DPMS_ */
uint16_t signal; /* Signal Type - see FB_SIGNAL_* */ uint16_t signal; /* Signal Type - see FB_SIGNAL_* */
uint16_t vfmin; /* vfreq lower limit (Hz) */ uint16_t vfmin; /* vfreq lower limit (Hz) */
uint16_t vfmax; /* vfreq upper limit (Hz) */ uint16_t vfmax; /* vfreq upper limit (Hz) */
uint16_t gamma; /* Gamma - in fractions of 100 */ uint16_t gamma; /* Gamma - in fractions of 100 */
uint16_t gtf : 1; /* supports GTF */ uint16_t gtf : 1; /* supports GTF */
uint16_t misc; /* Misc flags - see FB_MISC_* */ uint16_t misc; /* Misc flags - see FB_MISC_* */
uint8_t version; /* EDID version... */ uint8_t version; /* EDID version... */
uint8_t revision; /* ...and revision */ uint8_t revision; /* ...and revision */
uint8_t max_x; /* Maximum horizontal size (cm) */ uint8_t max_x; /* Maximum horizontal size (cm) */
uint8_t max_y; /* Maximum vertical size (cm) */ uint8_t max_y; /* Maximum vertical size (cm) */
}; };
struct fb_ops struct fb_ops
@@ -412,22 +412,32 @@ struct fb_ops
/* checks var and eventually tweaks if to something supported, /* checks var and eventually tweaks if to something supported,
* DO NOT MODIFY PAR */ * DO NOT MODIFY PAR */
int32_t (*fb_check_var)(struct fb_var_screeninfo *var, struct fb_info *info); int32_t (*fb_check_var)(struct fb_var_screeninfo *var, struct fb_info *info);
/* set the video mode according to info->var */ /* set the video mode according to info->var */
int32_t (*fb_set_par)(struct fb_info *info); int32_t (*fb_set_par)(struct fb_info *info);
/* set color register */ /* set color register */
int32_t (*fb_setcolreg)(uint32_t regno, uint32_t red, uint32_t green, int32_t (*fb_setcolreg)(uint32_t regno, uint32_t red, uint32_t green,
uint32_t blue, uint32_t transp, struct fb_info *info); uint32_t blue, uint32_t transp, struct fb_info *info);
/* pan display */ /* pan display */
int32_t (*fb_pan_display)(struct fb_var_screeninfo *var, struct fb_info *info); int32_t (*fb_pan_display)(struct fb_var_screeninfo *var, struct fb_info *info);
/* blank display */ /* blank display */
int32_t (*fb_blank)(int32_t blank, struct fb_info *info); int32_t (*fb_blank)(int32_t blank, struct fb_info *info);
/* wait for blit idle */ /* wait for blit idle */
int32_t (*fb_sync)(struct fb_info *info); int32_t (*fb_sync)(struct fb_info *info);
/* perform fb specific ioctl */ /* perform fb specific ioctl */
int32_t (*fb_ioctl)(uint32_t cmd, uint32_t arg, struct fb_info *info); 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); void (*fb_check_modes)(struct fb_info *info, struct mode_option *resolution);
/* Accel functions */ /* Accel functions */
#define DEGREES_0 0 #define DEGREES_0 0
#define DEGREES_90 1 #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 (*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 (*SetClippingRectangle)(struct fb_info *info, int32_t xa, int32_t ya, int32_t xb, int32_t yb);
void (*DisableClipping)(struct fb_info *info); void (*DisableClipping)(struct fb_info *info);
int32_t (*SetupForCPUToScreenAlphaTexture)(struct fb_info *info, 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 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); 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); 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 */ /* Cursor functions */
@@ -473,10 +485,10 @@ struct fb_info
struct fb_fix_screeninfo fix; /* Current fix */ struct fb_fix_screeninfo fix; /* Current fix */
struct fb_monspecs monspecs; /* Current Monitor specs */ struct fb_monspecs monspecs; /* Current Monitor specs */
struct fb_videomode *mode; /* current mode */ struct fb_videomode *mode; /* current mode */
char *screen_base; /* Virtual address */ char *screen_base; /* virtual address */
uint32_t screen_size; uint32_t screen_size;
char *ram_base; /* base vram */ char *ram_base; /* base vram */
uint32_t ram_size; /* vram size */ uint32_t ram_size; /* vram size */
char *screen_mono; char *screen_mono;
long update_mono; long update_mono;
struct fb_ops *fbops; struct fb_ops *fbops;
@@ -520,17 +532,17 @@ extern int32_t fb_validate_mode(const struct fb_var_screeninfo *var, struct fb_i
/* modedb.c */ /* modedb.c */
#define VESA_MODEDB_SIZE 34 #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 , 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); 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_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 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 struct fb_videomode
{ {
uint16_t refresh; /* optional */ uint16_t refresh; /* optional */
uint16_t xres; uint16_t xres;
uint16_t yres; uint16_t yres;
uint32_t pixclock; uint32_t pixclock;

View File

@@ -356,6 +356,15 @@ void init_isr(void)
dbg("Error: unable to register isr for XLB PCI interrupts\r\n"); 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 = MCF_XLB_XARB_IMR_SEAE | /* slave error acknowledge interrupt */
MCF_XLB_XARB_IMR_MME | /* multiple master at prio 0 interrupt */ MCF_XLB_XARB_IMR_MME | /* multiple master at prio 0 interrupt */
MCF_XLB_XARB_IMR_TTAE | /* TT address only 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. * 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. * attribute isn't set.
*/ */
static void fix_stram_header() __attribute__((optimize("no-delete-null-pointer-checks"))); static void fix_stram_header() __attribute__((optimize("no-delete-null-pointer-checks")));
@@ -469,7 +478,7 @@ void BaS(void)
/* /*
* memory setup * memory setup
*/ */
// memset((void *) 0x200, 0, 0x400); memset((void *) 0x200, 0, 0x400);
#if defined(MACHINE_FIREBEE) #if defined(MACHINE_FIREBEE)
/* set Falcon bus control register */ /* set Falcon bus control register */
@@ -478,6 +487,12 @@ void BaS(void)
* (volatile uint8_t *) 0xffff8007 = 0x48; * (volatile uint8_t *) 0xffff8007 = 0x48;
#endif /* MACHINE_FIREBEE */ #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 */ /* ST RAM */
* (uint32_t *) 0x42e = STRAM_END; /* phystop TOS system variable */ * (uint32_t *) 0x42e = STRAM_END; /* phystop TOS system variable */
@@ -508,6 +523,7 @@ void BaS(void)
enable_pci_interrupts(); enable_pci_interrupts();
init_pci(); init_pci();
video_init(); video_init();
/* initialize USB devices */ /* initialize USB devices */
@@ -528,11 +544,6 @@ void BaS(void)
NOP(); /* force pipeline sync */ NOP(); /* force pipeline sync */
/*
* FireTOS wants to have the TOS system variables cleared
*/
memset((void *) 0x400, 0, 0x400);
/* ST RAM */ /* ST RAM */
* (uint32_t *) 0x42e = STRAM_END; /* phystop TOS system variable */ * (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 */ MCF_XLB_XARB_SR = status; /* rwc bits */
return false; return true;
} }
#if defined(MACHINE_FIREBEE) #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 , 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, const struct fb_videomode *default_mode,
uint32_t default_bpp) unsigned int default_bpp)
{ {
int32_t i,abs; int i;
int32_t res_specified = 0, bpp_specified = 0, refresh_specified = 0; int abs;
uint32_t xres = 0, yres = 0, bpp = default_bpp, refresh = 0; int res_specified = 0;
int32_t yres_specified = 0; int bpp_specified = 0;
unsigned long best, diff; 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"); 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? */ /* Did the user specify a video mode? */
if (resolution->used) /* fVDI mode */ if (resolution->used) /* fVDI mode */
{ {
refresh = (uint32_t)resolution->freq; refresh = resolution->freq;
if (refresh) if (refresh)
refresh_specified = 1; refresh_specified = 1;
bpp = (uint32_t)resolution->bpp; bpp = resolution->bpp;
if (resolution->flags & MODE_EMUL_MONO_FLAG) if (resolution->flags & MODE_EMUL_MONO_FLAG)
bpp = 8; bpp = 8;
if (bpp) if (bpp)
bpp_specified = 1; bpp_specified = 1;
yres = (uint32_t)resolution->height; yres = resolution->height;
if (yres) if (yres)
yres_specified = 1; yres_specified = 1;
xres = (uint32_t)resolution->width; xres = resolution->width;
if (xres) if (xres)
res_specified = 1; res_specified = 1;
} }

View File

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