summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2019-05-03 11:27:51 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2019-05-03 15:57:48 +0200
commitf3af2bef2fbc60119f4cf8499cb146347c184213 (patch)
treee53203b1a2db5c696dbb0c65a6b18cc98353ddf7 /kernel
parentea7bf0d918dcb2e947fb10c5e95df4e945b727e5 (diff)
downloaddrakx-f3af2bef2fbc60119f4cf8499cb146347c184213.tar
drakx-f3af2bef2fbc60119f4cf8499cb146347c184213.tar.gz
drakx-f3af2bef2fbc60119f4cf8499cb146347c184213.tar.bz2
drakx-f3af2bef2fbc60119f4cf8499cb146347c184213.tar.xz
drakx-f3af2bef2fbc60119f4cf8499cb146347c184213.zip
adapt to kernel 5.1
Diffstat (limited to 'kernel')
-rw-r--r--kernel/list_modules.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/list_modules.pm b/kernel/list_modules.pm
index 005f53327..bd7d990f0 100644
--- a/kernel/list_modules.pm
+++ b/kernel/list_modules.pm
@@ -19,7 +19,7 @@ our %l = (
qw(82596 ac3200 acenic aironet4500_card altera_tse amd8111e at1700 atl2 atp),
qw(bcm4400 cassini cs89x0 cx82310_eth de600 de620),
qw(depca dmfe dwc-xlgmac e2100 ec_bhf eepro eexpress enic eth16i),
- qw(ewrk3 fm10k bcmgenet hp hp-plus hp100 i40e i40evf ice),
+ qw(ewrk3 fm10k bcmgenet hp hp-plus hp100 i40e i40evf iavf ice),
qw(iph5526), #- fibre channel
qw(i40evf jme lance ne nfp ni5010 ni52 ni65 nvnet),
qw(prism2_plx qlge r6040 rcpci rhineget),
@@ -43,7 +43,7 @@ our %l = (
firewire => [ qw(eth1394 pcilynx) ],
gigabit => [
qw(amd-xgbe alx aqc111 atl1 atl1c atl1e atlantic at91_ether ax88179_178a bcmsysport be2net bna bnx2 bnx2x bnxt_en cxgb cxgb3 cxgb4 dl2k dwc-xlgmac e1000 e1000e et131x),
- qw(hinic hfi1 igb ipg ixgb ixgbe lan78xx liquidio liquidio_vf macb mlx4_core mlx4_en mlx5_core mvmdio myri_sbus myri10ge netxen_nic ns83820 pch_gbe),
+ qw(hinic hfi1 igb igc ipg ixgb ixgbe lan78xx liquidio liquidio_vf macb mlx4_core mlx4_en mlx5_core mvmdio myri_sbus myri10ge netxen_nic ns83820 pch_gbe),
qw(qla3xxx r8169 s2io samsung-sxgbe sfc sfc-falcon sxg_nic sis190 sk98lin skge sky2 slicoss spidernet stmmac tehuti tg3 via-velocity vxge yellowfin),
qw(bcm5820 bcm5700), #- encrypted
],
@@ -68,12 +68,12 @@ our %l = (
qw(ath_pci atmel_cs atmel_pci b43 b43legacy bcm43xx bcm_wimax bcma brcm80211 brcmsmac brcmfmac carl9170 com20020_cs),
qw(dyc_ar5 hostap_cs hostap_pci hostap_plx i2400m_usb ipw2100),
qw(ipw2200 ipw3945 iwl3945 iwl4965 iwlagn iwldvm iwlmvm iwlwifi libertas_spi madwifi_pci),
- qw(mt76x0 mt76x2e mt76x2u mt7601u mwifiex_pcie mwifiex_sdio mwifiex_usb mwl8k ndiswrapper netwave_cs orinoco orinoco_cs),
+ qw(mt76x2e mt76x2u mt7601u mt76x02 mt76x0e mt76x0u mt7603e mwifiex_pcie mwifiex_sdio mwifiex_usb mwl8k ndiswrapper netwave_cs orinoco orinoco_cs),
qw(orinoco_nortel orinoco_pci orinoco_plx orinoco_tmd orinoco_usb p54pci p54spi),
qw(p54usb prism2_cs prism2_pci prism2_usb prism54 qmi_wwan qtnfmac qtnfmac_pcie r8180),
qw(r8187se rtl8188ee rtl8192ce r8192_pci r8192s_usb r8192u_usb r8712u r8723bs r8822be ray_cs rndis_wlan rsi_sdio rsi_usb rt2400 rt2400pci rt2500),
qw(rt2500pci rt2500usb rt2570 rt2800pci rt2800usb rt2860 rt2860sta rt2870),
- qw(rt3070sta rt61 rt61pci rt73 rt73usb rtl8180 rtl8187 rtl8187se rtl818x_pci r8188eu r8192ee r8723au rtl_pci rtl_usb rtusb),
+ qw(rt3070sta rt61 rt61pci rt73 rt73usb rtl8180 rtl8187 rtl8187se rtl818x_pci r8188eu r8192ee r8723au rtl_pci rtl_usb rtusb rtwpci),
qw(rtl8192se rtl8192cu rtl8192de rtl8192ee rtl8723ae rtl8723be rtl8821ae rtl8xxxu spectrum_cs sr9700 sr9800 ssb usb8xxx usbvnet_rfmd vt6655_stage vt6656_stage vt_ar5k w35und),
qw(wavelan_cs wcn36xx wil6210 wl wl1251_sdio wl1251_spi wl12xx wl18xx wl3501_cs wlcore_sdio wvlan_cs zd1201 zd1211rw),
],
@@ -110,7 +110,7 @@ our %l = (
'53c7,8xx',
qw(a100u2w advansys aha152x aha1542 aha1740 am53c974 atp870u),
qw(be2iscsi bfa BusLogic dc395x dc395x_trm dmx3191d dtc eata eata_dma),
- qw(eata_pio fdomain g_NCR5380 in2000 initio mpt2sas mpt3sas mvsas NCR53c406a),
+ qw(eata_pio fdomain g_NCR5380 in2000 initio mpt2sas mpt3sas mvsas myrb myrs NCR53c406a),
qw(nsp32 pas16 pci2220i pm80xx pm8001 psi240i qla1280 qla2x00 qla2xxx),
qw(qlogicfas qlogicfc rsxx seagate shasta skd sim710 snic stex sym53c416),
qw(t128 tmscsim u14-34f ultrastor wd7000 xen-scsiback xen-scsifront),
@@ -171,7 +171,7 @@ our %l = (
pcmcia => [
qw(au1x00_ss i82365 i82092 pd6729 tcic vrc4171_card vrc4173_cardu yenta_socket), # cb_enabler
],
- hid => [ qw(ff-memless hid hid-a4tech hid-apple hid-appleir hid-asus hid-aureal hid-axff hid-belkin hid-betopff
+ hid => [ qw(ff-memless hid hid-a4tech hid-apple hid-appleir hid-asus hid-aureal hid-axff hid-belkin hid-betopff hid_bigbenff
hid-cherry hid-chicony hid-cmedia hid-corsair hid-cougar hid-cp2112 hid-cypress hid-dr hid-drff hid-elan hid-elecom hid-elo hid-emsff
hid-ezkey hid-gaff hid-gembird hid-generic hid-gfrm hid-google-hammer hid-gt683r hid-gyration hid-holtek-kbd hid-holtekff hid-holtek-mouse
hid-hyperv hid-icade hid-ite hid-jabra hid-kensington hid-keytouch hid-kye hid-lcpower hid-led hid-lenovo hid-lenovo-tpkbd
> 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546
/* Copyright (c) 1998, 1999, 2001 John E. Davis
 * This file is part of the S-Lang library.
 *
 * You may distribute under the terms of either the GNU General Public
 * License or the Perl Artistic License.
 */
#include "slinclud.h"

#include "slang.h"
#include "_slang.h"

typedef struct _SLstring_Type
{
   struct _SLstring_Type *next;
   unsigned int ref_count;
   char bytes [1];
}
SLstring_Type;

static SLstring_Type *String_Hash_Table [SLSTRING_HASH_TABLE_SIZE];
static char Single_Char_Strings [256 * 2];

#if _SLANG_OPTIMIZE_FOR_SPEED
#define MAX_FREE_STORE_LEN 32
static SLstring_Type *SLS_Free_Store [MAX_FREE_STORE_LEN];

# define NUM_CACHED_STRINGS 601
typedef struct 
{
   unsigned long hash;
   SLstring_Type *sls;
   unsigned int len;
}
Cached_String_Type;
static Cached_String_Type Cached_Strings [NUM_CACHED_STRINGS];

#define GET_CACHED_STRING(s) \
   (Cached_Strings + (unsigned int)(((unsigned long) (s)) % NUM_CACHED_STRINGS))

_INLINE_
static void cache_string (SLstring_Type *sls, unsigned int len, unsigned long hash)
{
   Cached_String_Type *cs;
   
   cs = GET_CACHED_STRING(sls->bytes);
   cs->sls = sls;
   cs->hash = hash;
   cs->len = len;
}

_INLINE_
static void uncache_string (char *s)
{
   Cached_String_Type *cs;
   
   cs = GET_CACHED_STRING(s);
   if ((cs->sls != NULL)
       && (cs->sls->bytes == s))
     cs->sls = NULL;
}
#endif



_INLINE_
unsigned long _SLstring_hash (unsigned char *s, unsigned char *smax)
{
   register unsigned long h = 0;
   register unsigned long sum = 0;
   unsigned char *smax4;

   smax4 = smax - 4;

   while (s < smax4)
     {
	sum += s[0];
	h = sum + (h << 1);
	sum += s[1];
	h = sum + (h << 1);
	sum += s[2];
	h = sum + (h << 1);
	sum += s[3];
	h = sum + (h << 1);
	
	s += 4;
     }

   while (s < smax)
     {
	sum += *s++;
	h ^= sum + (h << 3);	       /* slightly different */
     }

   return h;
}

unsigned long _SLcompute_string_hash (char *s)
{
#if _SLANG_OPTIMIZE_FOR_SPEED
   Cached_String_Type *cs;
   SLstring_Type *sls;

   cs = GET_CACHED_STRING(s);
   if (((sls = cs->sls) != NULL)
       && (sls->bytes == s))
     return cs->hash;
#endif
   return _SLstring_hash ((unsigned char *) s, (unsigned char *) s + strlen (s));
}

_INLINE_
/* This routine works with any (long) string */
static SLstring_Type *find_string (char *s, unsigned int len, unsigned long hash)
{
   SLstring_Type *sls;
   char ch;

   sls = String_Hash_Table [(unsigned int)(hash % SLSTRING_HASH_TABLE_SIZE)];

   if (sls == NULL)
     return NULL;

   ch = s[0];
   do
     {
	char *bytes = sls->bytes;

	/* Note that we need to actually make sure that bytes[len] == 0. 
	 * In this case, it is not enough to just compare pointers.  In fact,
	 * this is called from create_nstring, etc...  It is unlikely that the
	 * pointer is a slstring
	 */
	if ((/* (s == bytes) || */ ((ch == bytes[0])
		 && (0 == strncmp (s, bytes, len))))
	    && (bytes [len] == 0))
	  break;

	sls = sls->next;
     }
   while (sls != NULL);

   return sls;
}

_INLINE_
static SLstring_Type *find_slstring (char *s, unsigned long hash)
{
   SLstring_Type *sls;

   sls = String_Hash_Table [(unsigned int)(hash % SLSTRING_HASH_TABLE_SIZE)];
   while (sls != NULL)
     {
	if (s == sls->bytes)
	  return sls;

	sls = sls->next;
     }
   return sls;
}

_INLINE_
static SLstring_Type *allocate_sls (unsigned int len)
{
   SLstring_Type *sls;
   
#if _SLANG_OPTIMIZE_FOR_SPEED
   if ((len < MAX_FREE_STORE_LEN)
       && (NULL != (sls = SLS_Free_Store [len])))
     {
	SLS_Free_Store[len] = NULL;
	return sls;
     }
#endif
   /* FIXME: use structure padding */
   return (SLstring_Type *) SLmalloc (len + sizeof (SLstring_Type));
}

_INLINE_
static void free_sls (SLstring_Type *sls, unsigned int len)
{
#if _SLANG_OPTIMIZE_FOR_SPEED
   if ((len < MAX_FREE_STORE_LEN)
       && (SLS_Free_Store[len] == NULL))
     {
	SLS_Free_Store [len] = sls;
	return;
     }
#else
   (void) len;
#endif
   SLfree ((char *)sls);
}

_INLINE_
static char *create_long_string (char *s, unsigned int len, unsigned long hash)
{
   SLstring_Type *sls;

   sls = find_string (s, len, hash);

   if (sls != NULL)
     {
	sls->ref_count++;
	s = sls->bytes;

#if _SLANG_OPTIMIZE_FOR_SPEED
	cache_string (sls, len, hash); 
#endif
	return s;
     }

   sls = allocate_sls (len);
   if (sls == NULL)
     return NULL;

   strncpy (sls->bytes, s, len);
   sls->bytes[len] = 0;
   sls->ref_count = 1;

#if _SLANG_OPTIMIZE_FOR_SPEED
   cache_string (sls, len, hash);
#endif

   hash = hash % SLSTRING_HASH_TABLE_SIZE;
   sls->next = String_Hash_Table [(unsigned int)hash];
   String_Hash_Table [(unsigned int)hash] = sls;

   return sls->bytes;
}

_INLINE_
static char *create_short_string (char *s, unsigned int len)
{
   char ch;

   /* Note: if len is 0, then it does not matter what *s is.  This is
    * important for SLang_create_nslstring.
    */
   if (len) ch = *s; else ch = 0;

   len = 2 * (unsigned int) ((unsigned char) ch);
   Single_Char_Strings [len] = ch;
   Single_Char_Strings [len + 1] = 0;
   return Single_Char_Strings + len;
}

/* s cannot be NULL */
_INLINE_
static char *create_nstring (char *s, unsigned int len, unsigned long *hash_ptr)
{
   unsigned long hash;

   if (len < 2)
     return create_short_string (s, len);

   hash = _SLstring_hash ((unsigned char *) s, (unsigned char *) (s + len));
   *hash_ptr = hash;

   return create_long_string (s, len, hash);
}

char *SLang_create_nslstring (char *s, unsigned int len)
{
   unsigned long hash;
   return create_nstring (s, len, &hash);
}

char *_SLstring_make_hashed_string (char *s, unsigned int len, unsigned long *hashptr)
{
   unsigned long hash;

   if (s == NULL) return NULL;

   hash = _SLstring_hash ((unsigned char *) s, (unsigned char *) s + len);
   *hashptr = hash;

   if (len < 2)
     return create_short_string (s, len);

   return create_long_string (s, len, hash);
}

char *_SLstring_dup_hashed_string (char *s, unsigned long hash)
{
   unsigned int len;
#if _SLANG_OPTIMIZE_FOR_SPEED
   Cached_String_Type *cs;
   SLstring_Type *sls;
   
   if (s == NULL) return NULL;
   if (s[0] == 0)
     return create_short_string (s, 0);
   if (s[1] == 0)
     return create_short_string (s, 1);
     
   cs = GET_CACHED_STRING(s);
   if (((sls = cs->sls) != NULL)
       && (sls->bytes == s))
     {
	sls->ref_count += 1;
	return s;
     }
#else
   if (s == NULL) return NULL;
#endif

   len = strlen (s);
#if !_SLANG_OPTIMIZE_FOR_SPEED
   if (len < 2) return create_short_string (s, len);
#endif

   return create_long_string (s, len, hash);
}

char *_SLstring_dup_slstring (char *s)
{
   SLstring_Type *sls;
   unsigned int len;
   unsigned long hash;
#if _SLANG_OPTIMIZE_FOR_SPEED
   Cached_String_Type *cs;
   
   cs = GET_CACHED_STRING(s);
   if (((sls = cs->sls) != NULL)
       && (sls->bytes == s))
     {
	sls->ref_count += 1;
	return s;
     }
#endif
   
   if ((s == NULL) || ((len = strlen (s)) < 2))
     return s;

   hash = _SLstring_hash ((unsigned char *)s, (unsigned char *)(s + len));

   sls = find_slstring (s, hash);
   if (sls == NULL)
     {
	SLang_Error = SL_INTERNAL_ERROR;
	return NULL;
     }
   
   sls->ref_count++;
#if _SLANG_OPTIMIZE_FOR_SPEED
   cache_string (sls, len, hash);
#endif
   return s;
}

static void free_sls_string (SLstring_Type *sls, char *s, unsigned int len, 
			     unsigned long hash)
{
   SLstring_Type *sls1, *prev;

#if _SLANG_OPTIMIZE_FOR_SPEED
   uncache_string (s);
#endif

   hash = hash % SLSTRING_HASH_TABLE_SIZE;

   sls1 = String_Hash_Table [(unsigned int) hash];

   prev = NULL;

   /* This should not fail. */
   while (sls1 != sls)
     {
	prev = sls1;
	sls1 = sls1->next;
     }

   if (prev != NULL)
     prev->next = sls->next;
   else
     String_Hash_Table [(unsigned int) hash] = sls->next;

   free_sls (sls, len);
}

_INLINE_
static void free_long_string (char *s, unsigned int len, unsigned long hash)
{
   SLstring_Type *sls;

   if (NULL == (sls = find_slstring (s, hash)))
     {
	SLang_doerror ("Application internal error: invalid attempt to free string");
	return;
     }

   sls->ref_count--;
   if (sls->ref_count != 0)
     {
#if _SLANG_OPTIMIZE_FOR_SPEED
	/* cache_string (sls, len, hash); */
#endif
	return;
     }
   

   free_sls_string (sls, s, len, hash);
}

/* This routine may be passed NULL-- it is not an error. */
void SLang_free_slstring (char *s)
{
   unsigned long hash;
   unsigned int len;
#if _SLANG_OPTIMIZE_FOR_SPEED
   Cached_String_Type *cs;
   SLstring_Type *sls;

   cs = GET_CACHED_STRING(s);
   if (((sls = cs->sls) != NULL)
       && (sls->bytes == s))
     {
	if (sls->ref_count <= 1)
	  free_sls_string (sls, s, cs->len, cs->hash);
	else
	  sls->ref_count -= 1;
	return;
     }
#endif

   if (s == NULL) return;

   if ((len = strlen (s)) < 2)
     return;

   hash = _SLstring_hash ((unsigned char *)s, (unsigned char *) s + len);
   free_long_string (s, len, hash);
}

char *SLang_create_slstring (char *s)
{
   unsigned long hash;
#if _SLANG_OPTIMIZE_FOR_SPEED
   Cached_String_Type *cs;
   SLstring_Type *sls;

   cs = GET_CACHED_STRING(s);
   if (((sls = cs->sls) != NULL)
       && (sls->bytes == s))
     {
	sls->ref_count += 1;
	return s;
     }
#endif

   if (s == NULL) return NULL;
   return create_nstring (s, strlen (s), &hash);
}

void _SLfree_hashed_string (char *s, unsigned int len, unsigned long hash)
{
   if ((s == NULL) || (len < 2)) return;
   free_long_string (s, len, hash);
}


char *_SLallocate_slstring (unsigned int len)
{
   SLstring_Type *sls = allocate_sls (len);
   if (sls == NULL)
     return NULL;

   return sls->bytes;
}

void _SLunallocate_slstring (char *s, unsigned int len)
{
   SLstring_Type *sls;
   
   if (s == NULL)
     return;
   
   sls = (SLstring_Type *) (s - offsetof(SLstring_Type,bytes[0]));
   free_sls (sls, len);
}

char *_SLcreate_via_alloced_slstring (char *s, unsigned int len)
{   
   unsigned long hash;
   SLstring_Type *sls;

   if (s == NULL)
     return NULL;
   
   if (len < 2)
     {
	char *s1 = create_short_string (s, len);
	_SLunallocate_slstring (s, len);
	return s1;
     }

   /* s is not going to be in the cache because when it was malloced, its
    * value was unknown.  This simplifies the coding.
    */
   hash = _SLstring_hash ((unsigned char *)s, (unsigned char *)s + len);
   sls = find_string (s, len, hash);
   if (sls != NULL)
     {
	sls->ref_count++;
	_SLunallocate_slstring (s, len);
	s = sls->bytes;

#if _SLANG_OPTIMIZE_FOR_SPEED
	cache_string (sls, len, hash); 
#endif
	return s;
     }
	
   sls = (SLstring_Type *) (s - offsetof(SLstring_Type,bytes[0]));
   sls->ref_count = 1;

#if _SLANG_OPTIMIZE_FOR_SPEED
   cache_string (sls, len, hash);
#endif

   hash = hash % SLSTRING_HASH_TABLE_SIZE;
   sls->next = String_Hash_Table [(unsigned int)hash];
   String_Hash_Table [(unsigned int)hash] = sls;

   return s;
}

/* Note, a and b may be ordinary strings.  The result is an slstring */
char *SLang_concat_slstrings (char *a, char *b)
{
   unsigned int lena, len;
   char *c;

   lena = strlen (a);
   len = lena + strlen (b);

   c = _SLallocate_slstring (len);
   if (c == NULL)
     return NULL;

   strcpy (c, a);
   strcpy (c + lena, b);

   return _SLcreate_via_alloced_slstring (c, len);
}