Where is BUS_ALLOC_RESOURCE defined!

Kernel development, writing drivers, coding, and questions regarding FreeBSD internals.

Where is BUS_ALLOC_RESOURCE defined!

Postby FestusHagen » 15 Nov 2011, 21:54

Hi all,

Been grep'n source, searching the web, created a ctags of the complete src tree, yet I still cannot find the definition of the macro BUS_ALLOC_RESOURCE.

Where is it please ?

Thanks

One would think the source file name would be indicated in the functions man page!

-Enjoy
fh : )_~
User avatar
FestusHagen
Junior Member
 
Posts: 62
Joined: 01 Dec 2008, 15:16

Postby DutchDaemon » 16 Nov 2011, 00:42

You don't mean [FILE]sys/sys/bus.h[/FILE]?
User avatar
DutchDaemon
Old Fart
 
Posts: 10467
Joined: 16 Nov 2008, 20:17
Location: The Netherlands

Postby FestusHagen » 16 Nov 2011, 03:19

First place I looked.

This is what I'm looking for (highlighted in red):
From: [FILE]kern/subr_bus.c[/FILE]
Code: Select all
/**
 * @brief Wrapper function for BUS_ALLOC_RESOURCE().
 *
 * This function simply calls the BUS_ALLOC_RESOURCE() method of the
 * parent of @p dev.
 */
struct resource *
bus_alloc_resource(device_t dev, int type, int *rid, u_long start, u_long end,
    u_long count, u_int flags)
{
   if (dev->parent == NULL)
      return (NULL);
   return ([color="Red"]BUS_ALLOC_RESOURCE[/color](dev->parent, dev, type, rid, start, end,
       count, flags));
}


Thanks

-Enjoy
fh : )_~
User avatar
FestusHagen
Junior Member
 
Posts: 62
Joined: 01 Dec 2008, 15:16

Postby PseudoCylon » 18 Nov 2011, 03:58

[FILE]/usr/obj/usr/src/sys/YOUR_KERNCONF_NAME/bus_if.h[/FILE]

The file is generated at compile time. You need to compile kernel otherwise there isn't such dir.

[man=1]awk[/man] (uses a script file [FILE]make???.awk[/FILE] I don't remember) reads corresponding [FILE]*.m[/FILE] files in [FILE]/usr/src/sys/kern/[/FILE], in this case reads [FILE]/usr/src/sys/kern/bus_if.m[/FILE] and makes the file.
PseudoCylon
Member
 
Posts: 151
Joined: 07 Oct 2009, 03:26
Location: Alberta, Canada

Postby FestusHagen » 18 Nov 2011, 14:45

PseudoCylon wrote:[FILE]/usr/obj/usr/src/sys/YOUR_KERNCONF_NAME/bus_if.h[/FILE]

The file is generated at compile time. You need to compile kernel otherwise there isn't such dir.

[man=1]awk[/man] (uses a script file [FILE]make???.awk[/FILE] I don't remember) reads corresponding [FILE]*.m[/FILE] files in [FILE]/usr/src/sys/kern/[/FILE], in this case reads [FILE]/usr/src/sys/kern/bus_if.m[/FILE] and makes the file.


Much Thanks!

I was reading over the Kobj last night and figured this out, what an amazing obfuscation!

-Enjoy
fh : )_~
User avatar
FestusHagen
Junior Member
 
Posts: 62
Joined: 01 Dec 2008, 15:16


Return to FreeBSD Development

Who is online

Users browsing this forum: No registered users and 0 guests