unknown type name intrmask_t when include sys/systm.h

jchan21

New Member


Messages: 12

I am new to freebsd, just imported

#include <sys/systm.h> errors Not find uintfptr_t Intrmask_t definitions,

Do yall know what else I need to include or change?

Code:
n file included from main.c:4:
/usr/include/sys/systm.h:419:39: error: unknown type name 'uintfptr_t'; did you
      mean 'uintptr_t'?
void    profclock(int cnt, int usermode, uintfptr_t pc);
                                         ^
/usr/include/sys/_stdint.h:80:22: note: 'uintptr_t' declared here
typedef uintptr_t             uintptr_t;
                                ^
In file included from main.c:4:
/usr/include/sys/systm.h:480:17: error: unknown type name 'intrmask_t'; did you
      mean 'intmax_t'?
static inline intrmask_t      splbio(void)            { return 0; }
                ^
/usr/include/sys/_stdint.h:84:21: note: 'intmax_t' declared here
typedef intmax_t              intmax_t;
         In file included from main.c:4:
/usr/include/sys/systm.h:419:39: error: unknown type name 'uintfptr_t'; did you
      mean 'uintptr_t'?
void    profclock(int cnt, int usermode, uintfptr_t pc);
                                         ^
/usr/include/sys/_stdint.h:80:22: note: 'uintptr_t' declared here
typedef uintptr_t             uintptr_t;
 

ralphbsz

Son of Beastie

Reaction score: 2,389
Messages: 3,277

A: If you want real help, you need to explain to us what you are really trying to accomplish: what are you compiling, where did you get it from, ...

B: Try including types.h first. It might help, there is a definition of uintfptr_t in there (line 277 on my machine). Why didn't you try "grep uintfptr_t /usr/include/sys/*" first?
 

mark_j

Daemon

Reaction score: 726
Messages: 1,262

I am new to freebsd, just imported

#include <sys/systm.h> errors Not find uintfptr_t Intrmask_t definitions,

Do yall know what else I need to include or change?

Code:
n file included from main.c:4:
/usr/include/sys/systm.h:419:39: error: unknown type name 'uintfptr_t'; did you
      mean 'uintptr_t'?
void    profclock(int cnt, int usermode, uintfptr_t pc);
                                         ^
/usr/include/sys/_stdint.h:80:22: note: 'uintptr_t' declared here
typedef uintptr_t             uintptr_t;
                                ^
In file included from main.c:4:
/usr/include/sys/systm.h:480:17: error: unknown type name 'intrmask_t'; did you
      mean 'intmax_t'?
static inline intrmask_t      splbio(void)            { return 0; }
                ^
/usr/include/sys/_stdint.h:84:21: note: 'intmax_t' declared here
typedef intmax_t              intmax_t;
         In file included from main.c:4:
/usr/include/sys/systm.h:419:39: error: unknown type name 'uintfptr_t'; did you
      mean 'uintptr_t'?
void    profclock(int cnt, int usermode, uintfptr_t pc);
                                         ^
/usr/include/sys/_stdint.h:80:22: note: 'uintptr_t' declared here
typedef uintptr_t             uintptr_t;

I'm not sure what you're working on, but if you're delving into interrupt priority levels, then you would probably know what other include files are required to bring in interrupt pointer structures? No?

I am also not sure why FreeBSD still uses splbio(). In NetBSD, it moved to splvm() many, many years ago.

In fact, I just looked at the include file, and noted this:
Code:
/* Stubs for obsolete functions that used to be for interrupt management */
static __inline intrmask_t      splbio(void)            { return 0; }

So, what are you doing? Trying to achieve?
 
OP
J

jchan21

New Member


Messages: 12

I'm not sure what you're working on, but if you're delving into interrupt priority levels, then you would probably know what other include files are required to bring in interrupt pointer structures? No?

I am also not sure why FreeBSD still uses splbio(). In NetBSD, it moved to splvm() many, many years ago.

In fact, I just looked at the include file, and noted this:
Code:
/* Stubs for obsolete functions that used to be for interrupt management */
static __inline intrmask_t      splbio(void)            { return 0; }

So, what are you doing? Trying to achieve?
A: If you want real help, you need to explain to us what you are really trying to accomplish: what are you compiling, where did you get it from, ...

B: Try including types.h first. It might help, there is a definition of uintfptr_t in there (line 277 on my machine). Why didn't you try "grep uintfptr_t /usr/include/sys/*" first?

I think the problem was I didn't install the source in the /usr/src for the errors above. Thanks!

But building a kernel module is the goal. I made a simple kernel module to test out. The version I have is FreeBSD-13.0-CURRENT. The kernel module is basically right now make load , make unload to see if the uprintf works. Seems like my source is not correct version. Trying to debug this now. If you know which source is correct for FreeBSD 13.0 CURRENT ARM64, that will be great!
 

mark_j

Daemon

Reaction score: 726
Messages: 1,262

What source is not the correct version? Kernel?
From the start you probably shouldn't be using Current but pick a stable Release unless you know what you're doing, which, no offense, you don't; you're learning.
Go use 11.3 or 12.1. Both have good support for Arm64 (aarch64), just not good ports support.
 
OP
J

jchan21

New Member


Messages: 12

What source is not the correct version? Kernel?
From the start you probably shouldn't be using Current but pick a stable Release unless you know what you're doing, which, no offense, you don't; you're learning.
Go use 11.3 or 12.1. Both have good support for Arm64 (aarch64), just not good ports support.

Error code 1 Stop. KLD skeleton.ko: depends on kernel - not available or version mismatch kldload: can't load /usr/local/ma/src/skeleton.ko: module already loaded or in kernel

I thought my source may not be correct for the error above error code 1.. When i kldstat -v , the skeleton kernel module is not loaded.

The code is here for the simple kernel module:
Code:
#include <sys/types.h>
#include <sys/module.h>
#include <sys/systm.h>
#include <sys/errno.h>
#include <sys/param.h>
#include <sys/kernel.h>


static int
skel_loader(struct module *m, int what, void *arg)
{
        int err = 0;

        switch (what) {
        case MOD_LOAD:
                uprintf("The answer to life);
                break;
        case MOD_UNLOAD:
                uprintf("Skeleton KLD unloaded.\n");
                break;
        default:
                err = EOPNOTSUPP;
                break;
        }
        return err;
}

static moduledata_t skel_mod = {
        "skel",
        skel_loader,
        NULL
};

DECLARE_MODULE(skeleton, skel_mod, SI_SUB_KLD, SI_ORDER_ANY);


The makefile for it is here
SRCS=skeleton.c
KMOD=skeleton

.include <bsd.kmod.mk>
 

mark_j

Daemon

Reaction score: 726
Messages: 1,262

I'm not sure why. Personally I would use release unless he's going to build the kernel. Who knows what patches have changed what and he's attempting to build a loadable module; you want the kernel to source to match, exactly.
 
Top