2007-11-05 Robert Millan <rmh@aybabtu.com>

* disk/ata.c: Remove `<grub/machine/time.h>'.  Include `<grub/time.h>'.
	(grub_ata_wait): Reimplement using grub_millisleep().

	* include/grub/misc.h (grub_div_roundup): Fix parenthesization.
	* include/grub/i386/time.h (grub_cpu_idle): Disable `hlt' instruction.
This commit is contained in:
robertmh 2007-11-05 14:54:00 +00:00
parent be7ac41e14
commit 0149ab7c63
5 changed files with 14 additions and 8 deletions

View file

@ -1,3 +1,11 @@
2007-11-05 Robert Millan <rmh@aybabtu.com>
* disk/ata.c: Remove `<grub/machine/time.h>'. Include `<grub/time.h>'.
(grub_ata_wait): Reimplement using grub_millisleep().
* include/grub/misc.h (grub_div_roundup): Fix parenthesization.
* include/grub/i386/time.h (grub_cpu_idle): Disable `hlt' instruction.
2007-11-03 Marco Gerards <marco@gnu.org>
* term/i386/pc/vga_text.c: Include <grub/cpu/io.h>.

View file

@ -2283,7 +2283,7 @@ und-ata.lst: pre-ata.o
$(NM) -u -P -p $< | cut -f1 -d' ' >> $@
ata_mod-disk_ata.o: disk/ata.c
$(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -MD -c -o $@ $<
$(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -MD -c -o $@ $<
-include ata_mod-disk_ata.d
CLEANFILES += cmd-ata_mod-disk_ata.lst fs-ata_mod-disk_ata.lst

View file

@ -21,9 +21,9 @@
#include <grub/misc.h>
#include <grub/disk.h>
#include <grub/mm.h>
#include <grub/time.h>
/* XXX: For now this only works on i386. */
#include <grub/cpu/io.h>
#include <grub/machine/time.h>
#include <grub/machine/biosdisk.h>
typedef enum
@ -142,10 +142,7 @@ grub_ata_wait_drq (struct grub_ata_device *dev)
static inline void
grub_ata_wait (void)
{
grub_uint32_t time;
time = grub_get_rtc ();
while (time + 1 > grub_get_rtc ());
grub_millisleep (50);
}
/* Byteorder has to be changed before strings can be read. */

View file

@ -22,7 +22,8 @@
static __inline void
grub_cpu_idle ()
{
__asm__ __volatile__ ("hlt");
/* FIXME: this can't work untill we handle interrupts. */
/* __asm__ __volatile__ ("hlt"); */
}
#endif /* ! KERNEL_CPU_TIME_HEADER */

View file

@ -106,7 +106,7 @@ grub_max (long x, long y)
static inline unsigned int
grub_div_roundup (unsigned int x, unsigned int y)
{
return (x + (y - 1) / y);
return (x + y - 1) / y;
}
#endif /* ! GRUB_MISC_HEADER */