aesni.c (86d7f5d3) aesni.c (ed20d0e3)
1/*-
2 * Copyright (c) 2005-2008 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * Copyright (c) 2010 Konstantin Belousov <kib@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 164 unchanged lines hidden (view full) ---

173 * NOTE:
174 * If the allocation size is 2^n, then the memory returned
175 * by kmalloc(9) will be 2^n aligned.
176 */
177 for (size = AESNI_ALIGN; size < sizeof(*ses); size <<= 1)
178 ;
179 ses = kmalloc(size, M_AESNI, M_WAITOK | M_ZERO);
180 if ((uintptr_t)ses & (AESNI_ALIGN - 1)) {
1/*-
2 * Copyright (c) 2005-2008 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * Copyright (c) 2010 Konstantin Belousov <kib@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 164 unchanged lines hidden (view full) ---

173 * NOTE:
174 * If the allocation size is 2^n, then the memory returned
175 * by kmalloc(9) will be 2^n aligned.
176 */
177 for (size = AESNI_ALIGN; size < sizeof(*ses); size <<= 1)
178 ;
179 ses = kmalloc(size, M_AESNI, M_WAITOK | M_ZERO);
180 if ((uintptr_t)ses & (AESNI_ALIGN - 1)) {
181 panic("aesni: ses %p is not %d aligned\n",
181 panic("aesni: ses %p is not %d aligned",
182 ses, AESNI_ALIGN);
183 }
184
185 spin_lock(&sc->lock);
186 ses->id = sc->sid++;
187 } else {
188 TAILQ_REMOVE(&sc->sessions, ses, next);
189 }

--- 168 unchanged lines hidden ---
182 ses, AESNI_ALIGN);
183 }
184
185 spin_lock(&sc->lock);
186 ses->id = sc->sid++;
187 } else {
188 TAILQ_REMOVE(&sc->sessions, ses, next);
189 }

--- 168 unchanged lines hidden ---