Loading [MathJax]/extensions/tex2jax.js
CS350 COS
COS
All Data Structures Files Functions Variables Typedefs Macros
sga.h File Reference

Go to the source code of this file.

Data Structures

struct  SGEntry
 
struct  SGArray
 

Macros

#define SGARRAY_MAX_ENTRIES   32
 

Typedefs

typedef struct SGEntry SGEntry
 
typedef struct SGArray SGArray
 

Functions

void SGArray_Init (SGArray *sga)
 
int SGArray_Append (SGArray *sga, uint64_t off, uint64_t len)
 
void SGArray_Dump (SGArray *sga)
 

Data Structure Documentation

◆ SGEntry

struct SGEntry

Definition at line 7 of file sga.h.

Collaboration diagram for SGEntry:
[legend]
Data Fields
uint64_t length
uint64_t offset

◆ SGArray

struct SGArray

Definition at line 13 of file sga.h.

Collaboration diagram for SGArray:
[legend]
Data Fields
SGEntry entries[SGARRAY_MAX_ENTRIES]
uint32_t len

Macro Definition Documentation

◆ SGARRAY_MAX_ENTRIES

#define SGARRAY_MAX_ENTRIES   32

Definition at line 5 of file sga.h.

Typedef Documentation

◆ SGArray

typedef struct SGArray SGArray

◆ SGEntry

typedef struct SGEntry SGEntry

Function Documentation

◆ SGArray_Append()

int SGArray_Append ( SGArray sga,
uint64_t  off,
uint64_t  len 
)

Definition at line 18 of file sga.c.

19{
21
22 sga->entries[sga->len].offset = off;
23 sga->entries[sga->len].length = len;
24 sga->len++;
25
26 return sga->len;
27}
#define ASSERT(_x)
Definition: kassert.h:8
uint64_t len
Definition: multiboot.h:2
uint64_t length
Definition: sga.h:10
#define SGARRAY_MAX_ENTRIES
Definition: sga.h:5
SGEntry entries[SGARRAY_MAX_ENTRIES]
Definition: sga.h:16
uint32_t len
Definition: sga.h:15
uint64_t offset
Definition: sga.h:9
Here is the caller graph for this function:

◆ SGArray_Dump()

void SGArray_Dump ( SGArray sga)

Definition at line 30 of file sga.c.

31{
32 int i;
33
34 kprintf("--- SGArray Begin ---\n");
35 for (i = 0; i < sga->len; i++)
36 {
37 kprintf("%d: %016llx %016llx\n", i, sga->entries[i].offset,
38 sga->entries[i].length);
39 }
40 kprintf("--- SGArray End ---\n");
41}
int kprintf(const char *fmt,...)
Definition: printf.c:210
Here is the call graph for this function:

◆ SGArray_Init()

void SGArray_Init ( SGArray sga)

Definition at line 12 of file sga.c.

13{
14 sga->len = 0;
15}
Here is the caller graph for this function: