summaryrefslogtreecommitdiff
path: root/kernel/mboot/rsdp.c
blob: 48afff3e9a341878cf37d4343d8dc9951f8b6e18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <lib.h>
#include <comus/mboot.h>

#include "mboot.h"

void *mboot_get_rsdp(void)
{
	void *tag;

	// acpi 2.0
	tag = locate_mboot_table(MBOOT_NEW_RSDP);
	if (tag != NULL) {
		struct mboot_tag_new_rsdp *rsdp = (struct mboot_tag_new_rsdp *)tag;
		return rsdp->rsdp;
	}

	// acpi 1.0
	tag = locate_mboot_table(MBOOT_OLD_RSDP);
	if (tag != NULL) {
		struct mboot_tag_old_rsdp *rsdp = (struct mboot_tag_old_rsdp *)tag;
		return rsdp->rsdp;
	}

	return NULL;
}