merge mainline into net

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-12-15 20:51:35 +01:00
commit bd67ad0f70
335 changed files with 22289 additions and 5940 deletions

View file

@ -77,6 +77,8 @@ grub_netbuff_alloc (grub_size_t len)
struct grub_net_buff *nb;
void *data;
COMPILE_TIME_ASSERT (NETBUFF_ALIGN % sizeof (grub_properly_aligned_t) == 0);
if (len < NETBUFFMINLEN)
len = NETBUFFMINLEN;
@ -84,7 +86,8 @@ grub_netbuff_alloc (grub_size_t len)
data = grub_memalign (NETBUFF_ALIGN, len + sizeof (*nb));
if (!data)
return NULL;
nb = (struct grub_net_buff *) ((grub_uint8_t *) data + len);
nb = (struct grub_net_buff *) ((grub_properly_aligned_t *) data
+ len / sizeof (grub_properly_aligned_t));
nb->head = nb->data = nb->tail = data;
nb->end = (grub_uint8_t *) nb;
return nb;