Loading [MathJax]/extensions/tex2jax.js
CS350 COS
COS
All Data Structures Files Functions Variables Typedefs Macros
sga.c File Reference
#include <stdint.h>
#include <sys/kassert.h>
#include <sys/sga.h>
Include dependency graph for sga.c:

Go to the source code of this file.

Functions

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

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: